:root {
    --brand-red: #c8102e;
    --brand-red-dark: #9c0a22;
    --brand-orange: #f5a623;
    --brand-yellow: #ffe600;

    --bg: #ffffff;
    --surface: #ffffff;
    --surface-alt: #f5f5f5;
    --text: #111111;
    --text-muted: #6b6b6b;
    --border: #ececec;

    --radius: 4px;
    --radius-md: 8px;
    --radius-lg: 14px;

    --topbar-h: 56px;
    --topbar-h-desktop: 72px;
    --tabbar-h: 60px;

    --container-pad: 12px;
    --container-pad-desktop: 32px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--brand-red); }

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

body.drawer-open { overflow: hidden; }

.app {
    min-height: 100vh;
    background: var(--bg);
    padding-bottom: 32px;
}

/* ============ TOPBAR (JD-Sports style) ============ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.topbar__inner {
    max-width: 1280px;
    margin: 0 auto;
    height: 100%;
    padding: 0 var(--container-pad);
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    align-items: center;
    gap: 4px;
}
.topbar__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: transparent;
    border: none;
    padding: 4px;
    color: var(--text);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    cursor: pointer;
    height: var(--topbar-h);
}
.topbar__btn svg { width: 22px; height: 22px; }
.topbar__btn:hover { color: var(--brand-red); }

.topbar__logo {
    display: grid;
    place-items: center;
    height: var(--topbar-h);
    padding: 4px 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.topbar__logo img {
    max-height: calc(var(--topbar-h) - 12px);
    width: auto;
    object-fit: contain;
    background: transparent;
    border: 0;
    box-shadow: none;
    display: block;
}

.topbar__btn--cart { position: relative; }

/* ============ HERO SLIDER (home only) ============ */
.hero-slider {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-height: 45vh;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f5f5f5;
}
.hero-slider__track {
    display: flex;
    height: 100%;
    transition: transform .45s ease;
    will-change: transform;
}
.hero-slider__slide {
    flex: 0 0 100%;
    min-width: 100%;
    height: 100%;
    position: relative;
    background-color: #f5f5f5;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    color: #fff;
    text-decoration: none;
}
.hero-slider__slide.col-light { color: #fff; }
.hero-slider__slide.col-dark  { color: #111; }

.hero-slider__slide.pos-bottom-left   { align-items: flex-end;     justify-content: flex-start; text-align: left; }
.hero-slider__slide.pos-bottom-center { align-items: flex-end;     justify-content: center;     text-align: center; }
.hero-slider__slide.pos-center        { align-items: center;       justify-content: center;     text-align: center; }
.hero-slider__slide.pos-top-left      { align-items: flex-start;   justify-content: flex-start; text-align: left; }

.hero-slider__slide.col-light::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.55) 100%);
}
.hero-slider__caption {
    position: relative;
    z-index: 2;
    padding: 22px 22px 26px;
    max-width: 720px;
}
.hero-slider__caption h2 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.2px;
    text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.col-dark .hero-slider__caption h2 { text-shadow: none; }
.hero-slider__caption p {
    margin: 0 0 12px;
    font-size: 13px;
    opacity: .95;
}
.hero-slider__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 8px 0 6px;
    border-bottom: 1.5px solid rgba(255,255,255,.85);
    transition: gap .2s ease, border-color .2s ease, color .2s ease;
}
.hero-slider__cta::after {
    content: "→";
    font-size: 14px;
    line-height: 1;
    transition: transform .2s ease;
}
.hero-slider__slide:hover .hero-slider__cta { gap: 14px; border-color: #fff; }
.hero-slider__slide:hover .hero-slider__cta::after { transform: translateX(4px); }
.col-dark .hero-slider__cta { color: #111; border-color: rgba(0,0,0,.65); }
.col-dark .hero-slider__slide:hover .hero-slider__cta { border-color: #111; }

.hero-slider__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.92);
    color: var(--text);
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.hero-slider__nav svg { width: 18px; height: 18px; }
.hero-slider__nav.prev { left: 10px; }
.hero-slider__nav.next { right: 10px; }
.hero-slider__nav:hover { background: #fff; color: var(--brand-red); }

.hero-slider__dots {
    position: absolute;
    bottom: 8px; left: 0; right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 3;
}
.hero-slider__dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,.55);
    cursor: pointer;
    transition: background .15s ease, width .15s ease;
}
.hero-slider__dot.active { background: #fff; width: 18px; border-radius: 999px; }

/* ============ CONTAINER ============ */
.app-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--container-pad) 24px;
}

