/* =====================================================
LAYOUT STYLES: Header, Footer, Navigation, Containers
Extracted from catalog.html for Phase 3.2
===================================================== */

/* =====================================================
HEADER / LOGO SECTION - PROFESSIONAL FIXED NAV BAR
Based on Apple HIG and Modern App Design Principles
===================================================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000; /* High z-index to stay above content */
    background: #489292; /* Teal to match bottom nav bar */
    /* Modern professional edges - iOS hairline style */
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.15); /* Subtle top edge */
    /* Professional shadow for depth and separation - refined iOS/Android style */
    box-shadow: 
        0 0.5px 0 rgba(255, 255, 255, 0.1), /* Top highlight edge */
        0 1px 0 rgba(0, 0, 0, 0.05), /* Subtle top shadow */
        0 2px 4px rgba(248, 131, 121, 0.15), /* Soft depth shadow */
        0 4px 12px rgba(248, 131, 121, 0.1); /* Ambient shadow */
    /* Smooth backdrop blur for iOS-like professional effect */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    /* Safe area support for notched devices */
    padding-top: env(safe-area-inset-top, 0px);
    /* Professional transition for scroll effects */
    transition: box-shadow 0.2s ease, background 0.2s ease;
    /* Modern edge-to-edge design with clean boundaries */
    overflow: hidden;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-4);
    min-height: 56px; /* Standard iOS navigation bar height */
    /* Coral pink background to match bottom nav bar style */
    background: #489292;
    /* Modern professional edges - refined separation */
    position: relative;
    /* Clean inner edges with subtle definition */
    border-left: 0.5px solid rgba(255, 255, 255, 0.1);
    border-right: 0.5px solid rgba(255, 255, 255, 0.1);
}

/* Professional separator line between header and sub-header (on coral background) */
.header-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px; /* More visible separator */
    /* Modern gradient edge - iOS hairline style with stronger visibility */
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.25) 10%, 
        rgba(255, 255, 255, 0.4) 50%, 
        rgba(255, 255, 255, 0.25) 90%, 
        rgba(255, 255, 255, 0) 100%);
    /* Enhanced shadow for clear separation */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08),
                0 0.5px 0 rgba(255, 255, 255, 0.1);
    z-index: 1;
}

/* Modern top edge highlight for professional look */
.header-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0.5px;
    /* Subtle top highlight edge */
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0) 100%);
}

/* Header Brand Group - Logo + Company Name (Left Side) */
.header-brand-group {
    display: flex;
    align-items: center;
    gap: var(--space-1); /* Reduced from space-3 to space-1 for closer logo + name */
    flex: 1;
    min-width: 0; /* Allow shrinking */
}

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.header-brand:hover {
    opacity: 0.8;
    transform: scale(0.98);
}

.header-brand:active {
    transform: scale(0.96);
}

/* Logo Wrapper - Professional iOS style */
.header-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* Minimal spacing from company name - logo and name appear side by side */
    margin-right: 0;
    /* Ensure wrapper always takes space - matches logo height (34px) */
    min-width: 34px;
    min-height: 34px;
    /* Remove any background from wrapper */
    background: transparent !important;
    padding: 0;
    border: none;
}

.header-logo {
    height: 34px; /* Increased by 2px from 32px - Standard iOS navigation bar icon size */
    width: auto;
    max-width: 120px; /* Prevent logo from being too wide */
    min-width: 24px; /* Minimum width to ensure visibility */
    display: none; /* Hidden by default, shown when logo loads */
    object-fit: contain;
    /* Professional image rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* Smooth transitions */
    transition: opacity 0.2s ease, transform 0.2s ease;
    /* Ensure logo is visible when loaded */
    visibility: visible;
    opacity: 1;
    /* Remove white background from logo */
    /* Use mix-blend-mode to blend white backgrounds with the coral pink nav bar */
    /* darken mode: white pixels become transparent/blend with background, colored pixels stay visible */
    mix-blend-mode: darken;
    /* Ensure no background shows through */
    background: transparent !important;
    /* Remove any padding or border that might create white space */
    padding: 0 !important;
    border: none !important;
    /* Remove any box shadow that might create white appearance */
    box-shadow: none !important;
    /* Additional filter to help with white background removal */
    /* Increase contrast slightly to make white more distinct for blending */
    filter: contrast(1.05);
}

