/**
 * FoodieGo Public Styles
 *
 * @package FoodieGo
 */

/* ================================
   CSS VARIABLES (set via PHP)
   ================================ */
:root {
    --fg-primary: #ff6b6b;
    --fg-secondary: #feca57;
    --fg-accent: #ee5a24;
    --fg-success: #27ae60;
    --fg-bg-start: #1a1a2e;
    --fg-bg-end: #16213e;
    --fg-card-bg: rgba(255,255,255,0.05);
    --fg-card-border: rgba(255,255,255,0.1);
    --fg-text-primary: #ffffff;
    --fg-text-secondary: rgba(255,255,255,0.7);
    --fg-text-muted: rgba(255,255,255,0.5);
    --fg-radius-sm: 12px;
    --fg-radius-md: 16px;
    --fg-radius-lg: 20px;
    
    /* New variables for light/dark mode support */
    --fg-nav-bg: rgba(26, 26, 46, 0.98);
    --fg-shadow-color: rgba(0,0,0,0.3);
    --fg-primary-transparent: rgba(255,107,107,0.5);
    --fg-primary-bg: rgba(255,107,107,0.1);
    --fg-primary-shadow: rgba(255,107,107,0.3);
}
/* ================================
   BASE STYLES
   ================================ */
.fg-container {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--fg-text-primary);
}

.fg-section {
    padding: 0 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ================================
   HERO SECTION (Original)
   ================================ */
.fg-hero {
    position: relative;
    padding: 30px 20px;
    overflow: hidden;
}

.fg-hero-background {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,107,107,0.15) 0%, rgba(238,90,36,0.1) 100%);
    z-index: 0;
}

.fg-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 30px;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.fg-hero-text {
    flex: 1;
}

.fg-hero-clickable-area {
    cursor: pointer;
}

.fg-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,107,107,0.2);
    border: 1px solid rgba(255,107,107,0.3);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fg-primary);
    margin-bottom: 15px;
}

.fg-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 15px;
    color: var(--fg-text-primary);
}

.fg-hero-title span {
    background: linear-gradient(135deg, var(--fg-primary), var(--fg-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fg-hero-subtitle {
    color: var(--fg-text-secondary);
    font-size: 1rem;
    margin-bottom: 25px;
    line-height: 1.6;
}

.fg-hero-cta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

.fg-hero-order-btn {
    min-width: 180px;
    background: linear-gradient(135deg, var(--fg-primary), var(--fg-accent));
    color: white;
    box-shadow: 0 4px 15px var(--fg-primary-shadow);
}

.fg-hero-order-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--fg-primary-shadow);
}

.fg-hero-image {
    flex: 0 0 320px;
    position: relative;
    cursor: pointer;
}

.fg-hero-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: var(--fg-radius-lg);
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}

.fg-hero-price-tag {
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: linear-gradient(135deg, var(--fg-success), #2ecc71);
    padding: 12px 20px;
    border-radius: 15px;
    font-weight: 800;
    font-size: 1.3rem;
    color: white;
    box-shadow: 0 10px 30px rgba(46,204,113,0.4);
}

/* Hero Responsive */
@media (max-width: 768px) {
    .fg-hero {
        margin-bottom: 25px;
    }
    
    .fg-hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .fg-hero-image {
        flex: none;
        width: 100%;
        max-width: 300px;
        order: -1;
    }
    
    .fg-hero-title {
        font-size: 1.8rem;
    }
    
    .fg-hero-cta {
        justify-content: center;
        width: 100%;
        flex-direction: row;
        gap: 10px;
    }
    
    .fg-hero-cta .fg-btn,
    .fg-hero-order-btn {
        flex: 1;
        min-width: 140px;
        max-width: 200px;
        padding: 14px 20px !important;
        font-size: 0.9rem !important;
    }
}

@media (max-width: 480px) {
    .fg-hero-cta {
        flex-direction: column;
        gap: 10px;
    }
    
    .fg-hero-cta .fg-btn,
    .fg-hero-order-btn {
        width: 100%;
        max-width: 100%;
        flex: none;
    }
}

/* ================================
   HERO ADVANCED SECTION
   Auto-rotating with blur transitions & dynamic backgrounds
   ================================ */
.fg-hero-advanced {
    position: relative;
    padding: 35px 20px 30px;
    overflow: hidden;
    min-height: 420px;
    margin-bottom: 40px;
}

/* Background layers with blur transitions */
.fg-hero-advanced-backgrounds {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.fg-hero-advanced-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
}

/* Glassmorphism overlay on backgrounds */
.fg-hero-advanced-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    filter: blur(80px) brightness(0.6);
    transform: scale(1.1);
    opacity: 0.9;
}

.fg-hero-advanced-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(0,0,0,0.3) 0%, 
        rgba(0,0,0,0.5) 100%);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Container */
.fg-hero-advanced-container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
}

/* Slides wrapper */
.fg-hero-advanced-slides {
    position: relative;
    min-height: 360px;
}

