/* =========================================================
   Clothing Store - shared styles (index.html + product.html)
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Inter", system-ui, sans-serif; color: #111; background: #fff; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }
[hidden] { display: none !important; }
h2 { margin: 0; }



.promo-slide img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}


/* ---------- Header ---------- */
.site-header {
    display: flex; align-items: center; gap: 28px;
    padding: 12px 4%; background: #fff;
    border-bottom: 1px solid #e5e5e5;
    position: sticky; top: 0; z-index: 900;
}
.header-left { display: flex; align-items: center; gap: 36px; }
.menu-toggle { background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; padding: 0; color: #111; display: grid; }
.main-nav { display: flex; gap: 40px; font-weight: bold; font-size: 22px; }
.search {
    display: flex; align-items: center; gap: 8px;
    flex: 0 1 420px; margin-left: auto;
    background: #f3f3f3; border: 1px solid #ddd; border-radius: 999px; padding: 0 16px;
}
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 0; font-size: 14px; outline: none; font-family: inherit; }
.search button { background: none; border: 0; cursor: pointer; font-size: 20px; color: #333; padding: 0; display: grid; }
.header-actions { display: flex; align-items: center; gap: 22px; font-size: 24px; }
.header-actions a { display: grid; color: #111; }

/* ---------- Side drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; z-index: 1000; }
.drawer-overlay.show { opacity: 1; visibility: visible; }
.side-drawer {
    position: fixed; top: 0; left: 0; height: 100%; width: min(420px, 92vw);
    background: #fff; transform: translateX(-100%); transition: transform .3s;
    z-index: 1001; overflow-y: auto;
}
.side-drawer.open { transform: translateX(0); }
.drawer-top { display: flex; justify-content: flex-end; padding: 10px 16px; }
.close-drawer { background: none; border: 0; font-size: 34px; line-height: 1; cursor: pointer; }
.cashback-banner { background: #ffd800; text-align: center; font-weight: 700; font-size: 14px; padding: 12px; }
.drawer-tabs { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; border-bottom: 1px solid #e5e5e5; }
.drawer-tabs a { padding: 16px 0; font-weight: 700; font-size: 14px; }
.drawer-content { padding: 20px; }
.drawer-content h3 { margin: 22px 0 14px; font-size: 16px; font-weight: 700; }
.quick-categories, .category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.quick-categories a, .category-grid a { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; text-align: center; }
.category-icon, .category-tile { width: 100%; aspect-ratio: 1; display: grid; place-items: center; background: #f3f3f3; border-radius: 8px; font-size: 28px; }

/* ---------- Explore slider ---------- */
.explore-slider { position: relative; overflow: hidden; }
.explore-slide img { width: 100%; display: block; }
.slider-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 44px; height: 44px; border: 0; border-radius: 50%;
    background: rgba(255,255,255,.9); box-shadow: 0 2px 8px rgba(0,0,0,.2);
    cursor: pointer; font-size: 16px;
}
.slider-arrow.prev { left: 14px; }
.slider-arrow.next { right: 14px; }
.slider-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.6); cursor: pointer; }
.dot.active { background: #fff; transform: scale(1.25); }

/* ---------- Benefits ---------- */
.benefits { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid #e5e5e5; }
.benefit { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px 10px; font-size: 13px; font-weight: 500; line-height: 1.4; }
.benefit-icon { font-size: 24px; font-weight: 700; }

/* ---------- Section headings ---------- */
.new-in { text-align: center; padding: 34px 0 18px; }
.new-in h2, .product-section > h2, .topwear-section h2, .bottomwear-section h2, .category-section h2 {
    text-align: center; font-size: 26px; font-weight: 800; letter-spacing: 1px; margin-bottom: 20px;
}

/* ---------- Promo slider ---------- */
.promo-slider { position: relative; overflow: hidden; margin-bottom: 10px;
margin-top: 40px;}
.promo-track { display: flex; transition: transform .6s ease; }
.promo-slide { flex: 0 0 100%; display: block; }
.promo-slide img { width: 100%; display: block; }
.promo-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 44px; height: 44px; border: 0; border-radius: 50%;
    background: rgba(255,255,255,.9); box-shadow: 0 2px 8px rgba(0,0,0,.2); cursor: pointer;
}
.promo-prev { left: 14px; }
.promo-next { right: 14px; }

/* ---------- Product sections / cards ---------- */
.product-section { padding: 40px 4%; }

.product-slider { position: relative; overflow: hidden; }
.product-track { display: flex; gap: 16px; transition: transform .4s ease; }
.product-track .product-card { flex: 0 0 calc((100% - 48px) / 4); }
.product-arrow {
    position: absolute; top: 38%; transform: translateY(-50%); z-index: 2;
    width: 42px; height: 42px; border: 0; border-radius: 50%;
    background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: pointer;
}
.product-prev { left: 8px; }
.product-next { right: 8px; }
.product-arrow:disabled { opacity: .35; cursor: default; }

.product-card { cursor: pointer; }
.product-card > img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; background: #f2f2f2; }
.product-image { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: #f2f2f2; }
.product-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.product-image .hover-image { opacity: 0; }
.product-card:hover .hover-image { opacity: 1; }
.product-info { padding: 10px 2px; }
.product-info h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.product-info p { margin: 0 0 6px; font-size: 13px; color: #666; }
.product-info strong { font-size: 15px; }

.search-match { outline: 3px solid #ffd800; outline-offset: 4px; }

/* Filters + grid */
.product-filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 24px; }
.filter-btn { padding: 9px 18px; border: 1px solid #ccc; border-radius: 999px; background: #fff; font-weight: 600; font-size: 13px; cursor: pointer; }
.filter-btn.active { background: #111; color: #fff; border-color: #111; }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ---------- Category tile sections ---------- */
.topwear-section, .bottomwear-section, .category-section { padding: 30px 4%; }
.topwear-grid, .bottomwear-grid, .category-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.topwear-card img, .bottomwear-card img, .category-card img { width: 100%; display: block; border-radius: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .product-track .product-card { flex-basis: calc((100% - 16px) / 2); }
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .topwear-grid, .bottomwear-grid, .category-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
    .main-nav { display: none; }
    .site-header { gap: 12px; padding: 10px 4%; }
    .search { flex: 1; }
    .header-actions { gap: 14px; }
}
@media (max-width: 600px) {
    .product-track .product-card { flex-basis: 100%; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .benefits { grid-template-columns: 1fr; }
    .benefit { justify-content: flex-start; padding: 12px 6%; }
    .new-in h2, .product-section > h2, .topwear-section h2, .bottomwear-section h2, .category-section h2 { font-size: 20px; }
}

/* ---------- logged-in customer dot (auth-ui.js) ---------- */
.user-dot { width: 30px; height: 30px; border-radius: 50%; background: #111; color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 700; overflow: hidden; }
.user-dot img { width: 100%; height: 100%; object-fit: cover; display: block; }


/* ---------- drawer: 4 quick categories ---------- */
.quick-categories { grid-template-columns: repeat(4, 1fr); }

/* ---------- department sections (Women / Shoes / Electronics) ---------- */
.dept-section { padding: 30px 4%; }
.dept-section h2 { text-align: center; font-size: 26px; font-weight: 800; letter-spacing: 1px; margin-bottom: 20px; }
.dept-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.dept-card { display: block; color: inherit; }
.dept-card img { width: 100%; aspect-ratio: 3 / 3.7; object-fit: cover; border-radius: 6px; display: block; background: #eee; transition: transform .2s; }
.dept-card:hover img { transform: scale(1.02); }
.dept-card span { display: block; margin-top: 10px; text-align: center; font-size: 12px; font-weight: 700; letter-spacing: 2px; }
@media (max-width: 900px) { .dept-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- cart badge in the header (every page) ---------- */
.cart-link { position: relative; }
.cart-count { position: absolute; top: -8px; right: -10px; background: #e53935; color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; display: grid; place-items: center; }

/* ---------- footer ---------- */
.site-footer { margin-top: 60px; padding: 44px 4% 24px; background: #111; color: #cfcfcf; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; max-width: 1100px; margin: 0 auto; }
.site-footer h4 { margin: 0 0 14px; color: #fff; font-size: 14px; letter-spacing: 2px; }
.site-footer p { margin: 0; font-size: 14px; line-height: 1.6; }
.site-footer a { display: block; padding: 5px 0; font-size: 14px; color: #cfcfcf; }
.site-footer a:hover { color: #ffd800; }
.footer-copy { text-align: center; margin-top: 32px !important; padding-top: 18px; border-top: 1px solid #2a2a2a; font-size: 12px !important; color: #888; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* ---------- header: keep the logo on one line now that the menu has 4 items ---------- */
.site-header .product-store-logo { white-space: nowrap; }
@media (max-width: 1400px) { .site-header .product-store-logo { font-size: 22px; letter-spacing: 4px; } }
@media (max-width: 1150px) {
    .site-header { gap: 16px; }
    .site-header .product-store-logo { font-size: 18px; letter-spacing: 3px; }
    .main-nav { gap: 22px; }
    .header-left { gap: 18px; }
}

/* ---------- phones / small tablets: search moves to its own row, nothing overflows ---------- */
@media (max-width: 900px) {
    .site-header { flex-wrap: wrap; row-gap: 10px; }
    .site-header .search { order: 5; flex: 1 1 100%; margin-left: 0; }
    .site-header .product-store-logo { flex: 1 1 auto; text-align: center; }
    .site-header .header-actions { gap: 14px; }
}

/* menu now has TRENDING and KIDS too */
.drawer-tabs { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }
.main-nav { gap: 28px; }
@media (max-width: 1250px) { .main-nav { gap: 18px; font-size: 13px; } }

.site-footer .wa-link { display: inline-block; margin-top: 10px; color: #25d366; font-weight: 700; }
