/* =============================================
   NaPoPustu.me – Consumer CSS
   ============================================= */

:root {
    --primary: #E63946;
    --primary-dark: #c1121f;
    --primary-light: #ff6b6b;
    --surface: #ffffff;
    --surface-2: #f8f9fa;
    --border: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-hint: #adb5bd;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --bottom-nav-height: 64px;
}

/* ---- Base ---- */
* { box-sizing: border-box; }

body.consumer-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--surface-2);
    color: var(--text-primary);
    padding-bottom: var(--bottom-nav-height);
}

@media (min-width: 768px) {
    body.consumer-body { padding-bottom: 0; }
}

/* ---- Navbar ---- */
.consumer-navbar {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: var(--shadow);
    padding: 10px 0;
}

.consumer-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-primary) !important;
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
}

.logo-icon { font-size: 1.4rem; }
.logo-dot { color: var(--primary); }

/* Search */
.consumer-search-form { max-width: 420px; }

.consumer-search-input {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
    border: 1.5px solid var(--border);
    border-right: none;
    font-size: 0.9rem;
    padding: 8px 14px;
    transition: border-color 0.15s;
}
.consumer-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230,57,70,0.12);
}
.consumer-search-btn {
    background: var(--primary);
    color: white;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
    border: 1.5px solid var(--primary);
    padding: 8px 14px;
    transition: background 0.15s;
}
.consumer-search-btn:hover { background: var(--primary-dark); color: white; }

/* Nav buttons */
.consumer-nav-dropdown {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
}
.consumer-nav-dropdown:hover,
.consumer-nav-dropdown.show {
    background: var(--surface);
    color: var(--primary);
}
.consumer-nav-dropdown::after {
    border-top-color: currentColor;
}

.consumer-login-btn {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    padding: 6px 14px;
    font-weight: 600;
}
.consumer-login-btn:hover { background: var(--primary); color: white; }

.consumer-register-btn {
    background: var(--primary);
    color: white;
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    padding: 6px 14px;
    font-weight: 600;
}
.consumer-register-btn:hover { background: var(--primary-dark); color: white; }

.consumer-points-btn {
    background: rgba(230,57,70,0.08);
    color: var(--primary);
    border: 1.5px solid rgba(230,57,70,0.2);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 5px 10px;
}

.consumer-avatar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 700;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.consumer-avatar-btn::after { display: none; }

.consumer-dropdown {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-width: 200px;
}
.consumer-dropdown .dropdown-item { padding: 10px 16px; font-size: 0.9rem; }
.consumer-dropdown .dropdown-item:hover { background: var(--surface-2); color: var(--primary); }

.consumer-toggler {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 9px;
}
.consumer-toggler:focus { box-shadow: none; }

/* ---- Main ---- */
.consumer-main { min-height: calc(100vh - 130px); }

/* ---- Cards ---- */
.product-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.product-card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    padding: 12px;
    background: var(--surface-2);
}

.product-card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: auto;
    padding-top: 8px;
}

.product-card-old-price {
    font-size: 0.78rem;
    color: var(--text-hint);
    text-decoration: line-through;
}

.discount-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 20px;
}

/* ---- Favorite heart button ---- */
.fav-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(255,255,255,0.88);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease;
    z-index: 2;
}
.fav-btn:hover { transform: scale(1.2); }
.fav-btn.active { background: rgba(255,255,255,0.95); }

/* ---- Favorites banner section ---- */
.fav-banner {
    background: #fff8f5;
    border: 1px solid #ffe0d0;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
}
.fav-banner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.fav-banner-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}
.fav-banner-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.fav-banner-scroll::-webkit-scrollbar { display: none; }
.fav-banner-item {
    flex-shrink: 0;
    width: 80px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.fav-banner-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #f0e0d8;
    background: #fff;
}
.fav-banner-name {
    font-size: 0.68rem;
    color: #444;
    margin-top: 3px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Seller prices in product card ---- */
.seller-prices {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.seller-price-row {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--surface-2);
    border-radius: 6px;
    padding: 3px 6px;
}
.seller-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}
.sp-name {
    font-size: 0.72rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.sp-price {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary);
}
.sp-old {
    font-size: 0.72rem;
    color: var(--text-hint);
    text-decoration: line-through;
    margin-left: auto;
}