/* Individual slide - Unified for Desktop & Mobile (No Blur) */
.fg-hero-advanced-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0.8s;
    will-change: opacity;
    z-index: 1;
}

.fg-hero-advanced-slide.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0s;
    z-index: 2;
}

/* Content layout */
.fg-hero-advanced-content {
    display: flex;
    gap: 40px;
    align-items: center;
}

.fg-hero-advanced-text {
    flex: 1;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 35px;
    border-radius: var(--fg-radius-lg);
    border: 1px solid rgba(255,255,255,0.15);
}

/* Desktop: Badge positioned FLOATING on top of the image */
.fg-hero-advanced-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,107,107,0.35); /* Slightly more opaque for better visibility on images */
    border: 1px solid rgba(255,107,107,0.4);
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff; /* White text looks better floating on images */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 12;
    pointer-events: none; /* Allows clicks to pass through to the image link */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.fg-hero-advanced-title {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    /* Normalize height: font-size (3rem) * line-height (1.1) * 2 lines */
    min-height: 2.2em; 
}

.fg-hero-advanced-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.6;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.fg-hero-advanced-cta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

/* Desktop Order Now Button - Enhanced styling */
.fg-hero-advanced-order-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 200px;
    padding: 18px 30px;
    border-radius: var(--fg-radius-md);
    border: none;
    background: linear-gradient(135deg, var(--fg-primary), var(--fg-accent));
    color: white !important;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 8px 25px var(--fg-primary-shadow);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.fg-hero-advanced-order-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.fg-hero-advanced-order-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px var(--fg-primary-shadow);
}

.fg-hero-advanced-order-btn:hover::before {
    left: 100%;
}

.fg-hero-advanced-order-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--fg-primary-shadow);
}

.fg-hero-advanced-order-btn.loading {
    pointer-events: none;
    opacity: 0.9;
}

/* View Details Button - Scoped for Hero Advanced visibility */
.fg-hero-advanced-cta .fg-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 30px;
    border-radius: var(--fg-radius-md);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff !important; /* Force white for visibility on dark/blurred hero backgrounds */
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.fg-hero-advanced-cta .fg-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffffff;
    transform: translateY(-2px);
}

/* Ensure visibility in Light Mode presets */
:root[style*="--fg-bg-start: #ffffff"] .fg-hero-advanced-cta .fg-btn-secondary,
:root[style*="--fg-bg-start:#ffffff"] .fg-hero-advanced-cta .fg-btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--fg-text-primary) !important;
}


/* Image Wrapper */
.fg-hero-advanced-image-wrap {
    flex: 0 0 420px;
    position: relative;
}

.fg-hero-advanced-image {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: var(--fg-radius-lg);
    max-height: 320px;
}

.fg-hero-advanced-img {
    width: 100%;
    height: 320px;
    max-height: 320px;
    object-fit: cover;
    display: block;
    border-radius: var(--fg-radius-lg);
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    border: 3px solid rgba(255,255,255,0.2);
    transition: transform 0.3s;
}

.fg-hero-advanced-image:hover .fg-hero-advanced-img {
    transform: scale(1.02);
}

/* Price tag - Bottom LEFT, masked by rounded corner */
.fg-hero-advanced-price-tag {
    position: absolute;
    bottom: -15px;
    left: -15px;
    background: linear-gradient(135deg, var(--fg-success), #2ecc71);
    padding: 15px 25px;
    border-radius: 18px;
    font-weight: 800;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 15px 40px rgba(46,204,113,0.5);
    border: 2px solid rgba(255,255,255,0.3);
    z-index: 10;
}

/* Mobile + Add Button - HIDDEN on desktop by default */
.fg-hero-advanced-add-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--fg-primary), var(--fg-accent));
    color: white;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: none !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 8px 25px var(--fg-primary-shadow);
    z-index: 100; /* Increased z-index to stay above clickable image */
}

.fg-hero-advanced-add-btn:active {
    transform: scale(0.95);
}


.fg-hero-advanced-add-btn:active {
    transform: scale(0.95);
}

/* Navigation Dots */
.fg-hero-advanced-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
    position: relative;
    z-index: 10;
}

.fg-hero-advanced-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    border: 2px solid rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.4s;
    padding: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.fg-hero-advanced-dot:hover {
    background: rgba(255,255,255,0.5);
    transform: scale(1.2);
}

.fg-hero-advanced-dot.active {
    background: var(--fg-primary);
    border-color: var(--fg-primary);
    width: 35px;
    border-radius: 6px;
    box-shadow: 0 4px 15px var(--fg-primary-shadow);
}