.header-logo:hover {
    opacity: 0.9;
}

/* Ensure logo loads properly - show even if initial load fails */
.header-logo[src=""] {
    display: none;
}

/* Handle image load errors gracefully - keep space reserved */
.header-logo:not([src]),
.header-logo[src=""],
.header-logo[src="logo.png"]:not([src*="http"]) {
    /* Keep the space but show a subtle placeholder on error */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    min-width: 24px;
    min-height: 24px;
}

.header-title-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* Allow text truncation if needed */
    flex: 1;
}

.header-title-group h1 {
    font-size: 17px; /* iOS standard large title size */
    font-weight: 600;
    line-height: 1.2;
    color: #FFFFFF; /* White text on coral pink background */
    margin: 0;
    letter-spacing: -0.02em; /* Tighter letter spacing for professional look */
    /* iOS-style font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent text overflow */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-title-group p {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--text-secondary);
    margin: 0;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0; /* Prevent search button from shrinking */
    margin-left: var(--space-2); /* Space from brand group */
}

.header-info-btn {
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-1);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease-stripe);
    opacity: 0.6;
    margin-left: var(--space-2);
}

.header-info-btn:hover {
    opacity: 1;
    color: var(--brand-teal);
    background: rgba(70, 146, 145, 0.1);
}

.header-info-btn:active {
    transform: scale(0.95);
}

.header-info-btn svg {
    width: 16px;
    height: 16px;
}

.terms-header-btn {
    background: #489292;
    border: 1px solid #489292;
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    color: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease-stripe);
    min-width: 44px;
    height: 44px;
}

.terms-header-btn:hover {
    background: #e6756a;
    border-color: #e6756a;
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(248, 131, 121, 0.3);
}

.terms-header-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(248, 131, 121, 0.2);
}

.terms-header-btn svg {
    width: 20px;
    height: 20px;
    stroke: #FFFFFF;
}

/* Search Header Button - Icon Button Style (on coral pink background) */
.search-header-btn {
    background: rgba(255, 255, 255, 0.2); /* Semi-transparent white on coral */
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    color: #FFFFFF; /* White icon on coral background */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease-stripe);
    min-width: 44px;
    min-height: 44px;
    margin-right: var(--space-2);
}

.search-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.5);
}

.search-header-btn:active {
    transform: scale(0.95);
}

.search-header-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}

/* Category Filter Button - Sub-Header with Clear Professional Separation */
.category-filter-container {
    /* Add space from top and bottom for separation */
    padding: var(--space-4) var(--space-4) var(--space-4);
    /* REMOVED margin-bottom - use padding-bottom on products-container instead to prevent coral stripe */
    margin-bottom: 0 !important;
    /* Clear visual separation from top nav bar - modern iOS style */
    border-top: 1px solid rgba(248, 131, 121, 0.2); /* Top edge from coral nav bar */
    /* REMOVED border-bottom to eliminate unwanted stripe below */
    border-bottom: none !important; /* No bottom border - clean separation */
    border-left: 0.5px solid rgba(0, 0, 0, 0.05); /* Left edge */
    border-right: 0.5px solid rgba(0, 0, 0, 0.05); /* Right edge */
    /* Light cream background as requested - ensure it's solid and extends fully */
    background: #fff6e9 !important;
    /* Enhanced shadow for clear separation from top nav - modern iOS style */
    /* REMOVED bottom shadow that could create stripe effect */
    box-shadow: 
        0 1px 0 rgba(255, 255, 255, 0.5), /* Top highlight */
        0 2px 4px rgba(0, 0, 0, 0.06); /* Depth shadow only - no bottom edge */
    /* Ensure it's part of fixed header */
    position: relative;
    z-index: 999;
    /* Remove backdrop blur to ensure solid cream color shows */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    /* Modern edge definition */
    overflow: hidden;
    /* Center the button horizontally */
    display: flex;
    justify-content: center;
    align-items: center;
    /* Add margin-top for additional visual separation */
    margin-top: 1px; /* Creates small gap after separator line */
}

