/* =========================================
   1. VARIABLES & BASE STYLES
   ========================================= */
:root { 
    --brand-primary: #136996; 
    --brand-dark: #082A3C; 
    --brand-light: #DFEDF5; 
    --brand-accent: #E16D0E; 
    --text-main: #061F2D; 
    --text-muted: #2375A1; 
    --bg-page: #F4F8FA; 
    --card-bg: #FFFFFF; 
    --danger: #CA220C;
}

body { 
    font-family: 'Roboto', sans-serif; 
    background-color: var(--bg-page); 
    margin: 0; 
    padding: 0; 
    color: var(--text-main); 
    line-height: 1.6; 
    overflow-x: hidden; 
}

h1, h2, h3, h4, .logo { 
    font-family: 'Roboto Condensed', sans-serif; 
}

/* =========================================
   2. TOP NAVIGATION & SEARCH
   ========================================= */
nav { 
    background: var(--brand-dark); 
    padding: 8px 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
    border-bottom: 2px solid var(--brand-primary); 
}

.nav-left { display: flex; align-items: center; gap: 15px; }
.hamburger-menu { font-size: 22px; color: white; cursor: pointer; transition: color 0.2s; padding: 5px; }
.hamburger-menu:hover { color: #FFD700; }

.logo { 
    font-size: 20px; font-weight: 700; color: #FFFFFF; display: flex; align-items: center; 
    gap: 10px; text-transform: uppercase; letter-spacing: 1px; flex-shrink: 0; 
    white-space: nowrap; cursor: pointer; transition: transform 0.2s ease, opacity 0.2s ease; 
}
.logo:hover { opacity: 0.8; transform: scale(1.02); }
.logo i { color: var(--brand-accent); }

/* Promo Marquee */
.nav-marquee-wrapper { flex-grow: 1; margin: 0 40px; overflow: hidden; position: relative; height: 25px; display: flex; align-items: center; }
.announcement-marquee { 
    position: absolute; white-space: nowrap; font-size: 17px; font-family: 'Roboto Condensed', sans-serif; 
    font-weight: 700; letter-spacing: 1px; animation: scrollPromo 45s linear infinite; 
}

@keyframes scrollPromo { 
    0% { left: 100%; transform: translateX(0); } 
    100% { left: 0; transform: translateX(-100%); } 
}

/* Nav Right Controls & Search */
.nav-right-controls { display: flex; align-items: center; gap: 20px; }
.nav-search-box { position: relative; display: flex; align-items: center; }
.nav-search-box i { position: absolute; left: 10px; color: rgba(255, 255, 255, 0.6); font-size: 13px; }
.nav-search-box input { 
    padding: 8px 10px 8px 30px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.3); 
    background: rgba(255, 255, 255, 0.1); color: white; font-family: 'Roboto', sans-serif; 
    font-size: 13px; width: 160px; transition: all 0.3s ease; 
}
.nav-search-box input::placeholder { color: rgba(255, 255, 255, 0.6); }
.nav-search-box input:focus { width: 220px; outline: none; background: rgba(255, 255, 255, 0.2); border-color: #FFD700; }

/* Cart Icon */
.cart-icon { position: relative; cursor: pointer; font-size: 20px; color: #FFFFFF; padding: 5px; transition: color 0.3s; flex-shrink: 0; }
.cart-icon:hover { color: var(--brand-accent); }
.cart-badge { 
    position: absolute; top: -5px; right: -5px; background: #CA220C; color: white; 
    border-radius: 50%; width: 18px; height: 18px; display: flex; justify-content: center; 
    align-items: center; font-size: 11px; font-weight: bold; font-family: 'Roboto', sans-serif; 
}

/* =========================================
   3. HERO & LAYOUT SECTIONS
   ========================================= */
.hero { 
    background: linear-gradient(135deg, #0A344B, #136996); color: white; padding: 35px 20px; 
    text-align: center; border-bottom: 4px solid var(--brand-accent); 
}
.hero h1 { margin: 0 0 10px 0; font-size: 32px; font-weight: 300; letter-spacing: 1px; }
.hero p { margin: 0; font-size: 14px; color: var(--brand-light); font-weight: 300; max-width: 600px; margin: 0 auto; }

.container { max-width: 1200px; margin: 40px auto; padding: 0 20px; }
.section-header { display: flex; align-items: center; margin-bottom: 25px; gap: 15px; }
.section-title { font-size: 24px; margin: 0; color: var(--brand-dark); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.section-line { flex-grow: 1; height: 2px; background: var(--brand-light); }

/* =========================================
   4. QUICK JUMP MENU
   ========================================= */
.category-links-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 40px; }
.cat-link-card { 
    background: white; padding: 25px 10px; text-align: center; border-radius: 8px; border: none; 
    cursor: pointer; font-weight: bold; color: #082A3C; transition: all 0.2s ease; box-shadow: 0 6px 15px rgba(0,0,0,0.08); 
}
.cat-link-card i { display: block; font-size: 32px; margin-bottom: 12px; color: #136996; }
.cat-link-card:hover { transform: translateY(-5px); box-shadow: 0 12px 25px rgba(0,0,0,0.12); background: #FFFFFF; }

/* =========================================
   5. OVERLAYS, MODALS & SIDEBARS (FIXED)
   ========================================= */
/* The fixed overlay - Note it uses opacity instead of display:none */
.overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(6, 31, 45, 0.7); z-index: 999; backdrop-filter: blur(3px); 
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.overlay.active { opacity: 1; pointer-events: all; }

/* Slide-out Mobile Menu */
.mobile-menu { 
    position: fixed; top: 0; left: -320px; width: 300px; height: 100%; 
    background: white; z-index: 2000; transition: left 0.3s ease; 
    box-shadow: 2px 0 15px rgba(0,0,0,0.2); display: flex; flex-direction: column; 
}
.mobile-menu.active { left: 0; }
.mobile-menu-header { padding: 20px; background: #082A3C; color: white; display: flex; justify-content: space-between; align-items: center; }
.mobile-menu-header h3 { margin: 0; font-family: 'Roboto Condensed', sans-serif; font-size: 20px; letter-spacing: 1px; }
.mobile-menu-links { padding: 15px 0; display: flex; flex-direction: column; overflow-y: auto; }
.mobile-menu-links a { padding: 15px 25px; text-decoration: none; color: #061F2D; font-weight: 500; font-size: 16px; display: flex; align-items: center; gap: 15px; transition: background 0.2s, color 0.2s; }
.mobile-menu-links a:hover { background: #F4F8FA; color: #136996; }
.mobile-menu-links i { width: 20px; text-align: center; color: #136996; font-size: 18px; }

/* Slide-out Cart Sidebar */
.cart-sidebar { 
    position: fixed; top: 0; right: -450px; width: 400px; max-width: 100vw; height: 100vh; 
    background: var(--card-bg); box-shadow: -10px 0 30px rgba(8, 42, 60, 0.2); 
    transition: right 0.3s ease-in-out; 
    z-index: 2000; /* Pushed to 2000 so it floats OVER the reviews bar! */
    display: flex; flex-direction: column; 
}
.cart-sidebar.active { right: 0; }

.cart-header { padding: 20px; border-bottom: 1px solid var(--brand-light); display: flex; justify-content: space-between; align-items: center; background: var(--brand-dark); color: white; }
.cart-header h2 { margin: 0; font-size: 20px; font-weight: 400; text-transform: uppercase; letter-spacing: 1px;}
.close-cart { background: none; border: none; font-size: 20px; cursor: pointer; color: white; transition: color 0.3s; }
.close-cart:hover { color: #CA220C; }

/* Cart Login & Items */
.customer-login { padding: 15px 25px; background: var(--brand-light); border-bottom: 1px solid #C1DCEA; font-size: 13px; }
#custLookup { border: 1px solid #A5CBE0; color: var(--brand-dark); }
#custLookup:focus { outline: none; border-color: var(--brand-primary); }

.cart-items { flex-grow: 1; padding: 25px; overflow-y: auto; }

/* Cart Footer Controls */
.cart-footer { 
    /* Added 40px to the bottom padding so the button is never cut off by phone screens */
    padding: 20px 25px 40px 25px; 
    background: #F8F9FA; border-top: 1px solid var(--brand-light); 
}
.cart-math-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.cart-total-row { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; margin-bottom: 20px; margin-top: 10px; padding-top: 10px; border-top: 2px solid var(--brand-light); color: var(--brand-dark); text-transform: uppercase; }
.cart-total-row span:last-child { font-size: 24px; color: var(--brand-primary); }

.btn-checkout { background: #CA220C; color: white; border: none; padding: 16px; width: 100%; border-radius: 4px; font-size: 15px; font-weight: 700; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; transition: background 0.3s; }
.btn-checkout:hover { background: #a81c0a; }

/* Post-Checkout Receipt Modal */
.receipt-modal { 
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); 
    background: white; padding: 30px; border-radius: 8px; width: 90%; max-width: 400px; 
    z-index: 2000; display: none; box-shadow: 0 10px 40px rgba(0,0,0,0.3); border: 1px solid var(--brand-primary);
}
.receipt-modal.active { display: block; }
.receipt-paper { font-family: 'Courier New', Courier, monospace; font-size: 12px; background: #fff; padding: 20px; border: 1px solid #eee; margin-bottom: 20px; max-height: 400px; overflow-y: auto; color: #000; }
.receipt-paper h3 { text-align: center; margin: 0 0 10px 0; font-family: 'Courier New', Courier, monospace; }

@media print {
    body * { visibility: hidden; }
    #printableReceipt, #printableReceipt * { visibility: visible; }
    #printableReceipt { position: absolute; left: 0; top: 0; width: 100%; border: none; }
}

/* =========================================
   6. FLOATING UI CONTROLS
   ========================================= */
#backToTopBtn {
    display: none; position: fixed; bottom: 30px; right: 30px; z-index: 1000;
    font-size: 20px; border: none; background-color: #136996; color: white;
    cursor: pointer; border-radius: 50%; width: 50px; height: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); transition: all 0.3s ease;
}
#backToTopBtn:hover { background-color: #082A3C; transform: translateY(-5px); }

/* =========================================
   7. MOBILE RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 768px) {
    nav { flex-wrap: wrap; padding: 10px 15px; }
    .nav-marquee-wrapper { display: none; }
    .nav-right-controls { width: 100%; justify-content: space-between; margin-top: 15px; }
    .nav-search-box { flex-grow: 1; margin-right: 15px; }
    .nav-search-box input, .nav-search-box input:focus { width: 100%; }
    .hero { padding: 40px 20px; }
    .hero h1 { font-size: 32px; }
    .hero p { font-size: 16px; }
    .category-links-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .cat-link-card { padding: 15px 5px; font-size: 0; }
    .cat-link-card i { font-size: 24px; margin-bottom: 0; }
    .cart-sidebar { width: 100%; right: -100%; }
    #backToTopBtn { bottom: 20px; right: 20px; width: 45px; height: 45px; font-size: 18px; }
}