/* Responsive Hero Advanced - MOBILE RESTYLE (FULL WIDTH & FIXED HEIGHT) */
@media (max-width: 768px) {
    .fg-hero-advanced {
        padding: 0; /* Remove padding to allow full width */
        min-height: auto !important;
        height: auto !important;
        margin-bottom: 25px;
        margin-left: -16px; /* Break out of page padding */
        margin-right: -16px; /* Break out of page padding */
        width: auto;
        border-radius: 0; /* Square edges for full width look */
    }
    
    .fg-hero-advanced-slides {
        min-height: auto !important;
        height: auto;
        display: block;
        position: relative;
        padding: 20px 16px 0; /* Re-add internal padding for the "card" look if desired, or keep 0 for edge-to-edge */
    }
    
    /* Maintain absolute positioning on mobile for transitions */
    .fg-hero-advanced-slide {
        position: absolute !important;
        display: block !important;
        inset: 0 !important;
        filter: none !important; /* Ensure no blur inherited */
    }


    .fg-hero-advanced-content {
        flex-direction: column;
        text-align: center;
        gap: 0;
    }
    
    /* Image Section - The Top Half */
    .fg-hero-advanced-image-wrap {
        flex: none;
        width: 100%;
        max-width: 100%;
        order: -1;
        background: rgba(0,0,0,0.3);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: var(--fg-radius-lg) var(--fg-radius-lg) 0 0;
        border: 1px solid rgba(255,255,255,0.15);
        border-bottom: none;
        padding: 20px 20px 0 20px;
    }
    
    .fg-hero-advanced-image {
        max-height: 260px;
        border-radius: 15px;
    }
    
    .fg-hero-advanced-img {
        width: 100%;
        height: 260px;
        max-height: 260px;
        object-fit: cover;
        border-radius: 15px;
    }
    
    /* Text content - The Bottom Half */
    .fg-hero-advanced-text {
        padding: 15px 20px 25px;
        width: 100%;
        order: 1;
        background: rgba(0,0,0,0.3);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: 0 0 var(--fg-radius-lg) var(--fg-radius-lg);
        border: 1px solid rgba(255,255,255,0.15);
        border-top: none;
    }
    
    .fg-hero-advanced-badge {
        position: absolute;
        top: 15px; /* Adjusted for image wrap padding */
        left: 15px;
        z-index: 12;
    }
    
    .fg-hero-advanced-order-btn {
        display: none !important;
    }
    
    .fg-hero-advanced-add-btn {
        display: flex !important;
        bottom: 15px;
        right: 15px;
    }
    
    .fg-hero-advanced-price-tag {
        bottom: 10px !important;
        left: -5px;
    }
    
    .fg-hero-advanced-title {
        font-size: 1.8rem;
        margin-bottom: 10px;
        -webkit-line-clamp: 2;
        /* Normalize height for mobile: 1.8rem * 1.1 line-height * 2 lines */
        min-height: 2.2em;
    }

    .fg-hero-advanced-subtitle {
        font-size: 0.95rem;
        margin-bottom: 20px;
        -webkit-line-clamp: 2;
    }
    
    .fg-hero-advanced-cta {
        justify-content: center;
        width: 100%;
    }
    
    .fg-hero-advanced-nav {
        margin-top: 15px;
        padding-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .fg-hero-advanced {
        margin-left: -14px;
        margin-right: -14px;
    }
    
    .fg-hero-advanced-slides {
        min-height: 300px !important;
        padding: 15px 14px 0;
    }

    .fg-hero-advanced-image-wrap {
        padding: 15px 15px 0 15px;
    }
    
    .fg-hero-advanced-image,
    .fg-hero-advanced-img {
        max-height: 200px;
        height: 200px;
    }
    
    .fg-hero-advanced-text {
        padding: 12px 15px 20px;
    }
    
       .fg-hero-advanced-title {
           font-size: 1.5rem;
           min-height: 2.2em;
       }
   }

}



/* ================================
   PROMO BANNER
   ================================ */
.fg-promo-banner {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(254,202,87,0.2), rgba(255,159,67,0.1));
    border: 1px solid rgba(254,202,87,0.3);
    border-radius: var(--fg-radius-md);
    margin: 0 20px 25px;
    max-width: 1360px;
    margin-left: auto;
    margin-right: auto;
    cursor: pointer;
    transition: all 0.3s;
}

.fg-promo-banner:hover {
    background: linear-gradient(135deg, rgba(254,202,87,0.25), rgba(255,159,67,0.15));
    transform: translateY(-2px);
}

.fg-promo-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fg-secondary), #ff9f43);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.fg-promo-content {
    flex: 1;
}

.fg-promo-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--fg-secondary);
    margin-bottom: 2px;
}

.fg-promo-text {
    font-size: 0.8rem;
    color: var(--fg-text-muted);
}

.fg-promo-code {
    background: rgba(254,202,87,0.2);
    border: 1px solid rgba(254,202,87,0.4);
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    color: var(--fg-secondary);
    font-size: 0.95rem;
}

@media (max-width: 600px) {
    .fg-promo-banner {
        flex-wrap: wrap;
        margin: 0 16px 20px;
    }
    
    .fg-promo-code {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }
}

/* ================================
   QUICK REORDER
   ================================ */
