/* ── SweetShop Menu Manager – Mobile App CSS ─────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

* { box-sizing: border-box; }

body.page-menu-manager,
body {
    font-family: 'Nunito', sans-serif !important;
    -webkit-tap-highlight-color: transparent;
}

/* ── App shell ── */
.smm-app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 0;
    font-family: 'Nunito', sans-serif;
    padding-bottom: 80px;
}

/* ── Header ── */
.smm-header {
    background: linear-gradient(135deg, #BA00FF 0%, #FF43AF 100%);
    padding: 20px 18px 16px;
    color: #fff;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 4px 20px rgba(186,0,255,.30);
    position: sticky;
    top: 0;
    z-index: 100;
}

.smm-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.smm-logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.smm-cookie-icon {
    font-size: 36px;
    line-height: 1;
}

.smm-brand {
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    line-height: 1.1;
}

.smm-subtitle {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,.80);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.smm-refresh-btn {
    background: rgba(255,255,255,.20);
    border: 2px solid rgba(255,255,255,.35);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
    flex-shrink: 0;
}
.smm-refresh-btn:hover,
.smm-refresh-btn:active { background: rgba(255,255,255,.35); }

.smm-refresh-icon {
    font-size: 22px;
    color: #fff;
    display: block;
    line-height: 1;
    font-style: normal;
    transition: transform .5s;
}
.smm-refreshing .smm-refresh-icon {
    animation: smm-spin .7s linear infinite;
}
@keyframes smm-spin { to { transform: rotate(360deg); } }

.smm-header-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.smm-category-label {
    font-size: 13px;
    font-weight: 800;
    color: rgba(255,255,255,.90);
    background: rgba(255,255,255,.18);
    padding: 4px 12px;
    border-radius: 50px;
}

.smm-item-count {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,.75);
}