.category-filter-btn {
    /* Smaller button - not full width, centered */
    width: auto;
    min-width: 200px; /* Minimum width for readability */
    max-width: 90%; /* Don't exceed container */
    min-height: 40px; /* Smaller height (was 48px) */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4); /* Reduced padding (was var(--space-3)) */
    /* Coral pink button - ensure it stands out on cream background */
    background: #489292 !important;
    border: 1px solid #489292 !important;
    border-radius: var(--radius-lg);
    color: #FFFFFF !important; /* White text on coral button */
    font-size: 14px; /* Smaller font (was 16px) */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-stripe);
    box-shadow: 0 2px 8px rgba(248, 131, 121, 0.3), 0 1px 3px rgba(248, 131, 121, 0.2);
    /* Center the button */
    margin: 0 auto;
}

.category-filter-btn:hover {
    background: #F66D5E; /* Darker coral on hover */
    border-color: #F66D5E;
    box-shadow: 0 4px 12px rgba(248, 131, 121, 0.35);
    transform: translateY(-1px);
}

.category-filter-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(248, 131, 121, 0.25);
}

.category-filter-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    transition: transform 0.2s var(--ease-stripe);
}

.category-filter-btn:hover svg {
    transform: translateY(2px);
}

@media (min-width: 640px) {
    .category-filter-container {
        padding: var(--space-3) var(--space-6);
        margin-bottom: 0 !important; /* Removed to prevent coral stripe */
        /* More spacing on larger screens (Apple HIG: 24px for tablet/desktop) */
        /* Spacing now handled by products-container margin-top */
    }
}

/* Cart Header Button - Modern Shopping App Style with Teal */
.cart-header-btn {
    position: relative;
    background: var(--gradient-primary, linear-gradient(135deg, #6B7280 0%, #9CA3AF 100%));
    border: 1px solid var(--brand-primary, #6B7280);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    color: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease-stripe);
    min-width: 44px;
    min-height: 44px;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.25);
}

.cart-header-btn:hover {
    filter: brightness(0.9);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.35);
    transform: translateY(-1px);
}

.cart-header-btn:active {
    transform: scale(0.95);
}

.cart-header-btn svg {
    width: 22px;
    height: 22px;
    stroke: #FFFFFF;
}

.cart-header-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--gradient-accent, linear-gradient(135deg, #6B7280 0%, #9CA3AF 100%));
    color: #000;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    padding: 0 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    border: 2px solid #fff;
}

.cart-header-badge:empty {
    display: none;
}

/* Old Cart Header Button (keeping for reference) */
.cart-header-btn-old {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--brand-teal);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--brand-teal);
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: 600;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.9);
}

.cart-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(70, 146, 145, 0.15);
    color: var(--brand-teal);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.cart-info-icon:hover {
    background: rgba(70, 146, 145, 0.25);
    transform: scale(1.1);
}

.cart-info-icon svg {
    width: 14px;
    height: 14px;
}

.cart-beta-tag {
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1px 4px;
    border-radius: 999px;
    background: rgba(244, 192, 60, 0.2);
    color: #B45309;
    display: inline-block;
    vertical-align: baseline;
    line-height: 1.2;
}

/* Mobile-specific header adjustments */
@media (max-width: 639px) {
    .header-logo-wrapper {
        min-width: 30px;
        min-height: 30px; /* Matches mobile logo height (30px) */
        margin-right: 0; /* No extra margin on mobile - logo and name close together */
        /* Wrapper visibility controlled by brand-config-loader - hidden until logo loads */
    }
    
    .header-logo-wrapper[style*="display: flex"],
    .header-logo-wrapper:not([style*="display: none"]) {
        display: flex;
    }
    
    .header-logo {
        height: 30px; /* Increased by 2px from 28px - Slightly smaller on mobile for better fit */
        max-width: 100px;
        min-width: 24px;
        /* Logo visibility controlled by brand-config-loader */
    }
    
    .header-brand-group {
        gap: var(--space-1); /* Minimal spacing on mobile - logo and name side by side */
        /* Ensure brand group is visible */
        display: flex !important;
    }
}