.fg-reorder-section {
    padding: 25px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.fg-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.fg-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--fg-text-primary);
}

.fg-see-all {
    color: var(--fg-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s;
}

.fg-see-all:hover {
    gap: 10px;
}

.fg-reorder-grid {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.fg-reorder-grid::-webkit-scrollbar {
    display: none;
}

.fg-reorder-card {
    min-width: 280px;
    background: var(--fg-card-bg);
    border-radius: var(--fg-radius-lg);
    padding: 15px;
    border: 1px solid var(--fg-card-border);
    display: flex;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.fg-reorder-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,107,107,0.3);
    transform: translateY(-3px);
}

.fg-reorder-image {
    width: 75px;
    height: 75px;
    border-radius: var(--fg-radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.fg-reorder-info {
    flex: 1;
    min-width: 0;
}

.fg-reorder-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fg-reorder-details {
    font-size: 0.75rem;
    color: var(--fg-text-muted);
    margin-bottom: 10px;
}

.fg-reorder-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fg-reorder-price {
    font-weight: 700;
    color: var(--fg-secondary);
}

.fg-reorder-btn {
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--fg-primary), var(--fg-accent));
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
}

.fg-reorder-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255,107,107,0.4);
}

/* ================================
   CATEGORY NAVIGATION
   ================================ */
.fg-category-nav {
    background: var(--fg-nav-bg, rgba(26, 26, 46, 0.98));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--fg-card-border);
    transition: box-shadow 0.3s, top 0.3s ease-out;
    z-index: 90;
}

.fg-category-nav.sticky {
    position: sticky;
    top: 0;
    /* Will be updated by JS to account for header */
}

/* PWA safe area support */
@supports (padding-top: env(safe-area-inset-top)) {
    .fg-category-nav.sticky {
        padding-top: env(safe-area-inset-top);
    }
}

/* Ensure category nav appears below fixed header */
body.fg-has-fixed-header .fg-category-nav.sticky {
    /* Top value set by JS based on actual header height */
}

.fg-category-nav.scrolled {
    box-shadow: 0 10px 30px var(--fg-shadow-color, rgba(0,0,0,0.3));
}

.fg-category-pills {
    display: flex;
    gap: 12px;
    padding: 15px 20px;
    max-width: 1400px;
    margin: 0 auto;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.fg-category-pills::-webkit-scrollbar {
    display: none;
}

.fg-category-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 25px;
    border: 2px solid var(--fg-card-border);
    background: var(--fg-card-bg);
    color: var(--fg-text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}

.fg-category-pill:hover {
    border-color: var(--fg-primary-transparent, rgba(255,107,107,0.5));
    background: var(--fg-primary-bg, rgba(255,107,107,0.1));
    color: var(--fg-text-primary);
}

.fg-category-pill.active {
    border-color: var(--fg-primary);
    background: linear-gradient(135deg, var(--fg-primary), var(--fg-accent));
    color: white;
    box-shadow: 0 5px 20px var(--fg-primary-shadow, rgba(255,107,107,0.3));
}

.fg-pill-icon {
    font-size: 1.2rem;
}

/* ================================
   FOOD CATEGORY SECTION
   ================================ */
.fg-food-category {
    padding: 25px 0;
    max-width: 1400px;
    margin: 0 auto;
    /* Minimal margin to prevent collision, JS handles the rest */
    scroll-margin-top: 20px; 
}


.fg-category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 20px;
    margin-bottom: 20px;
}

.fg-category-icon {
    width: 55px;
    height: 55px;
    border-radius: var(--fg-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.fg-category-info {
    flex: 1;
}

.fg-category-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--fg-text-primary);
    margin-bottom: 3px;
}

.fg-category-count {
    font-size: 0.85rem;
    color: var(--fg-text-muted);
}

.fg-scroll-hint {
    color: var(--fg-text-muted);
    font-size: 0.8rem;
}

/* ================================
   CATEGORY ICON THEMING
   Ensures category icons follow theme colors
   ================================ */

/* Default category icon uses theme gradient */
.fg-category-icon {
    background: linear-gradient(135deg, var(--fg-primary), var(--fg-accent)) !important;
}