/* ---- Card qty controls ---- */
.card-qty-row {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    height: 32px;
}
.qty-btn {
    background: var(--surface-2);
    border: none;
    width: 32px;
    height: 100%;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.15s;
    flex-shrink: 0;
}
.qty-btn:hover { background: var(--border); }
.qty-btn.qty-plus {
    background: var(--primary);
    color: white;
}
.qty-btn.qty-plus:hover { background: var(--primary-dark); }
.qty-display {
    flex: 1;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
}
.card-family-btn {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 4px 6px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
    text-align: center;
}
.card-family-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ---- Section headers ---- */
.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ---- Hero ---- */
.consumer-hero {
    background: linear-gradient(135deg, var(--primary) 0%, #c1121f 100%);
    color: white;
    padding: 48px 0;
    text-align: center;
}

.hero-title {
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 28px;
}

.hero-search-wrap {
    max-width: 560px;
    margin: 0 auto;
}

.hero-search-wrap .form-control {
    border-radius: var(--radius) 0 0 var(--radius) !important;
    padding: 14px 20px;
    font-size: 1rem;
    border: none;
    box-shadow: none;
}

.hero-search-wrap .btn {
    border-radius: 0 var(--radius) var(--radius) 0 !important;
    background: white;
    color: var(--primary);
    font-weight: 700;
    padding: 14px 20px;
    border: none;
}

/* ---- Category chips ---- */
.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    white-space: nowrap;
    transition: all 0.15s;
}
.category-chip:hover, .category-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ---- Filter row ---- */
.filter-row {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    position: sticky;
    top: 64px;
    z-index: 100;
}

/* ---- Stat cards (homepage) ---- */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    text-align: center;
}
.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
}
.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ---- Feature cards (homepage) ---- */
.feature-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px 20px;
    transition: box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}
.feature-card:hover { box-shadow: var(--shadow-lg); color: inherit; }

.feature-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
}

.feature-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.feature-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ---- Bottom Nav (mobile) ---- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.bottom-nav::-webkit-scrollbar { display: none; }

.bottom-nav-item {
    min-width: 72px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-hint);
    padding: 8px 4px;
    transition: color 0.15s;
    border-radius: var(--radius-sm);
    position: relative;
}
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active .bottom-nav-icon { transform: scale(1.1); }

.bottom-nav-icon { font-size: 1.35rem; line-height: 1; }
.bottom-nav-label { font-size: 0.65rem; font-weight: 500; }

/* ---- Floating Cart Button (desktop) ---- */
.floating-cart-btn {
    position: fixed;
    bottom: 32px;
    right: 28px;
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(230,57,70,0.45);
    z-index: 999;
    transition: transform 0.15s, box-shadow 0.15s;
}
.floating-cart-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(230,57,70,0.55);
    color: white;
}
.floating-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #212529;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    border: 2px solid white;
}

/* ---- Forms ---- */
.consumer-form-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 32px;
    box-shadow: var(--shadow);
}

.consumer-input {
    border-radius: var(--radius-sm) !important;
    border: 1.5px solid var(--border) !important;
    padding: 10px 14px;
    font-size: 0.9rem;
    transition: border-color 0.15s;
}
.consumer-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(230,57,70,0.1) !important;
}

.consumer-btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 11px 20px;
    font-weight: 700;
    font-size: 0.95rem;
    width: 100%;
    transition: background 0.15s;
    cursor: pointer;
}
.consumer-btn-primary:hover { background: var(--primary-dark); color: white; }
.consumer-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.consumer-btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    width: 100%;
    transition: all 0.15s;
    cursor: pointer;
}
.consumer-btn-outline:hover { background: var(--primary); color: white; }

/* ---- Divider with text ---- */
.divider-text {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-hint);
    font-size: 0.85rem;
    margin: 16px 0;
}
.divider-text::before, .divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ---- Google btn ---- */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    width: 100%;
    cursor: pointer;
    transition: background 0.15s;
}
.google-btn:hover { background: var(--surface-2); }

/* ---- Alerts ---- */
.consumer-alert {
    border-radius: var(--radius-sm);
    border: none;
    padding: 12px 16px;
    font-size: 0.9rem;
}
.consumer-alert-danger { background: rgba(230,57,70,0.1); color: var(--primary-dark); }
.consumer-alert-success { background: rgba(25,135,84,0.1); color: #0f5132; }

/* ---- Footer ---- */
.consumer-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: 48px;
}
.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    padding: 3px 0;
    font-size: 0.875rem;
}
.footer-link:hover { color: var(--primary); }

/* ---- Fridge items ---- */
.fridge-item {
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    transition: box-shadow 0.15s;
}
.fridge-item:hover { box-shadow: var(--shadow); }

