/* GLOBAL RESET */
:root {
    /* --- BRAND PALETTE --- */
    --nav-bg: #00293D;
    /* Deep Navy Blue (Matches Footer & Admin) */
    --primary: #008F9E;
    /* Teal/Cyan (Brand Color) */
    --primary-color: #111;
    /* Text Black */
    --accent-color: #e63946;
    /* Red */
    --bg-color: #F4F9FA;
    /* Light Gray-Blue Background */
    --text-color: #333;
    /* Dark Gray Text */
    --text-dark: #133040;
    /* Dark Blue Text */
    --nav-text: #ffffff;
    /* White text for Navbar */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* --- NAVBAR (UPDATED COLOR) --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 5%;
    background-color: var(--nav-bg);
    /* Changed from white to Navy Blue */
    color: var(--nav-text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* Logo Image Styles */
.nav-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    margin-top: 0;
    /* Reset margin for better alignment */
}

@media (max-width: 768px) {
    .nav-logo {
        height: 40px;
    }
}

/* Nav Icons */
.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-icon-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--nav-text);
    transition: color 0.3s ease;
}

.nav-icon-link:hover {
    color: var(--primary);
}

.nav-icon {
    width: 24px;
    height: 24px;
}

/* Base link styling for navbar */
.nav-links a {
    color: var(--nav-text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Cart Badge */
.cart-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 1px solid var(--nav-bg);
    /* Tiny border to separate from icon */
}


/* --- HERO SECTION --- */
.hero {
    background-color: #e0e0e0;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.btn-primary {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    margin-top: 20px;
    border-radius: 5px;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary:hover {
    background: #333;
}

/* --- PRODUCTS GRID --- */
.container {
    padding: 4rem 5%;
}

h2 {
    margin-bottom: 2rem;
    text-align: center;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
    justify-content: center;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    transform: translateY(-5px);
}

.image-container img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.product-info {
    padding: 1.5rem;
    text-align: center;
}

.price {
    font-weight: bold;
    color: #666;
    margin: 10px 0;
}

.btn-add {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: all 0.2s;
}

.btn-add:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
}


/* --- PRODUCT PAGE UPGRADES --- */

/* 1. The Container */
.product-container {
    max-width: 1100px;
    margin: 2rem auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 0 20px;
}

/* 2. Scrollable Gallery (Carousel) */
.gallery-container {
    position: relative;
    width: 100%;
}

.main-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    background: #f9f9f9;
}

.main-slider::-webkit-scrollbar {
    display: none;
}

.slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1/1;
    display: block;
}

/* Arrows for Desktop */
.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 2;
    display: none;
}