/* Alternative category icon colors (can be applied via class) */
.fg-category-icon.fg-icon-secondary {
    background: linear-gradient(135deg, var(--fg-secondary), #ff9f43) !important;
}

.fg-category-icon.fg-icon-success {
    background: linear-gradient(135deg, var(--fg-success), #2ecc71) !important;
}

/* If admin sets custom color via category meta, inline style will override */
.fg-category-icon[style*="background"] {
    /* Allow inline style to take precedence for custom colors */
}


/* ================================
   FOOD CARDS CONTAINER
   ================================ */
.fg-cards-container {
    display: flex;
    gap: 18px;
    padding: 10px 20px 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.fg-cards-container::-webkit-scrollbar {
    display: none;
}

.fg-cards-container:active {
    cursor: grabbing;
}


/* ================================
   FOOD CARD
   ================================ */
.fg-food-card {
    min-width: 210px;
    max-width: 210px;
    background: var(--fg-card-bg);
    border-radius: var(--fg-radius-lg);
    overflow: hidden;
    border: 1px solid var(--fg-card-border);
    transition: all 0.3s;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.fg-food-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    border-color: rgba(255,107,107,0.3);
}

/* Prevent card from growing on touch */
.fg-food-card:active {
    transform: translateY(-4px);
}

.fg-card-image-container {
    position: relative;
    overflow: hidden;
    height: 140px;
    flex-shrink: 0;
}

.fg-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.fg-food-card:hover .fg-card-image {
    transform: scale(1.1);
}

.fg-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 12px;
    border-radius: var(--fg-radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    z-index: 2;
}

.fg-badge-bestseller {
    background: linear-gradient(135deg, var(--fg-primary), var(--fg-accent));
}

.fg-badge-new {
    background: linear-gradient(135deg, #a55eea, #8854d0);
}

.fg-badge-sale {
    background: linear-gradient(135deg, var(--fg-success), #2ecc71);
}

.fg-badge-spicy {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.fg-badge-vegan {
    background: linear-gradient(135deg, #26de81, #20bf6b);
}

.fg-card-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.fg-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--fg-text-primary);
    line-height: 1.3;
}

.fg-card-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
    font-size: 0.75rem;
}

.fg-star {
    color: var(--fg-secondary);
    font-size: 0.85rem;
}

.fg-rating-value {
    font-size: 0.75rem;
    color: var(--fg-text-muted);
}

.fg-card-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.fg-tag {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.fg-tag-delivery {
    background: rgba(46,204,113,0.2);
}

.fg-tag-pickup {
    background: rgba(52,152,219,0.2);
}

.fg-card-desc {
    color: var(--fg-text-muted);
    font-size: 0.7rem;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 10px;
    flex: 1;
}

.fg-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--fg-card-border);
}

.fg-card-price {
    font-weight: 700;
    font-size: 1rem;
    color: var(--fg-secondary);
    line-height: 1;
}

.fg-card-original-price {
    font-size: 0.75rem;
    color: var(--fg-text-muted);
    text-decoration: line-through;
    margin-left: 5px;
    display: block;
}

.fg-add-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--fg-primary), var(--fg-accent));
    color: white;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
    flex-shrink: 0;
    z-index: 10;
}

.fg-add-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(255,107,107,0.5);
}

.fg-add-btn:active {
    transform: scale(1.05);
}

.fg-add-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

/* Tooltip */
.fg-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    margin-bottom: 8px;
    pointer-events: none;
    z-index: 100;
}

.fg-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0,0,0,0.9);
}

.fg-add-btn:hover .fg-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Mobile-specific card improvements */
@media (max-width: 768px) {
    .fg-food-card {
        min-width: 185px;
        max-width: 185px;
    }
    
    .fg-card-image-container {
        height: 120px;
    }
    
    .fg-card-info {
        padding: 12px;
    }
    
    .fg-card-name {
        font-size: 0.85rem;
        margin-bottom: 5px;
    }
    
    .fg-card-rating {
        font-size: 0.7rem;
        margin-bottom: 5px;
    }
    
    .fg-card-tags {
        margin-bottom: 6px;
    }
    
    .fg-tag {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }
    
    .fg-card-desc {
        font-size: 0.68rem;
        height: 2.4em;
        margin-bottom: 8px;
        line-height: 1.2;
    }
    
    .fg-card-footer {
        padding-top: 6px;
    }
    
    .fg-card-price {
        font-size: 0.95rem;
    }
    
    .fg-add-btn {
        width: 34px;
        height: 34px;
        font-size: 18px;
    }
    
    /* Prevent hover effects on mobile touch */
    .fg-food-card:hover {
        transform: none;
    }
    
    .fg-food-card:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
    
    /* Hide tooltip on mobile */
    .fg-tooltip {
        display: none;
    }
}

@media (max-width: 480px) {
    .fg-food-card {
        min-width: 165px;
        max-width: 165px;
    }
    
    .fg-card-image-container {
        height: 110px;
    }
    
    .fg-card-info {
        padding: 10px;
    }
    
    .fg-card-name {
        font-size: 0.8rem;
    }
    
    .fg-card-desc {
        font-size: 0.65rem;
        height: 2.2em;
    }
    
    /* SCOPED FIX: Only target the button inside the Hero Advanced on mobile */
    .fg-hero-advanced .fg-hero-advanced-add-btn {
        width: 50px;
        height: 50px;
        font-size: 26px;
        bottom: 20px !important;
        right: 20px !important;
        position: absolute !important;
        display: flex !important;
        z-index: 100 !important;
    }

    /* Reset standard card buttons to stay in their footer on mobile */
    .fg-food-card .fg-add-btn {
        position: relative !important;
        bottom: auto !important;
        right: auto !important;
        width: 32px;
        height: 32px;
    }
}