/* ---- Quantity controls ---- */
.qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
    border-radius: 20px;
    padding: 4px 8px;
}
.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--surface);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.qty-btn:hover { background: var(--primary); color: white; }
.qty-value { font-weight: 700; min-width: 24px; text-align: center; font-size: 0.9rem; }

/* ---- Toast ---- */
.consumer-toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}
@media (min-width: 768px) {
    .consumer-toast-container { bottom: 20px; }
}

/* ---- Skeleton loading ---- */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.2s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Recipe cards ---- */
.recipe-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 16px;
    cursor: pointer;
    transition: box-shadow 0.2s;
    margin-bottom: 10px;
}
.recipe-card:hover { box-shadow: var(--shadow); }

/* ---- Chips ---- */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.15s;
    white-space: nowrap;
}
.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.filter-chip:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

/* ---- Pagination ---- */
.consumer-pagination .page-link {
    border-radius: var(--radius-sm) !important;
    margin: 0 2px;
    border: 1.5px solid var(--border);
    color: var(--text-primary);
}
.consumer-pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}
.consumer-pagination .page-link:hover { color: var(--primary); }

/* ---- Utility ---- */
.text-primary-red { color: var(--primary) !important; }
.bg-primary-red { background-color: var(--primary) !important; }
.border-primary-red { border-color: var(--primary) !important; }

.fw-800 { font-weight: 800; }
.rounded-consumer { border-radius: var(--radius) !important; }


/* ─── CATEGORIES SIDEBAR ─────────────────────────────────────────────────── */
.consumer-categories-btn {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.consumer-categories-btn:hover { border-color: var(--primary); color: var(--primary); }

.cat-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
}
.cat-overlay.open { display: block; }

.cat-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 300px;
    background: var(--bg);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}
.cat-sidebar.open { transform: translateX(0); }

.cat-sidebar-header {
    background: var(--primary);
    color: white;
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.cat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.cat-sidebar-body {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
}

.cat-loading { padding: 20px; color: var(--text-muted); font-size: 0.875rem; }

.cat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 20px;
    font-size: 0.875rem;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.cat-item:hover { background: var(--surface); color: var(--primary); }
.cat-parent { font-weight: 600; }
.cat-child { padding-left: 36px; font-weight: 400; color: var(--text-muted); }
.cat-child:hover { color: var(--primary); }

.cat-arrow {
    font-size: 1.1rem;
    transition: transform 0.2s;
    color: var(--text-muted);
}
.cat-has-children.expanded .cat-arrow { transform: rotate(90deg); }

.cat-children { display: none; }

/* ---- List page tabs ---- */
.list-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.list-tab {
    background: none;
    border: none;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.list-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.list-tab-badge {
    background: var(--primary);
    color: white;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

/* ---- Product detail ---- */
.product-detail-img {
    max-width: 280px;
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: var(--radius);
    background: var(--surface);
    padding: 16px;
    box-shadow: var(--shadow);
}
.cat-children.open { display: block; }

/* ---- Optimize page ---- */
.opt-mode-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}
.opt-mode-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}
.opt-savings-panel {
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.opt-store-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 14px;
    overflow: hidden;
}
.opt-store-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px 10px;
}
.opt-store-name {
    font-weight: 700;
    font-size: 0.95rem;
}
.opt-store-addr {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.opt-store-total {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
}
.opt-divider {
    height: 1px;
    background: var(--border);
    margin: 0 16px;
}
.opt-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: opacity 0.2s;
    border-bottom: 1px solid var(--border);
}
.opt-item:last-child {
    border-bottom: none;
}
.opt-item:hover {
    background: var(--surface-2);
}
.opt-item-name {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.opt-item-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.opt-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.opt-item-price {
    font-size: 0.9rem;
    font-weight: 700;
}
.opt-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

/* ─── SETTINGS PAGE ───────────────────────────────────────────────────────── */
.settings-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-hint);
    letter-spacing: 0.08em;
    margin: 16px 4px 6px;
}
.settings-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.settings-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.settings-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}
.settings-row:hover { background: var(--surface-2); }
.settings-row-icon { font-size: 1.2rem; flex-shrink: 0; }
.settings-row-title { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.settings-row-sub { font-size: 0.72rem; color: var(--text-hint); }
.settings-row-arrow { font-size: 1.2rem; color: var(--text-hint); }
.settings-divider { height: 1px; background: var(--border); margin: 0 16px; }