/* Mobile Responsive Header */
@media (min-width: 640px) {
.app-header {
    /* Keep fixed positioning on all screen sizes */
}

.header-container {
    padding: var(--space-4) var(--space-6);
    min-height: 60px; /* Slightly taller on tablet/desktop */
}

.header-brand-group {
    gap: var(--space-1); /* Minimal spacing - logo and name appear side by side */
}

.header-logo-wrapper {
    min-width: 38px; /* Matches tablet/desktop logo height (38px) */
    min-height: 38px;
}
            
.header-logo {
    height: 38px; /* Increased by 2px from 36px - Slightly larger on bigger screens */
    max-width: 140px;
}
            
.header-title-group h1 {
    font-size: 20px; /* Larger on bigger screens */
}
            
.header-title-group p {
    font-size: 13px;
}

.category-filter-container {
    padding: var(--space-4) var(--space-6); /* Maintain top/bottom spacing */
    margin-bottom: 0 !important; /* Removed to prevent coral stripe */
    /* Consistent spacing on desktop (Apple HIG: 24px) */
    /* Spacing now handled by products-container margin-top */
}

.category-filter-btn {
    min-width: 240px; /* Slightly wider on larger screens */
    font-size: 15px; /* Slightly larger on bigger screens */
}
}

/* Tab content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* =====================================================
MAIN CONTENT AREA - SCROLLABLE BETWEEN FIXED HEADER AND NAV
===================================================== */
.main-content {
    position: relative;
    width: 100%;
    /* Header is now fixed, so content starts below it */
    /* No top padding needed - body handles it */
    min-height: calc(100vh - 128px - 68px); /* Account for fixed header (128px: 56px + 72px) and bottom nav (68px) */
    overflow-x: hidden;
    overflow-y: visible;
    /* Ensure content is scrollable */
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 640px) {
    .main-content {
        min-height: calc(100vh - 132px - 76px); /* Slightly taller header on larger screens */
    }
}

/* =====================================================
BOTTOM NAVIGATION - STRIPE ULTRACLEAN STYLE
===================================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-2) var(--space-4);
            /* Enhanced glassmorphism effect */
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
            /* Enhanced border for better visibility */
    border-top: 2px solid rgba(107, 114, 128, 0.15);
            /* Subtle gradient border effect */
    box-shadow: 
    0 -1px 0 rgba(255, 255, 255, 0.5) inset,
    0 -4px 16px rgba(0, 0, 0, 0.12),
    0 -2px 8px rgba(107, 114, 128, 0.08);
    z-index: 50;
}

.bottom-nav .glass-radio-group {
    display: flex;
    width: 100%;
    max-width: 480px;
            /* Subtle glass effect */
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: var(--radius-xl);
    padding: var(--space-1);
    gap: var(--space-1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-radio-group input {
    display: none;
}

.glass-radio-group label {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-1);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: var(--radius-lg);
    transition: all 0.2s var(--ease-stripe);
    position: relative;
    min-width: 0;
    overflow: visible;
    gap: 2px;
}

.glass-radio-group label svg {
    width: 20px;
    height: 20px;
    margin-bottom: 0;
    transition: all 0.2s var(--ease-stripe);
    flex-shrink: 0;
}

.glass-radio-group label:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.6);
}

.glass-radio-group input:checked + label {
            /* Brand secondary color gradient highlight for active tab */
    color: #FFFFFF;
    background: var(--gradient-accent, linear-gradient(135deg, rgba(255, 180, 60, 0.95) 0%, rgba(255, 200, 100, 0.95) 50%, rgba(255, 220, 140, 0.95) 100%));
    box-shadow: 
    0 4px 12px rgba(107, 114, 128, 0.35),
    0 2px 4px rgba(107, 114, 128, 0.25);
    font-weight: 600;
}

.glass-radio-group input:checked + label svg {
    transform: translateY(-1px);
    filter: brightness(0) invert(1); /* Make icon white */
}

.glass-radio-group label span {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    line-height: 1.2;
    text-align: center;
    min-height: 14px;
}

.glass-radio-group label span .cart-beta-tag {
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1px 4px;
    border-radius: 999px;
    background: rgba(244, 192, 60, 0.2);
    color: #B45309;
    display: inline-block;
    vertical-align: baseline;
    line-height: 1.2;
    margin-left: 2px;
}

.glass-radio-group label .relative {
    position: relative;
}

.glass-glider {
    display: none;
}

@media (min-width: 640px) {
.bottom-nav {
    padding: var(--space-3) var(--space-6);
}
            
.glass-radio-group label {
    padding: var(--space-3) var(--space-4);
    font-size: 12px;
}
            
.glass-radio-group label svg {
    width: 22px;
    height: 22px;
}
}