/* ================================
   CART BUTTON
   ================================ */
.fg-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--fg-primary), var(--fg-accent));
    border: none;
    padding: 12px 22px;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-size: 0.9rem;
}

.fg-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255,107,107,0.4);
    color: white;
}

.fg-cart-icon {
    font-size: 1.1rem;
}

.fg-cart-count {
    background: white;
    color: var(--fg-primary);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

/* ================================
   TOAST NOTIFICATION
   ================================ */
.fg-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, var(--fg-success), #2ecc71);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 10px 40px rgba(46,204,113,0.4);
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.fg-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.fg-toast.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 10px 40px rgba(231,76,60,0.4);
}

/* ================================
   SEARCH WIDGET - STANDALONE
   ================================ */
.fg-search-widget {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.fg-search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.fg-search-widget-input {
    width: 100%;
    padding: 16px 55px 16px 22px;
    border-radius: 50px;
    border: 2px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: var(--fg-text-primary);
    font-size: 0.95rem;
    transition: all 0.3s;
    font-family: inherit;
}

.fg-search-widget-input::placeholder {
    color: var(--fg-text-muted);
}

.fg-search-widget-input:focus {
    outline: none;
    border-color: var(--fg-primary);
    background: rgba(255,255,255,0.12);
}

.fg-search-widget-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--fg-primary), var(--fg-accent));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s;
}

.fg-search-widget-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 15px var(--fg-primary-shadow);
}

/* Search Results Dropdown */
.fg-search-results-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: var(--fg-nav-bg);
    border: 1px solid var(--fg-card-border);
    border-radius: var(--fg-radius-lg);
    box-shadow: 0 20px 60px var(--fg-shadow-color);
    z-index: 1000;
    max-height: 500px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.fg-search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--fg-card-border);
    background: var(--fg-card-bg);
}

.fg-search-results-header span {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--fg-text-primary);
}

.fg-search-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--fg-card-bg);
    color: var(--fg-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s;
}

.fg-search-close-btn:hover {
    background: var(--fg-primary);
    color: white;
    transform: rotate(90deg);
}

.fg-search-results-list {
    overflow-y: auto;
    max-height: 450px;
    padding: 10px;
}

.fg-search-group-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--fg-primary);
    padding: 15px 10px 8px;
    opacity: 0.8;
}

.fg-search-result-cat {
    border-left: 3px solid var(--fg-primary);
}

.fg-search-cat-icon {
    width: 40px;
    height: 40px;
    background: var(--fg-card-bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.fg-search-view-arrow {
    color: var(--fg-text-muted);
    font-weight: bold;
}

.fg-search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: var(--fg-radius-md);
    background: var(--fg-card-bg);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--fg-text-primary);
}

.fg-search-result-item:hover {
    background: var(--fg-primary-bg);
    border-color: var(--fg-primary-transparent);
    transform: translateX(5px);
}

.fg-search-result-image {
    width: 60px;
    height: 60px;
    border-radius: var(--fg-radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--fg-card-border);
}

.fg-search-result-info {
    flex: 1;
    min-width: 0;
}

.fg-search-result-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--fg-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fg-search-result-category {
    font-size: 0.75rem;
    color: var(--fg-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fg-search-result-price {
    font-weight: 700;
    color: var(--fg-secondary);
    font-size: 1rem;
    flex-shrink: 0;
}

.fg-search-see-all {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin: 10px;
    background: var(--fg-primary-bg);
    border: 1px dashed var(--fg-primary-transparent);
    border-radius: var(--fg-radius-md);
    color: var(--fg-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.fg-search-see-all:hover {
    background: var(--fg-primary);
    color: white;
    border-style: solid;
}

.fg-search-no-results {
    text-align: center;
    padding: 40px 20px;
}

.fg-search-empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.fg-search-no-results p {
    color: var(--fg-text-muted);
    margin: 0;
}

.fg-search-loading {
    text-align: center;
    padding: 30px;
    color: var(--fg-text-muted);
}

.fg-search-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid var(--fg-card-border);
    border-top-color: var(--fg-primary);
    border-radius: 50%;
    animation: fg-search-spin 0.8s linear infinite;
}

@keyframes fg-search-spin {
    to { transform: rotate(360deg); }
}

/* Mobile Header Search Button */
.fg-header-search-btn {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--fg-card-bg);
    border: 1px solid var(--fg-card-border);
    color: var(--fg-text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s;
}

.fg-header-search-btn:hover {
    background: var(--fg-primary-bg);
    border-color: var(--fg-primary-transparent);
}

/* Mobile Search Modal */
.fg-mobile-search-modal {
    position: fixed;
    inset: 0;
    background: var(--fg-nav-bg);
    z-index: 10001;
    display: none;
    flex-direction: column;
}

.fg-mobile-search-modal.active {
    display: flex;
}

.fg-mobile-search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-bottom: 1px solid var(--fg-card-border);
    background: var(--fg-card-bg);
}

.fg-mobile-search-back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--fg-card-bg);
    border: 1px solid var(--fg-card-border);
    color: var(--fg-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
}

.fg-mobile-search-input {
    flex: 1;
    padding: 12px 18px;
    border-radius: 25px;
    border: 2px solid var(--fg-card-border);
    background: rgba(255,255,255,0.08);
    color: var(--fg-text-primary);
    font-size: 16px;
}

.fg-mobile-search-input:focus {
    outline: none;
    border-color: var(--fg-primary);
}

.fg-mobile-search-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Responsive */
@media (max-width: 768px) and (orientation: portrait) {
    .fg-header-search-btn.mobile-enabled {
        display: flex;
    }
    
    .fg-search-results-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 70vh;
        border-radius: var(--fg-radius-lg) var(--fg-radius-lg) 0 0;
    }
}



