/* ================================================================
    SPOON REDESIGN - MENU PAGE STYLESHEET
    Version: 2.1 (Fluid Typography Update)
   ================================================================ */

/* ====================
   1. DESIGN SYSTEM & VARIABLES
   ==================== */
:root {
    /* (Variables remain the same) */
    --brand-primary: #eb1700;
    --brand-primary-dark: #d41400;
    --text-primary: #2C2C2C;
    --text-secondary: #666666;
    --text-on-brand: #FFFFFF;
    --background-light: #F8F9FA;
    --background-white: #FFFFFF;
    --border-color: #E0E0E0;
    --inactive-grey: #F1F1F1;
    --success-green: #2E7D32;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --radius-medium: 12px;
    --radius-large: 16px;
    --radius-pill: 999px;
    --shadow-card: 0px 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-sticky: 0px 2px 8px rgba(0, 0, 0, 0.1);
    --font-family-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ====================
   LOADING ANIMATIONS
   ==================== */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
    cursor: default;
}

.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

/* ====================
   2. BASE & APP SHELL
   ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-main);
    background-color: var(--background-light);
    color: var(--text-primary);
    line-height: 1.5;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--background-white);
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .app-container {
        max-width: 1200px;
    }
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ====================
   2a. ANNOUNCEMENT BANNER
   ==================== */

/**
 * ANNOUNCEMENT BANNER
 * Top notification bar inspired by Parallel AI style
 * Subtle, dismissible, clean design
 */
