/* ================= RESET ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", system-ui, sans-serif;
}

body {
    background: #f8fafc;
    color: #111827;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

/* ================= HEADER ================= */
.site-header {
    position: sticky;
    top: 0;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    z-index: 3000;
}

.nav-container {
    max-width: 1200px;
    margin: auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.main-nav {
    display: flex;
    gap: 18px;
}

.main-nav a {
    font-weight: 600;
    color: #374151;
}

/* Header right layout: cart + name or login */
.nav-container {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Right side container */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    /* pushes it to the right */
}

/* Cart icon styling */
.cart-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    text-decoration: none;
}

.cart-link svg {
    display: block;
}

/* Username */
.user-name {
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
}

/* Login button (guest) */
.login-btn {
    background: transparent;
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

/* HIDE desktop-only hamburger on larger screens */
.hamburger {
    display: none;
}

/* ================= MOBILE LAYOUT ================= */
@media (max-width: 768px) {

    /* show hamburger on mobile */
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        z-index: 3001;
    }

    /* Now control visual order: we want name before hamburger on mobile */
    .nav-container {
        /* ensure we can reorder children visually */
        display: flex;
        align-items: center;
    }

    /* Order: logo (0), mainNav (1) [but it is off-canvas], header-right (2), hamburger (3).
       We want header-right (customer name) to appear BEFORE hamburger on mobile.
    */
    .logo {
        order: 0;
    }

    .main-nav {
        order: 1;
    }

    /* drawer */
    .header-right {
        order: 2;
    }

    /* name/cart appears before hamburger */
    .hamburger {
        order: 3;
    }

    /* Tighten spacing for mobile */
    .header-right {
        gap: 8px;
    }

    /* Ensure .user-name text doesn't overflow */
    .user-name {
        font-size: 15px;
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Hide the inline desktop nav links visually if needed (drawer will be used) */
    /* If your existing CSS already hides .main-nav on mobile, keep it. */
}

/* ================= HAMBURGER ================= */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 3001;
}

.hamburger span {
    width: 26px;
    height: 3px;
    background: #111827;
    border-radius: 2px;
    transition: all 0.35s ease;
}

/* ☰ → ✕ animation */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ================= OFFER BAR ================= */
.offer-bar {
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    color: #fff;
    overflow: hidden;
}

.offer-track {
    display: inline-flex;
    gap: 40px;
    padding: 10px 0;
    white-space: nowrap;
    animation: scroll-left 18s linear infinite;
}

/* Default: Mobile (one direction) */
@keyframes scroll-left {
    from {
        transform: translateX(60%);
    }

    to {
        transform: translateX(-100%);
    }
}

/* ================= DESKTOP ONLY ================= */
@media (min-width: 769px) {
    .offer-track {
        animation-direction: alternate;
        /* 🔥 back & forth */
    }
}

/* ================= HERO ================= */
.hero {
    padding: 40px 16px;
    background: #fff;
    text-align: center;
}

.hero h1 {
    font-size: 30px;
}

.hero p {
    color: #6b7280;
    margin: 10px 0 20px;
}

/* ================= PRODUCTS ================= */
.product-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
}

.product-card {
    min-width: 200px;
    background: #fff;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}

/* ================= PRODUCT IMAGE (MATCH FIRST PRODUCT) ================= */
.product-card img {
    width: 100%;
    aspect-ratio: 4 / 5;
    /* 🔒 same ratio as first product */
    object-fit: cover;
    /* crop safely */
    display: block;
    border-radius: 10px;
}


.product-card h4 {
    margin-top: 8px;
}

.product-card p {
    font-weight: 700;
    color: #2563eb;
}

/* ================= CATEGORIES (FIXED) ================= */
.category-section {
    padding: 48px 16px 32px;
    /* controlled bottom padding */
    background: #f1f5f9;
}

.category-section h2 {
    text-align: center;
    margin-bottom: 28px;
}

.category-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    /* balanced spacing */
}

/* CARD */
.category-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;

    /* softer, realistic shadow */
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.08);

    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* subtle hover (desktop only) */
@media (hover: hover) {
    .category-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
    }
}

/* ================= CATEGORY IMAGE 1:1 ================= */
.category-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* 🔒 always square */
    object-fit: cover;
    /* crop safely */
    display: block;
}

.category-card span {
    display: block;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    background: #ffffff;
}

/* MOBILE */
@media (max-width: 768px) {
    .category-section {
        padding: 36px 14px 24px;
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        font-size: 8px;
        gap: 10px;
    }

    /* .category-card img {
        height: 140px;
    } */
}


/* ================= ABOUT ================= */
.about-section {
    padding: 40px 16px;
    text-align: center;
}

/* ================= MODAL ================= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4000;
}

.modal.active {
    display: flex;
}

.modal-box {
    background: #fff;
    width: 380px;
    padding: 22px;
    border-radius: 14px;
}

.modal-box input,
.modal-box button {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
}

.close {
    float: right;
    cursor: pointer;
}

/* ================= FOOTER ================= */
.site-footer {
    text-align: center;
    padding: 18px;
    background: #0f172a;
    color: #e5e7eb;
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {

    .hamburger {
        display: flex;
    }

    /* RIGHT DRAWER NAV (hidden by default) */
    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;

        width: 80%;
        max-width: 320px;

        background: #ffffff;
        display: flex;
        flex-direction: column;
        padding: 90px 16px 20px;

        transform: translateX(100%);
        transition: transform 0.4s ease;

        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
        z-index: 2600;
    }

    .main-nav.open {
        transform: translateX(0);
    }

    .main-nav a {
        padding: 12px 10px;
        font-size: 16px;
        font-weight: 600;
        border-bottom: 1px solid #f1f5f9;
    }

    /* BACKDROP */
    .nav-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 2500;
    }

    .nav-backdrop.show {
        opacity: 1;
        pointer-events: all;
    }

    /* CATEGORY GRID */
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.add-to-cart {
    position: relative;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    background: #111;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
}

.cart-icon {
    margin-right: 6px;
}

.shirt {
    position: absolute;
    left: 50%;
    top: -25px;
    transform: translateX(-50%);
    opacity: 0;
}

/* Animation Trigger */
.add-to-cart.animate .shirt {
    animation: shirtDrop 0.6s forwards;
}

.add-to-cart.animate .cart-icon {
    animation: cartBounce 0.6s 0.6s;
}

/* Keyframes */

@keyframes shirtDrop {
    0% { top: -25px; opacity: 0; }
    50% { opacity: 1; }
    100% { top: 6px; opacity: 0; }
}

@keyframes cartBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}
/* Prevent clicking while running */
.add-to-cart.loading {
  pointer-events: none;
  opacity: 0.85;
}

/* Optional Success Glow */
.add-to-cart.success {
  box-shadow: 0 0 10px #4CAF50;
}
.add-to-cart.success .text {
  content: "Added ✓";
}