/* ================================
   RESPONSIVE
   ================================ */
@media (min-width: 768px) {
    .fg-hero {
        padding: 50px 40px;
    }
    
    .fg-hero-title {
        font-size: 3rem;
    }
    
    .fg-hero-image {
        flex: 0 0 380px;
    }
    
    .fg-hero-image img {
        height: 280px;
    }
    
    .fg-section,
    .fg-reorder-section,
    .fg-category-header {
        padding-left: 40px;
        padding-right: 40px;
    }
    
    .fg-cards-container {
        padding-left: 40px;
        padding-right: 40px;
    }
    
    .fg-category-pills {
        padding-left: 40px;
        padding-right: 40px;
    }
    
    .fg-food-card {
        min-width: 220px;
        max-width: 220px;
    }
}

@media (max-width: 480px) {
    .fg-hero {
        padding: 20px 16px;
    }
    
    .fg-hero-title {
        font-size: 1.6rem;
    }
    
    .fg-btn {
        padding: 12px 20px;
        font-size: 0.85rem;
    }
    
    .fg-section,
    .fg-reorder-section,
    .fg-category-header {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .fg-cards-container {
        padding-left: 16px;
        padding-right: 16px;
        gap: 12px;
    }
    
    .fg-category-pills {
        padding: 12px 16px;
        gap: 8px;
    }
    
    .fg-category-pill {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .fg-food-card {
        min-width: 175px;
        max-width: 175px;
    }
    
    .fg-card-image {
        height: 120px;
    }
    
    .fg-card-info {
        padding: 12px;
    }
    
    .fg-card-name {
        font-size: 0.9rem;
    }
    
    .fg-reorder-card {
        min-width: 250px;
    }
    
    .fg-promo-banner {
        margin: 0 16px 20px;
        padding: 15px;
    }
}
/* ================================
   FEATURED SLIDER
   ================================ */
.fg-featured-slider-section {
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
    overflow: hidden;
}

.fg-featured-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    padding: 0;
}

.fg-featured-slider-title-wrap {
    flex: 1;
}

.fg-featured-slider-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fg-text-primary);
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fg-featured-slider-subtitle {
    font-size: 0.9rem;
    color: var(--fg-text-muted);
    margin: 0;
}

.fg-slider-nav-arrows {
    display: flex;
    gap: 10px;
}

.fg-slider-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--fg-card-border);
    background: var(--fg-card-bg);
    color: var(--fg-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.fg-slider-arrow:hover {
    border-color: var(--fg-primary);
    background: rgba(255,107,107,0.15);
    color: var(--fg-primary);
    transform: scale(1.05);
}

.fg-slider-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.fg-featured-slider-container {
    position: relative;
}

.fg-featured-slider {
    overflow: hidden;
    position: relative;
}

.fg-featured-slider-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    gap: 20px;
}

.fg-featured-slide {
    flex: 0 0 calc(33.333% - 14px);
    min-width: calc(33.333% - 14px);
}

/* Featured Card */
.fg-featured-card {
    background: var(--fg-card-bg);
    border-radius: var(--fg-radius-lg);
    overflow: hidden;
    border: 1px solid var(--fg-card-border);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.fg-featured-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.35);
    border-color: rgba(255,107,107,0.4);
}

.fg-featured-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.fg-featured-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fg-featured-card:hover .fg-featured-img {
    transform: scale(1.1);
}

.fg-featured-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s;
}

.fg-featured-card:hover .fg-featured-card-overlay {
    opacity: 1;
}

.fg-featured-badge {
    align-self: flex-start;
    padding: 6px 14px;
    border-radius: var(--fg-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    opacity: 1;
}

.fg-featured-card .fg-featured-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    opacity: 1;
}

.fg-badge-bestseller {
    background: linear-gradient(135deg, var(--fg-primary), var(--fg-accent));
}