.announcement-banner {
    background: var(--background-white);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.announcement-banner.hidden {
    display: none;
}

.announcement-banner__content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.announcement-banner__text {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.4;
    text-align: center;
}

.announcement-banner__link {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.announcement-banner__link:hover {
    opacity: 0.8;
}

.announcement-banner__close {
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.announcement-banner__close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.announcement-banner__close:active {
    transform: scale(0.95);
}


/* ====================
   3. HEADER & GREETING (HOME PAGE)
   ==================== */

/**
 * GREETING HEADER
 * Light, minimal header with two-row layout
 * White background with brand color accents only
 * Premium, calm aesthetic
 */
.greeting-header {
    background: var(--background-white);
    padding: var(--spacing-lg) var(--spacing-md) var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.greeting-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.greeting-card__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    color: var(--text-on-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(235, 23, 0, 0.2);
}

.greeting-card__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.greeting-card__text h1 {
    font-size: clamp(18px, 3.5vw, 20px);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.greeting-card__text p {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ====================
   4. STICKY SEARCH SECTION
   ==================== */

/**
 * SEARCH SECTION
 * Sticky search with soft elevation and clean aesthetics
 * Light background with subtle shadow on scroll
 */
.search-section {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
    background: var(--background-white);
}

.search-bar {
    background: var(--background-light);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-md);
    gap: var(--spacing-sm);
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.search-bar:focus-within {
    background: var(--background-white);
    border-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-bar .fa-search {
    color: #999;
    font-size: 16px;
    flex-shrink: 0;
}

.search-bar:focus-within .fa-search {
    color: var(--brand-primary);
}

.search-bar__input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--text-primary);
    background: transparent;
    font-weight: 400;
}

.search-bar__input::placeholder {
    color: #aaa;
    font-weight: 400;
}


/* ====================
   5. MAIN CONTENT AREA
   ==================== */
.main-content {
    padding: 0 var(--spacing-md);
    /* 
     * IMPORTANT: Bottom padding prevents content from being hidden by bottom nav
     * Bottom nav height (60px) + safe spacing (60px) = 120px
     */
    padding-bottom: 120px;
}

.section-title {
    /* ✅ FLUID TYPO: Use clamp() for section titles. */
    /* Min size: 18px, Preferred: 3vw, Max size: 22px */
    font-size: clamp(16px, 3vw, 18px);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

/* --- 5a. Native Ad Placeholder --- */
.ad-section {
    margin-bottom: var(--spacing-lg);
}

.ad-card {
    background: var(--background-light);
    border-radius: var(--radius-medium);
    padding: var(--spacing-md);
    position: relative;
    min-height: 100px;
    display: flex;
    flex-direction: column;
}

.ad-card__label {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    font-size: 10px;
    font-weight: 500;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-card__content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-card__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    color: #bbb;
}

.ad-card__placeholder i {
    font-size: 28px;
}

.ad-card__placeholder span {
    font-size: 12px;
    font-weight: 500;
}


/* --- 5b. Category Navigation --- */

/**
 * CATEGORY SECTION
 * Compact pill-style horizontal scroll categories
 * Brand-aligned active state, refined spacing
 */
.categories-section {
    margin-bottom: var(--spacing-md);
}

.categories-section .section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
}

.categories-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 8px;
}

.category-chip {
    background: var(--background-light);
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-pill);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
}

.category-chip:hover:not(.active) {
    background: #ebebeb;
    color: var(--text-primary);
}

.category-chip.active {
    background: var(--brand-primary);
    color: var(--text-on-brand);
    font-weight: 600;
}

/* --- 5c. Product Listing --- */

/**
 * PRODUCT LIST TITLE
 * Subtle section label, not a heading
 * Tight spacing for seamless flow from categories
 */
.products-section .section-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 4px;
    margin-bottom: 10px;
}

.products-grid {
    display: grid;
    gap: 10px;
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: var(--spacing-md);
    }
}

/**
 * PRODUCT CARD
 * Clean, minimal card with soft elevation
 * Mobile-first, touch-friendly design
 */
.product-card {
    background: var(--background-white);
    border-radius: 14px;
    border: none;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    transition: all 0.2s ease;
    opacity: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.product-card.visible {
    animation: fadeIn 0.4s forwards;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/**
 * PRODUCT CARD HEADER
 * Used in search results to show title and category badge together
 */
.product-card__header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-card__info h4 {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 0;
}

/**
 * CATEGORY BADGE
 * Shows which category an item belongs to (used in search results)
 * 
 * DESIGN:
 * - Small, subtle badge
 * - Brand color for consistency
 * - Rounded corners
 * - Doesn't overwhelm the card
 */
.product-card__category-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--brand-primary);
    background-color: rgba(76, 175, 80, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.product-card__info p {
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-primary);
    margin-top: 2px;
}

.product-card__add-btn {
    width: 34px;
    height: 34px;
    background: var(--brand-primary);
    color: var(--text-on-brand);
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.product-card__add-btn:hover {
    background: var(--brand-primary-dark);
    transform: scale(1.05);
}

.product-card__add-btn:active {
    transform: scale(0.95);
}

.product-card.hidden {
    display: none;
}


/* ====================
   6. STICKY BOTTOM NAVIGATION
   ==================== */
/* (No changes needed, but responsive query is here) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--background-white);
    border-top: 1px solid var(--border-color);
    display: flex;
    padding: var(--spacing-xs) 0;
    z-index: 100;
    box-shadow: var(--shadow-sticky);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--spacing-xs) 0;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
}

.nav-item.active {
    color: var(--brand-primary);
}

.nav-item:hover {
    color: var(--brand-primary);
}

.nav-item__icon {
    font-size: 22px;
}

.nav-item__label {
    font-size: 11px;
    font-weight: 500;
}

.nav-item__badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 22px);
    background: var(--brand-primary);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    border: 2px solid var(--background-white);
    transform: scale(0);
    transition: transform 0.2s ease-out;
}

.nav-item__badge.visible {
    transform: scale(1);
}

@media (max-width: 480px) {
    .bottom-nav {
        left: 0;
        transform: none;
    }
}

@media (min-width: 768px) {
    .bottom-nav {
        max-width: 1200px;
    }
}


/* ====================
   7. ANIMATIONS
   ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====================
   8. UTILITY CLASSES (NEW)
   ==================== */
.hidden {
    display: none !important;
}


/* ========================================
 * OUT OF STOCK STYLES
 * ======================================== */

/* Out of stock card styling */
.product-card.out-of-stock {
    opacity: 0.6;
}

/* Out of stock label */
.out-of-stock-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #e53935;
    margin-top: 4px;
}

/* Disabled add button */
.product-card__add-btn.disabled {
    background: #e0e0e0;
    color: #9e9e9e;
    cursor: not-allowed;
    opacity: 0.5;
}

.product-card__add-btn.disabled:hover {
    background: #e0e0e0;
    color: #9e9e9e;
    transform: none;
}