/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --primary-blue: #1a237e;    /* Dark Blue */
    --accent-green: #2e7d32;    /* Green Accent */
    --text-dark: #334155;
    --text-light: #64748b;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --error: #ef4444;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 10px 25px rgba(0,0,0,0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
header {
    background: var(--primary-blue);
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    color: var(--white);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo span {
    color: #81c784; /* Light green for the "Store" part */
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--white);
}

.search-container {
    flex: 0.3;
    display: flex;
}

.search-container input {
    width: 100%;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    border: none;
    outline: none;
    font-size: 0.9rem;
}

.cart-icon {
    color: var(--white);
    text-decoration: none;
    font-size: 1.4rem;
    position: relative;
    padding: 5px;
}

#cart-count {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--accent-green);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    height: 20px;
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--primary-blue);
}

/* =========================================
   3. HERO SECTION
   ========================================= */
.hero {
    height: 60vh;
    min-height: 400px;
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.7)), 
                url('https://images.unsplash.com/photo-1542838132-92c53300491e?auto=format&fit=crop&q=80&w=1200'); 
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    padding: 0 20px;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    color: rgba(255,255,255,0.9);
}

/* =========================================
   4. PRODUCT GRID & CARDS
   ========================================= */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 4rem 5%;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 2.5rem;
    position: relative;
    padding-left: 1rem;
    border-left: 5px solid var(--accent-green);
}

.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.03);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.product-card .tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-green);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-card h3 {
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.product-card .price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-blue);
    display: block;
    margin-bottom: 1rem;
}

/* =========================================
   5. BUTTONS
   ========================================= */
.btn {
    display: inline-block;
    background: var(--accent-green);
    color: var(--white);
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn:hover {
    background: #1b5e20;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.filter-btn {
    background: var(--white);
    color: var(--text-dark);
    border: 1px solid #e2e8f0;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* =========================================
   6. CART PAGE STYLES
   ========================================= */
.cart-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2.5rem;
    align-items: start;
}

.cart-table {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    border-collapse: collapse;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.cart-table th {
    background: #f1f5f9;
    padding: 1.2rem;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-light);
}

.cart-table td {
    padding: 1.5rem 1.2rem;
    border-bottom: 1px solid #f1f5f9;
}

.cart-summary {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin: 1rem 0;
    font-size: 1.1rem;
}

.total-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-blue);
}

/* =========================================
   7. AUTH / LOGIN FORM
   ========================================= */
.auth-container {
    max-width: 450px;
    margin: 5rem auto;
    background: var(--white);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.auth-container h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-container input {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
}

.auth-container input:focus {
    border-color: var(--primary-blue);
}

/* =========================================
   8. FOOTER
   ========================================= */
footer {
    background: var(--primary-blue);
    color: var(--white);
    padding: 4rem 5% 2rem;
    margin-top: 5rem;
}

.footer-content {
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-content h3, .footer-content h4 {
    margin-bottom: 1.2rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

/* =========================================
   9. RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 992px) {
    .cart-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem 20px;
    }
    
    .nav-links {
        display: none; /* Hide links on mobile for hamburger menu (logic in JS) */
    }
    
    .search-container {
        display: none; /* Simplify mobile header */
    }
    
    .hero {
        height: 50vh;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .container {
        padding: 2rem 20px;
    }
}

/* Mobile Menu Helper Class (Triggered via JS) */
.nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--primary-blue);
    padding: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* =========================================
   10. MODERN ENHANCEMENTS & UTILITIES
   ========================================= */

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Checkout Form Styles (For Cart Page) */
.checkout-form {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.checkout-form input, 
.checkout-form select, 
.checkout-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    transition: var(--transition);
}

.checkout-form input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

/* Toast Notification Styling */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent-green);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 2000;
    transform: translateY(100px);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateY(0);
}

/* Button Loading State */
.btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

/* Empty State Styling */
.empty-cart-message {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-cart-message i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Price Highlight for Specials */
.price-old {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* =========================================
   11. HERO SLIDER ADDITIONS
   ========================================= */
.hero-slider {
    position: relative;
    height: 70vh;
    min-height: 500px;
    width: 100%;
    overflow: hidden;
    background: #000;
}

.slider-container {
    height: 100%;
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
}

.slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.85), rgba(0,0,0,0.3));
}

.slide-content {
    position: relative;
    z-index: 2;
    color: white;
    padding: 0 10%;
    max-width: 800px;
}

.slide-content h2 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 10px;
    line-height: 1.1;
    font-weight: 800;
}

.slide-content p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: rgba(255,255,255,0.9);
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-nav:hover { background: var(--accent-green); }
.slider-nav.prev { left: 30px; }
.slider-nav.next { right: 30px; }

.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 10%;
    display: flex;
    gap: 12px;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background: var(--accent-green);
    width: 30px;
    border-radius: 10px;
}