.fg-badge-new {
    background: linear-gradient(135deg, #a55eea, #8854d0);
}

.fg-badge-sale {
    background: linear-gradient(135deg, var(--fg-success), #2ecc71);
}

.fg-featured-quick-add {
    align-self: center;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 30px;
    border: none;
    background: linear-gradient(135deg, var(--fg-primary), var(--fg-accent));
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transform: translateY(20px);
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(255,107,107,0.5);
    margin-top: auto;
    z-index: 10;
}

.fg-featured-card:hover .fg-featured-quick-add {
    transform: translateY(0);
}

.fg-featured-quick-add:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 15px 40px rgba(255,107,107,0.6);
}

.fg-quick-add-icon {
    font-size: 1.1rem;
    font-weight: 700;
}

.fg-featured-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.fg-featured-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.fg-featured-card-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--fg-text-primary);
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.fg-featured-card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.fg-featured-card-rating .fg-star {
    color: var(--fg-secondary);
}

.fg-featured-card-rating .fg-rating-value {
    color: var(--fg-text-primary);
    font-weight: 600;
}

.fg-featured-card-rating .fg-rating-count {
    color: var(--fg-text-muted);
    font-size: 0.75rem;
}

.fg-featured-card-desc {
    color: var(--fg-text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fg-featured-card-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.fg-featured-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--fg-text-muted);
}

.fg-meta-icon {
    font-size: 0.9rem;
}

.fg-featured-meta-tags {
    display: flex;
    gap: 6px;
}

.fg-meta-tag {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.fg-meta-tag.fg-tag-delivery {
    background: rgba(46,204,113,0.2);
}

.fg-meta-tag.fg-tag-pickup {
    background: rgba(52,152,219,0.2);
}

.fg-featured-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--fg-card-border);
}

.fg-featured-card-price {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--fg-secondary);
}

.fg-featured-card-price del {
    font-size: 0.85rem;
    color: var(--fg-text-muted);
    font-weight: 400;
    margin-left: 8px;
}

.fg-featured-card-price ins {
    text-decoration: none;
}

.fg-featured-add-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--fg-primary), var(--fg-accent));
    color: white;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
    z-index: 10;
}

.fg-featured-add-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(255,107,107,0.5);
}

/* Slider Dots */
.fg-slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
}

.fg-slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--fg-card-border);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}

.fg-slider-dot:hover {
    background: rgba(255,107,107,0.5);
}

.fg-slider-dot.active {
    background: var(--fg-primary);
    width: 30px;
    border-radius: 5px;
}

/* Featured Slider Responsive */
@media (max-width: 1024px) {
    .fg-featured-slide {
        flex: 0 0 calc(50% - 10px);
        min-width: calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    .fg-featured-slider-section {
        padding: 30px 16px;
    }
    
    .fg-featured-slider-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .fg-slider-nav-arrows {
        align-self: flex-end;
    }
    
    .fg-featured-slide {
        flex: 0 0 calc(85% - 10px);
        min-width: calc(85% - 10px);
    }
    
    .fg-featured-slider-title {
        font-size: 1.25rem;
    }
    
    .fg-featured-card-name {
        font-size: 1rem;
    }
    
    .fg-featured-card-content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .fg-featured-slide {
        flex: 0 0 calc(90% - 10px);
        min-width: calc(90% - 10px);
    }
    
    .fg-slider-arrow {
        width: 38px;
        height: 38px;
    }
    
    .fg-featured-quick-add {
        padding: 10px 18px;
        font-size: 0.8rem;
    }
}

/* ================================
   PWA & MOBILE APP SUPPORT
   Critical fixes for sticky elements
   ================================ */

/* Ensure proper stacking context for sticky elements */
.fg-header.fg-header-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* Native iOS safe area support - ADDITIVE to base padding */
@supports (padding-top: env(safe-area-inset-top)) {
    .fg-header.fg-header-sticky {
        padding-top: calc(12px + env(safe-area-inset-top));
    }
    
    @media (min-width: 768px) {
        .fg-header.fg-header-sticky {
            padding-top: calc(15px + env(safe-area-inset-top));
        }
    }
}

/* Category nav and filter bar inherit position from JS */
.fg-category-nav.sticky,
.fg-filter-bar {
    /* Top value dynamically set by JS based on actual header height */
    /* This ensures perfect alignment regardless of safe areas */
}

/* Force proper z-index layering in PWA mode */
@media (display-mode: standalone), 
       (display-mode: fullscreen) {
    .fg-header.fg-header-sticky {
        z-index: 1000 !important;
        -webkit-transform: translateZ(1000px);
        transform: translateZ(1000px);
    }
    
    .fg-category-nav.sticky {
        z-index: 90 !important;
        -webkit-transform: translateZ(90px);
        transform: translateZ(90px);
    }
    
    .fg-filter-bar {
        z-index: 90 !important;
        -webkit-transform: translateZ(90px);
        transform: translateZ(90px);
    }
}

/* Prevent sticky positioning conflicts */
.fg-category-nav.sticky,
.fg-filter-bar {
    position: -webkit-sticky;
    position: sticky;
}