@media (min-width: 768px) {
    .arrow {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.arrow-left {
    left: 10px;
}

.arrow-right {
    right: 10px;
}

/* 3. Product Details Area */
.details-col h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.details-col .price {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 20px;
}

/* 4. Selectors (Color & Size) */
.selector-group {
    margin-bottom: 20px;
}

.selector-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    font-size: 0.9rem;
    color: #555;
}

/* Color Circles */
.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-circle {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ddd;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
}

.color-circle:hover {
    transform: scale(1.1);
}

.color-circle.selected {
    border: 3px solid var(--text-dark);
    transform: scale(1.15);
}

/* Tooltip for color name */
.color-circle::after {
    content: attr(data-color);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    background: #333;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.color-circle:hover::after {
    opacity: 1;
}

/* Size Dropdown */
.size-select {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    cursor: pointer;
}

.size-select:focus {
    border-color: var(--primary);
    outline: none;
}

/* 5. Mobile Layout Adjustments */
@media (max-width: 768px) {
    .product-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .details-col h1 {
        font-size: 1.8rem;
    }
}

/* 6. Recommendations */
.rec-section {
    margin-top: 4rem;
    padding: 20px;
    border-top: 1px solid #eee;
}

/* --- QUICK ADD MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 700px;
    border-radius: 12px;
    position: relative;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.modal-img img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    border: none;
    background: none;
    cursor: pointer;
    color: #555;
    z-index: 10;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 600px) {
    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-img img {
        height: 200px;
    }
}

/* --- FOOTER STYLES --- */
.site-footer {
    background-color: var(--nav-bg);
    /* #00293D */
    color: white;
    padding: 60px 0 20px;
    margin-top: 50px;
    font-family: 'Inter', sans-serif;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    padding: 0 20px;
}

.footer-col h3 {
    margin-top: 0;
    color: var(--primary);
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.footer-col h4 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.footer-col p {
    color: #aebdc4;
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: #aebdc4;
    text-decoration: none;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-col ul li a:hover {
    color: var(--primary);
    padding-left: 5px;
}

/* Social Icons */
.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s, transform 0.3s;
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

/* Bottom Bar */
.footer-bottom {
    text-align: center;
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #667;
    font-size: 0.85rem;
}

/* --- THUMBNAIL GALLERY --- */
.thumbnail-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.thumb-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.thumb-img:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.thumb-img.active {
    border-color: #e67e22;
    border-width: 3px;
    opacity: 1;
    box-shadow: 0 4px 10px rgba(230, 126, 34, 0.2);
}

/* --- PRODUCT CARD COLOR CIRCLES --- */
.card-colors {
    display: flex;
    justify-content: center;
    /* Centers them horizontally */
    gap: 8px;
    /* Space between circles */
    margin-bottom: 12px;
    /* Space below the price */
    height: 20px;
    /* Keeps card height stable */
}

.card-color-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    /* Makes it a perfect circle */
    border: 1px solid #ddd;
    /* Light gray border */
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    /* Default */
    border: 1px solid #999;
}

.card-color-circle:hover {
    transform: scale(1.2);
    /* Grows slightly when hovered */
    border-color: #333;
    /* Darker border on hover */
}

/* --- Mobile Horizontal Scroll Product Grid --- */
@media (max-width: 768px) {

    /* 1. Scrolling container */
    .product-grid {
        display: flex !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 10px;
        padding: 10px 12px 20px 12px;
        -webkit-overflow-scrolling: touch;
        align-items: stretch;
        justify-content: flex-start;
        /* Fix for first item being cut off */
    }

    /* Hide scrollbar */
    .product-grid::-webkit-scrollbar {
        display: none;
    }

    .product-grid {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    /* 2. Product card — 40% width = ~2.5 visible */
    .product-grid>.product-card {
        flex: 0 0 40%;
        min-width: 40%;
        max-width: 40%;
        scroll-snap-align: start;
        background: #ffffff;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        overflow: hidden;
        padding: 0;
        display: flex;
        flex-direction: column;
    }

    /* 3. Image container — perfect square, never cropped */
    .product-grid>.product-card .image-container {
        width: 100%;
        position: relative;
    }

    .product-grid>.product-card .image-container img {
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: contain;
        background-color: #f5f5f5;
        border-radius: 10px 10px 0 0;
        display: block;
        height: auto;
    }

    /* 4. Product info below the image */
    .product-grid>.product-card .product-info {
        padding: 8px 10px 12px;
        text-align: center;
    }

    .product-grid>.product-card .product-info h3 {
        font-size: 0.85rem;
        margin: 4px 0;
        line-height: 1.3;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .product-grid>.product-card .product-info .price {
        font-size: 0.95rem;
        margin: 2px 0 6px;
    }

    /* 5. Color circles — smaller on mobile */
    .product-grid>.product-card .card-colors {
        height: 16px;
        gap: 5px;
        margin-bottom: 8px;
    }

    .product-grid>.product-card .card-color-circle {
        width: 14px;
        height: 14px;
    }

    /* 6. Add to cart button */
    .product-grid>.product-card .btn-add {
        width: 100%;
        font-size: 0.8rem;
        padding: 8px 10px;
        border-radius: 0 0 10px 10px;
    }
}

/* --- HERO SLIDER STYLES --- */

/* 1. The Main Container */
.hero-slider-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: #000;
    /* Fallback color */
    margin-bottom: 30px;
    /* Space below the banner */
}

/* 2. The Track (The scrolling part) */
.slider-track {
    display: flex;
    overflow-x: auto;
    /* Enable horizontal scroll */
    scroll-snap-type: x mandatory;
    /* Force stop exactly on each image */
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll on iOS */
    scrollbar-width: none;
    /* Hide scrollbar (Firefox) */
}

.slider-track::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar (Chrome/Safari) */
}

/* 3. The Individual Slide */
.slide {
    flex: 0 0 100%;
    /* Each slide takes 100% width */
    width: 100%;
    position: relative;
    display: block;
    /* Necessary for anchor tag */
    scroll-snap-align: center;
    /* Snap to center */
    text-decoration: none;
    /* Remove underline from link */
}

/* 4. The Image Itself */
.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures image covers area without stretching */
    display: block;

    /* DESKTOP HEIGHT CONTROL */
    /* On desktop, we limit height so vertical images don't take 2 screens */
    max-height: 85vh;
}

/* 5. Optional Text Overlay (Caption) */
.slide-caption {
    position: absolute;
    bottom: 40px;
    left: 30px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.slide-caption h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 800;
}

.btn-slide {
    background: white;
    color: black;
    padding: 10px 25px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
    display: inline-block;
    transition: background 0.3s;
}

.slide:hover .btn-slide {
    background: #f1f1f1;
}

/* --- MOBILE SPECIFIC TWEAKS --- */
@media (max-width: 768px) {

    /* On mobile, let the image reach its natural height (often taller) */
    .slide img {
        max-height: 80vh;
        /* Allow it to be taller on mobile */
        aspect-ratio: 3/4;
        /* Optional: Force a portrait aspect ratio */
    }

    .slide-caption h2 {
        font-size: 1.8rem;
        /* Smaller text on mobile */
    }

    .slide-caption {
        bottom: 25px;
        left: 20px;
    }
}

/* --- PROMO BANNER --- */
.click-banner {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
    margin-top: 20px;
    margin-bottom: 20px;
}

.click-banner:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .click-banner {
        border-radius: 15px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
}

/* --- PROMO SLIDES (Dynamic) --- */
.promo-carousel {
    width: 100%;
    padding: 10px 0;
}

.promo-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.promo-track::-webkit-scrollbar {
    display: none;
}

.promo-slide {
    flex: 0 0 100%;
    width: 100%;
    display: block;
    scroll-snap-align: center;
    text-decoration: none;
    padding: 0 10px;
    box-sizing: border-box;
}

.promo-slide img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
}

@media (max-width: 768px) {
    .promo-slide {
        padding: 0 8px;
    }

    .promo-slide img {
        border-radius: 10px;
    }
}