/* ============ HERO TEXT ============ */
.hero {
    padding: 8px 0 14px;
}
.hero h1 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
}
.hero p {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* ============ TOOLBAR ============ */
.catalog-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0 14px;
    color: var(--brand-red);
    font-size: 13px;
    font-weight: 600;
}
.catalog-toolbar .info {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--text-muted);
    color: var(--text-muted);
    display: inline-grid; place-items: center;
    font-size: 11px; font-style: italic;
    font-family: serif;
}

/* ============ CATEGORY CHIPS (home/category page) ============ */
.cat-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 14px;
    scrollbar-width: none;
}
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip {
    flex: 0 0 auto;
    padding: 8px 16px;
    border: 1.5px solid var(--text);
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .3px;
    transition: background .15s ease, color .15s ease;
}
.cat-chip:hover, .cat-chip.active {
    background: var(--text);
    color: #fff;
}

/* ============ PRODUCT GRID ============ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.product-card {
    background: transparent;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: var(--text);
}
.product-card:hover { color: var(--text); opacity: .92; }

.product-card__media {
    aspect-ratio: 3 / 4;
    background: var(--surface-alt);
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}
.product-card__media img { width: 100%; height: 100%; object-fit: cover; }
.product-card__media .empty { color: #c0c0c0; }

.product-card__fav {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px; height: 32px;
    background: rgba(255,255,255,.92);
    border-radius: 50%;
    display: grid; place-items: center;
    color: var(--text);
    z-index: 2;
    cursor: pointer;
}
.product-card__fav:hover { color: var(--brand-red); }
.product-card__fav svg { width: 18px; height: 18px; }

.product-card__badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(255,255,255,.92);
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 2px;
    z-index: 2;
}
.product-card__badge--promo { background: var(--brand-red); color: #fff; }

.product-card__body { padding: 8px 2px 4px; }
.product-card__brand { font-size: 13px; font-weight: 700; margin: 0 0 2px; line-height: 1.2; }
.product-card__title {
    font-size: 13px; font-weight: 400; margin: 0 0 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card__excerpt {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card__price { font-size: 13px; font-weight: 700; }
.product-card__meta { font-size: 12px; color: var(--text-muted); }

/* ============ SECTION ============ */
.section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 22px 0 12px;
}
.section-title h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.section-title a {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    text-decoration: underline;
}

/* ============ PRODUCT DETAIL ============ */
.product-page__hero { margin: 0 calc(var(--container-pad) * -1) 16px; }
.product-page__hero .gallery {
    aspect-ratio: 3 / 4;
    background: var(--surface-alt);
    overflow-x: auto;
    display: flex;
    scroll-snap-type: x mandatory;
}
.product-page__hero .gallery img {
    width: 100%; height: 100%; object-fit: cover;
    flex: 0 0 100%;
    scroll-snap-align: center;
}
.product-page__info { padding: 4px 0 0; }
.product-page__info h1 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.2px;
}
.product-page__info .excerpt {
    font-size: 14px;
    color: var(--text);
    margin: 0 0 10px;
    line-height: 1.5;
}
.product-page__info .desc {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 16px;
}