/* ── Status bar ── */
.smm-status-bar {
    margin: 10px 16px 0;
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    font-family: 'Nunito', sans-serif;
}
.smm-status-bar--info    { background: #f7e5ff; color: #BA00FF; border: 2px solid #e8c8f5; }
.smm-status-bar--success { background: #eafff3; color: #006630; border: 2px solid #a5d6a7; }
.smm-status-bar--error   { background: #fff0f7; color: #a0004a; border: 2px solid #FFA4DC; }

/* ── Error card ── */
.smm-error-card {
    margin: 14px 16px 0;
    padding: 14px 16px;
    background: #fff0f7;
    border: 2px solid #FFA4DC;
    border-radius: 14px;
    color: #a0004a;
    font-weight: 700;
    font-size: 14px;
}

/* ── Filter row ── */
.smm-filter-row {
    display: flex;
    gap: 8px;
    padding: 14px 16px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.smm-filter-row::-webkit-scrollbar { display: none; }

.smm-filter-btn {
    flex-shrink: 0;
    padding: 8px 18px;
    border-radius: 50px;
    border: 2px solid #e8c8f5;
    background: #fff;
    color: #7a5a8a;
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
}
.smm-filter-btn.smm-filter-active,
.smm-filter-btn:active {
    background: #BA00FF;
    border-color: #BA00FF;
    color: #fff;
}

/* ── Items list ── */
.smm-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 16px 0;
}

/* ── Item card ── */
.smm-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 2px solid #e8c8f5;
    border-radius: 18px;
    padding: 14px;
    transition: all .2s ease;
    box-shadow: 0 2px 8px rgba(186,0,255,.06);
    position: relative;
}

.smm-item--unavailable {
    border-color: #ffd0e8;
    background: #fff8fb;
    opacity: 0.85;
}

.smm-item--available {
    border-color: #c8f5d8;
    background: #f5fff9;
}

/* ── Item image ── */
.smm-item-img {
    position: relative;
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid #e8c8f5;
    background: #f7e5ff;
}
.smm-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.smm-item-img-placeholder {
    font-size: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.smm-item-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 18px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
}

/* ── Item info ── */
.smm-item-info {
    flex: 1;
    min-width: 0;
}

.smm-item-name {
    font-size: 15px;
    font-weight: 900;
    color: #2d1a3d;
    line-height: 1.25;
    margin-bottom: 4px;
    white-space: normal;
    word-wrap: break-word;
}

.smm-item-desc {
    font-size: 12px;
    color: #7a5a8a;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 5px;
    white-space: normal;
    word-wrap: break-word;
}

.smm-item-status {
    font-size: 12px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 50px;
    display: inline-block;
}
.smm-status--available   { background: #eafff3; color: #006630; }
.smm-status--unavailable { background: #fff0f7; color: #a0004a; }

/* ── Toggle switch ── */
.smm-toggle-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.smm-toggle {
    position: relative;
    display: inline-block;
    width: 58px;
    height: 32px;
    cursor: pointer;
}

.smm-toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.smm-toggle-slider {
    position: absolute;
    inset: 0;
    background: #e0c0f0;
    border-radius: 50px;
    transition: background .25s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,.12);
}

.smm-toggle-slider::before {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .25s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,.20);
}

.smm-toggle-input:checked + .smm-toggle-slider {
    background: linear-gradient(135deg, #BA00FF, #FF43AF);
}

.smm-toggle-input:checked + .smm-toggle-slider::before {
    transform: translateX(26px);
}

/* Disabled state while saving */
.smm-toggle-input:disabled + .smm-toggle-slider {
    opacity: 0.6;
}

/* ── Empty state ── */
.smm-empty {
    text-align: center;
    padding: 48px 24px;
    color: #7a5a8a;
    font-weight: 700;
    font-size: 15px;
}

/* ── Footer ── */
.smm-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 2px solid #e8c8f5;
    padding: 12px 20px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #7a5a8a;
    font-family: 'Nunito', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.smm-footer-dot { color: #e8c8f5; }

/* ── Gate (not logged in) ── */
.smm-gate {
    max-width: 400px;
    margin: 60px auto;
    padding: 32px;
    background: #fff;
    border: 2px solid #e8c8f5;
    border-radius: 20px;
    text-align: center;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    color: #2d1a3d;
    box-shadow: 0 6px 28px rgba(186,0,255,.10);
}
.smm-gate a { color: #FF43AF; font-weight: 800; }
.smm-gate--warn { border-color: #FFAB66; background: #fff8e0; color: #8a5000; }

/* ── Safe area for iPhone X+ ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .smm-footer {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
    .smm-app {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* ── Desktop: center in a phone-sized frame ── */
@media (min-width: 520px) {
    body {
        background: #f3e0ff !important;
        min-height: 100vh;
    }
    .smm-app {
        margin: 20px auto;
        border-radius: 32px;
        overflow: hidden;
        box-shadow: 0 20px 60px rgba(186,0,255,.20);
        background: #f9f2ff;
        min-height: calc(100vh - 40px);
    }
    .smm-header { border-radius: 0; }
    .smm-footer {
        position: sticky;
        bottom: 0;
        border-radius: 0 0 32px 32px;
    }
}

/* ── Dual-toggle layout additions ───────────────────────────────────────────── */

/* Legend in header */
.smm-header-legend {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 8px;
}
.smm-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 800;
    color: rgba(255,255,255,.85);
}
.smm-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.smm-legend-uber { background: #FF43AF; border: 2px solid rgba(255,255,255,.6); }
.smm-legend-web  { background: #43CFFF; border: 2px solid rgba(255,255,255,.6); }

/* Column labels above item list */
.smm-col-labels {
    display: flex;
    align-items: center;
    padding: 4px 16px 2px;
    gap: 8px;
}
.smm-col-labels > span:first-child { flex: 1; }
.smm-col-label {
    width: 62px;
    text-align: center;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 6px;
    border-radius: 6px;
}
.smm-col-uber { background: #fce8f4; color: #a0004a; }
.smm-col-web  { background: #e5f6ff; color: #006680; }

/* Dual toggle wrapper replacing .smm-toggle-wrap */
.smm-toggles-wrap {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.smm-toggle-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.smm-toggle-sub {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #9a7aaa;
}

/* Uber toggle: keep existing purple gradient */
.smm-toggle-input:checked + .smm-slider--uber {
    background: linear-gradient(135deg, #BA00FF, #FF43AF);
}
/* Reset the generic rule so it doesn't conflict */
.smm-toggle-input:checked + .smm-toggle-slider {
    background: linear-gradient(135deg, #BA00FF, #FF43AF);
}

/* Website toggle: teal/blue when ON */
.smm-toggle-input:checked + .smm-slider--web {
    background: linear-gradient(135deg, #00BFFF, #00D4AA);
}

/* Partial badge (one on, one off) */
.smm-badge--partial {
    font-size: 14px;
}

/* Make item card wider to accommodate two toggles */
.smm-item {
    gap: 12px;
}
