/* GLOBAL RESET */

:root {
    --primary-color: #111;
    --accent-color: #e63946;
    /* A nice red for buttons */
    --bg-color: #f9f9f9;
    --text-color: #333;
}

* {
    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 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -1px;
}

.nav-links a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    margin-left: 20px;
}

/* HERO SECTION */
.hero {
    background-color: #e0e0e0;
    /* Replace with a background image later */
    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;
}

.btn-primary:hover {
    background: #333;
}

/* PRODUCTS GRID */
.container {
    padding: 4rem 5%;
}

h2 {
    margin-bottom: 2rem;
    text-align: center;
}

.product-grid {
    display: grid;
    /* Changed 'auto-fit' to 'auto-fill' */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
    /* Centers the items if they don't fill the row */
    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;
    /* Ensures images don't stretch weirdly */
}

.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;
    /* Desktop: 50% Image, 50% Details */
    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;
    /* Smooth scroll on iOS */
    border-radius: 12px;
    background: #f9f9f9;
}

.main-slider::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar */

.slide {
    flex: 0 0 100%;
    /* Each slide takes full width */
    scroll-snap-align: start;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1/1;
    /* Square images look best */
    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;
    /* Hidden on mobile */
}

@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;
    /* Default border */
    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);
    /* Active border */
    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 (Moved to bottom) */
.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;
    }
}

/* Mobile Modal */
@media (max-width: 600px) {
    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-img img {
        height: 200px;
    }
}