/* ============ VARIANTS ============ */
.variant-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.variant-card {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
}
.variant-card:hover { border-color: var(--text); }
.variant-card__img {
    width: 54px; height: 54px;
    border-radius: var(--radius);
    background: var(--surface-alt);
    overflow: hidden;
    flex: 0 0 54px;
    display: grid; place-items: center;
    color: #c0c0c0;
}
.variant-card__img img { width: 100%; height: 100%; object-fit: cover; }
.variant-card__body { flex: 1; min-width: 0; }
.variant-card__title { font-weight: 700; font-size: 14px; margin: 0 0 4px; }
.variant-card__meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; }
.variant-card__meta .chip { background: var(--surface-alt); color: var(--text); padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.variant-card__qty {
    font-size: 12px; font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    flex: 0 0 auto;
    background: #ebf7eb; color: #1a7f37;
}
.variant-card__qty.low { background: #fff4e0; color: #b76b00; }
.variant-card__qty.empty { background: #f5f5f5; color: #888; }

/* ============ MOBILE DRAWER (mega menu) ============ */
.mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 80;
    pointer-events: none;
}
.mobile-drawer.open { pointer-events: auto; }
.mobile-drawer__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    opacity: 0;
    transition: opacity .22s ease;
}
.mobile-drawer.open .mobile-drawer__overlay { opacity: 1; }
.mobile-drawer__panel {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: min(420px, 92%);
    background: #fff;
    transform: translateX(-100%);
    transition: transform .26s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mobile-drawer.open .mobile-drawer__panel { transform: translateX(0); }
.mobile-drawer__top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}
.mobile-drawer__brand img { max-height: 38px; }
.mobile-drawer__close {
    width: 38px; height: 38px;
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    display: grid; place-items: center;
}
.mobile-drawer__close svg { width: 22px; height: 22px; }

.mobile-drawer__nav {
    overflow-y: auto;
    padding: 8px 0 24px;
}
.mobile-drawer__top-link {
    display: block;
    padding: 14px 18px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}
.mobile-drawer__group { border-bottom: 1px solid var(--border); }
.mobile-drawer__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 14px;
    cursor: pointer;
}
.mobile-drawer__head svg { transition: transform .22s ease; }
.mobile-drawer__group.open .mobile-drawer__head svg { transform: rotate(180deg); }
.mobile-drawer__body {
    display: none;
    padding: 4px 18px 14px;
    background: var(--surface-alt);
}
.mobile-drawer__group.open .mobile-drawer__body { display: block; }
.mobile-drawer__body .all {
    display: block;
    color: var(--brand-red);
    font-weight: 700;
    padding: 8px 0;
    text-decoration: underline;
    font-size: 13px;
}
.mobile-drawer__col { padding: 6px 0; }
.mobile-drawer__col .title {
    font-weight: 800;
    font-size: 13px;
    margin: 8px 0 4px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.mobile-drawer__col a {
    display: block;
    padding: 5px 0;
    font-size: 13px;
    color: var(--text);
}
.mobile-drawer__col a:hover { color: var(--brand-red); }

/* ============ TABBAR (mobile bottom nav) ============ */
.tabbar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--tabbar-h);
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    z-index: 40;
}
.tabbar__item {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 11px; font-weight: 600;
}
.tabbar__item svg { width: 22px; height: 22px; }
.tabbar__item.active { color: var(--brand-red); }

/* ============ MISC ============ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state svg { color: #c0c0c0; width: 48px; height: 48px; margin-bottom: 8px; }

.btn {
    display: inline-flex;
    align-items: center; justify-content: center;
    gap: 8px;
    background: var(--text);
    color: #fff;
    border: none;
    border-radius: 2px;
    padding: 14px 24px;
    font-weight: 700; font-size: 14px;
    text-transform: uppercase; letter-spacing: .3px;
    cursor: pointer;
}
.btn:hover { background: var(--brand-red); color: #fff; }

.back-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text);
    font-weight: 700; font-size: 13px;
    margin-bottom: 12px;
    text-transform: uppercase; letter-spacing: .3px;
}
.back-link:hover { color: var(--brand-red); }

.app { padding-bottom: calc(var(--tabbar-h) + 12px); }

/* ============ RESPONSIVE ============ */
@media (min-width: 600px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

@media (min-width: 900px) {
    :root { --container-pad: var(--container-pad-desktop); }
    .app { padding-bottom: 32px; }
    .topbar { height: var(--topbar-h-desktop); }
    .topbar__btn { font-size: 11px; }
    .topbar__btn svg { width: 24px; height: 24px; }
    .topbar__logo img { max-height: calc(var(--topbar-h-desktop) - 18px); }
    .product-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
    .tabbar { display: none; }
    .product-page__hero { margin: 0 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
    .product-page__hero .gallery { aspect-ratio: 1 / 1; border-radius: var(--radius-md); overflow: hidden; }
    .product-page__info { padding: 8px 0; }
    .variant-list { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 28px; }
    .hero-slider__caption h2 { font-size: 32px; }
    .hero-slider__caption p { font-size: 15px; }
    .hero-slider__caption { padding: 32px; }
}

@media (min-width: 1200px) {
    .product-grid { grid-template-columns: repeat(5, 1fr); }
    .variant-list { grid-template-columns: repeat(3, 1fr); }
}
