/* ==========================================================================
   MedZak.ma — Feuille de styles
   ========================================================================== */

:root {
    --primary: #0F4C81;
    --primary-dark: #0A3461;
    --primary-light: #EAF2FB;
    --accent: #FF8C42;
    --accent-2: #2EBC8F;
    --danger: #EF4444;
    --warning: #F59E0B;
    --text: #1F2937;
    --text-soft: #6B7280;
    --border: #E5E7EB;
    --bg: #FFFFFF;
    --bg-soft: #F9FAFB;
    --shadow-sm: 0 1px 2px rgba(15, 76, 129, 0.06);
    --shadow: 0 4px 14px rgba(15, 76, 129, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 76, 129, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 18px;
    --transition: .2s ease;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    font-size: 15px;
}

a { color: inherit; text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============ Topbar ============ */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-soft);
    padding-top: 6px;
}
.topbar__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 24px;
    flex-wrap: wrap;
    gap: 8px;
}
.topbar__shipping {
    color: var(--danger);
    font-weight: 600;
    letter-spacing: .3px;
}
.topbar__shipping i { margin-right: 6px; }
.topbar__links {
    list-style: none;
    display: flex;
    gap: 18px;
    margin: 0;
    padding: 0;
}
.topbar__links a:hover { color: var(--primary); }

/* ============ Header ============ */
.header {
    background: #fff;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}
.logo__icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(15, 76, 129, .3);
}
.logo__text strong {
    display: block;
    font-size: 22px;
    color: var(--primary);
    line-height: 1;
}
.logo__tld { color: var(--accent); }
.logo__text small {
    font-size: 11px;
    color: var(--text-soft);
    font-weight: 500;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.logo--light .logo__text strong { color: #fff; }
.logo--light .logo__text small { color: rgba(255,255,255,.7); }

.search {
    flex: 1;
    max-width: 580px;
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 4px 4px 4px 18px;
    transition: var(--transition);
}
.search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 76, 129, .1);
}
.search__icon { color: var(--text-soft); margin-right: 10px; }
.search input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    padding: 10px 8px;
    font-size: 14px;
    font-family: inherit;
}
.search button {
    background: var(--primary);
    color: #fff;
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 600;
}
.search button:hover { background: var(--primary-dark); }

/* Search live dropdown */
.search__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
    max-height: 420px;
    overflow-y: auto;
}
.search__result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    color: var(--text);
}
.search__result:last-of-type { border-bottom: none; }
.search__result:hover { background: var(--bg-soft); color: var(--text); }
.search__result img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--bg-soft);
}
.search__result-name { flex: 1; font-size: 14px; font-weight: 500; }
.search__result-price { font-weight: 700; color: var(--primary); font-size: 14px; white-space: nowrap; }
.search__more {
    display: block;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    text-align: center;
}
.search__more:hover { background: #d0e7f8; color: var(--primary); }

.header__actions {
    display: flex;
    align-items: center;
    gap: 18px;
}
.header__phone {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--accent);
    color: #fff !important;
    padding: 10px 16px;
    border-radius: 50px;
    font-weight: 700;
}
.header__phone-icon {
    background: rgba(255,255,255,.25);
    width: 28px; height: 28px;
    border-radius: 50%;
    display: grid; place-items: center;
}
.header__phone:hover { background: #e87a30; color: #fff !important; }
.header__action {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    color: var(--text-soft);
    position: relative;
    gap: 2px;
}
.header__action i { font-size: 20px; color: var(--primary); }
.header__action:hover { color: var(--primary); }
.header__cart-count {
    position: absolute;
    top: -6px; right: -10px;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    min-width: 18px; height: 18px;
    display: grid; place-items: center;
    font-size: 11px;
    font-weight: 700;
    padding: 0 5px;
}

/* ============ Nav ============ */
.nav {
    background: #fff;
    border-top: 1px solid var(--border);
}
.nav__inner {
    display: flex;
    align-items: stretch;
    gap: 18px;
    padding: 0 24px;
}
.nav__all {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 22px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    border-radius: 0;
    align-self: stretch;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.nav__all:hover { background: var(--primary-dark); }
.nav__all i { font-size: 16px; }

.nav__all-wrap { position: relative; align-self: stretch; display: flex; }
.nav__all-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 300;
    min-width: 280px;
    background: #fff;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: 0 14px 32px rgba(0, 0, 0, .14);
    padding: 6px 0;
}
.nav__all-menu[hidden] { display: none; }
.nav__all-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}
.nav__all-menu a:hover { background: #f4f7fb; color: var(--primary); }
.nav__all-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: none;
}

.nav__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2px;
    flex: 1;
    align-items: center;
    flex-wrap: nowrap;
}
.nav__menu > li { display: flex; align-items: center; }
.nav__menu a {
    padding: 14px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text);
    font-size: 14px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.nav__menu a:hover {
    color: var(--primary);
    border-color: var(--primary);
}
.nav__highlight a { color: var(--accent); font-weight: 600; }
.nav__pro {
    margin-left: auto;
    padding-left: 14px;
    border-left: 1px solid var(--border);
}
.nav__pro a {
    color: var(--primary);
    font-weight: 600;
}
.nav__pro a:hover { color: var(--primary-dark); border-color: transparent; }
.badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--danger);
    color: #fff;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}
.badge--new { background: var(--accent); }

/* ============ Hero ============ */
.hero {
    padding: 28px 0;
    background: var(--bg-soft);
}
.hero__slider {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}
/* Desktop / mobile slider visibility toggle */
.hero--mobile  { display: none; }
@media (max-width: 760px) {
    .hero--desktop { display: none; }
    .hero--mobile  { display: block; }
}

.hero__slide {
    display: none;
    width: 100%;
    overflow: hidden;
}
.hero__slide.is-active { display: block; }
.hero--desktop .hero__slide { aspect-ratio: 1450 / 380; }
.hero--mobile  .hero__slide { aspect-ratio: 1 / 1; }

.hero__link { display: block; width: 100%; height: 100%; }
.hero__slide img,
.hero__link img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero__arrow {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: grid; place-items: center;
    box-shadow: var(--shadow);
    z-index: 3;
}
.hero__arrow:hover { background: var(--primary-dark); }
.hero__arrow--prev { left: 16px; }
.hero__arrow--next { right: 16px; }

.hero__dots {
    position: absolute;
    bottom: 18px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 8px;
    z-index: 2;
}
.hero__dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(15,76,129,.25);
    cursor: pointer;
    transition: var(--transition);
}
.hero__dot.is-active { background: var(--primary); width: 24px; border-radius: 50px; }

/* ============ Sections ============ */
.section { padding: 48px 0; }
.section--soft { background: var(--bg-soft); }
.section__head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}
.section__title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}
.section__link {
    color: var(--primary);
    font-weight: 600;
}
.section__link:hover { color: var(--primary-dark); }

/* ============ Promo banner (admin: /admin/banner.php) ============ */
.banner-section { padding: 8px 0; }
.promo-banner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 18px 28px;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}
.promo-banner__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    padding-right: 24px;
    border-right: 1px solid rgba(255,255,255,.25);
}
.promo-banner__brand i { font-size: 24px; }
.promo-banner__desc {
    flex: 1;
    margin: 0;
    font-size: 15px;
    min-width: 180px;
}
.promo-banner__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 12px 22px;
    border-radius: 50px;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition);
}
.promo-banner__cta:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

@media (max-width: 760px) {
    .banner-section { padding: 8px 0; }
    .promo-banner { padding: 16px 18px; gap: 12px; }
    .promo-banner__brand {
        padding-right: 0;
        border-right: none;
        font-size: 17px;
        width: 100%;
    }
    .promo-banner__desc { font-size: 13px; }
    .promo-banner__cta { padding: 10px 18px; font-size: 13px; }
}

/* ============ Highlights (Incontournables) ============ */
.highlights {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.highlight {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1 / 1.05;
    background-color: var(--primary-light);
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.highlight:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.highlight__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}
.highlight__content {
    position: absolute;
    inset: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    color: #fff;
    z-index: 1;
    background: linear-gradient(180deg, rgba(15,76,129,.05) 0%, rgba(15,76,129,.55) 100%);
}
.highlight__title { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.highlight__subtitle { font-size: 14px; opacity: .95; }

/* ============ Categories grid ============ */
.categories {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 16px;
}
.cat-card {
    text-align: center;
    padding: 18px 8px;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--border);
    transition: var(--transition);
}
.cat-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}
.cat-card__icon {
    width: 72px; height: 72px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: grid; place-items: center;
    font-size: 28px;
}
.cat-card--promo .cat-card__icon { background: #FEE2E2; color: var(--danger); }
.cat-card__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

/* ============ Product cards ============ */
.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}
.product {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}
.product:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}
.product__media {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg-soft);
    overflow: hidden;
}
.product__media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.product:hover .product__media img { transform: scale(1.05); }

.product__badge {
    position: absolute;
    left: 12px; top: 12px;
    background: var(--danger);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.product__badge--blue { background: var(--primary); }
.product__badge--green { background: var(--accent-2); }
.product__fav {
    position: absolute;
    right: 12px; top: 12px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #fff;
    color: var(--text-soft);
    display: grid; place-items: center;
    box-shadow: var(--shadow-sm);
}
.product__fav:hover { color: var(--danger); }

.product__body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product__name {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    line-height: 1.35;
    min-height: 38px;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product__price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.product__price-old {
    text-decoration: line-through;
    color: var(--text-soft);
    font-size: 13px;
}
.product__price-current {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
}
.product__price-tag {
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
    font-size: 11px;
    padding: 2px 6px;
    font-weight: 700;
}
.product__cta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 50px;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}
.product__cta:hover { background: var(--primary); color: #fff; }
.product__cta i { font-size: 12px; }

/* ============ Carousel scroller ============ */
.scroller {
    position: relative;
}
.scroller__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 66px) / 4);
    gap: 22px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 8px 4px 16px;
}
.scroller__track::-webkit-scrollbar { display: none; }
.scroller__track > * { scroll-snap-align: start; }
.scroller__btn {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--primary);
    display: grid; place-items: center;
    box-shadow: var(--shadow);
    z-index: 2;
}
.scroller__btn:hover { background: var(--primary); color: #fff; }
.scroller__btn--prev { left: -22px; }
.scroller__btn--next { right: -22px; }

/* ============ CTA Box (e.g. Entorse à la cheville) ============ */
.cta-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    padding: 40px 32px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: end;
    min-height: 360px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}
.cta-box::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(15,76,129,.85) 100%);
}
.cta-box > * { position: relative; }
.cta-box__title { font-size: 26px; font-weight: 700; margin: 0 0 6px; }
.cta-box__subtitle { font-size: 14px; opacity: .95; margin: 0 0 18px; }
.cta-box__cta {
    align-self: flex-start;
    background: #fff;
    color: var(--primary) !important;
    padding: 12px 22px;
    border-radius: 50px;
    font-weight: 600;
    display: inline-block;
}
.cta-box__cta:hover { transform: translateY(-2px); }

.split-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: stretch;
}

/* ============ Page header ============ */
.page-head {
    background: var(--primary-light);
    padding: 40px 0;
    border-bottom: 1px solid var(--border);
}
.page-head h1 {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 32px;
}
.breadcrumb {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin: 0;
    padding: 0;
    color: var(--text-soft);
    font-size: 13px;
}
.breadcrumb li { display: inline-flex; align-items: center; }
.breadcrumb li + li::before { content: '›'; margin-right: 8px; color: var(--border); }
.breadcrumb__current {
    color: var(--text);
    font-weight: 500;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.page-head--slim { padding: 18px 0; }

/* ============ Product detail ============ */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding: 12px 0;
}
.product-detail__media {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-soft);
}
.product-detail__media img { width: 100%; }
.product-detail h1 { font-size: 28px; margin: 0 0 12px; color: var(--primary); }
.product-detail__price { font-size: 32px; font-weight: 800; color: var(--primary); margin: 18px 0; }
.product-detail__price s { color: var(--text-soft); font-size: 20px; font-weight: 500; margin-right: 12px; }
.product-detail__desc { color: var(--text-soft); margin-bottom: 24px; }
.product-detail__qty {
    display: flex; align-items: center; gap: 0;
    border: 1px solid var(--border);
    border-radius: 50px;
    width: fit-content;
}
.product-detail__qty button {
    width: 40px; height: 40px;
    font-size: 18px;
    color: var(--primary);
}
.product-detail__qty input {
    width: 50px; text-align: center;
    border: none; background: none;
    font-size: 16px; font-weight: 600;
    -moz-appearance: textfield;
}
.product-detail__qty input::-webkit-outer-spin-button,
.product-detail__qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.product-detail__actions {
    display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap;
}
.btn {
    background: var(--primary);
    color: #fff !important;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn--ghost {
    background: #fff;
    color: var(--primary) !important;
    border: 1px solid var(--primary);
}
.btn--ghost:hover { background: var(--primary-light); }
.btn--accent { background: var(--accent); }
.btn--accent:hover { background: #e87a30; }

/* ============ Catalogue / category ============ */
.catalogue {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    padding: 32px 0 64px;
}
.sidebar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    height: fit-content;
    position: sticky;
    top: 180px;
}
.sidebar h4 { margin: 0 0 12px; font-size: 14px; color: var(--text-soft); text-transform: uppercase; letter-spacing: .5px; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li a {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 14px;
}
.sidebar li a.is-active,
.sidebar li a:hover { background: var(--primary-light); color: var(--primary); }
.sidebar li a span { color: var(--text-soft); font-size: 12px; }

/* ============ Cart ============ */
.cart {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 32px;
    padding: 32px 0 64px;
}
.cart__items {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 0;
}
.cart-item {
    display: grid;
    grid-template-columns: 90px 1fr auto auto auto;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item img {
    width: 90px; height: 90px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
}
.cart-item__name { font-weight: 600; color: var(--text); }
.cart-item__price { font-weight: 700; color: var(--primary); }
.cart-item__qty {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 50px;
}
.cart-item__qty button { width: 32px; height: 32px; font-weight: 700; color: var(--primary); }
.cart-item__qty input {
    width: 36px; border: none; text-align: center;
    background: none; font-weight: 600;
}
.cart-item__remove { color: var(--danger); padding: 6px; }
.cart-item__remove:hover { background: #FEE2E2; border-radius: 6px; }

.cart-summary {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 180px;
}
.cart-summary h3 { margin: 0 0 18px; color: var(--primary); }
.cart-summary__row {
    display: flex; justify-content: space-between;
    padding: 8px 0;
    color: var(--text-soft);
    font-size: 14px;
}
.cart-summary__row--total {
    border-top: 1px solid var(--border);
    margin-top: 12px; padding-top: 16px;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}
.cart-summary__row--total span:last-child { color: var(--primary); }
.cart-summary .btn { width: 100%; justify-content: center; margin-top: 16px; }

.cart-empty {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-soft);
}
.cart-empty i { font-size: 64px; color: var(--border); margin-bottom: 18px; }

/* ============ Footer ============ */
.footer {
    background: #0B1A2D;
    color: rgba(255,255,255,.75);
    padding: 56px 0 0;
}
.footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
    gap: 36px;
    padding-bottom: 36px;
}
.footer h4 {
    color: #fff;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .8px;
    margin: 0 0 18px;
}
.footer__pitch { font-size: 14px; line-height: 1.6; margin: 16px 0; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer ul li { padding: 6px 0; font-size: 14px; }
.footer ul li a:hover { color: #fff; }
.footer__contact i { width: 18px; color: var(--accent); }
.footer__contact small { color: rgba(255,255,255,.5); font-size: 12px; }
.footer__social {
    display: flex; gap: 10px;
    margin-top: 16px;
}
.footer__social a {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    display: grid; place-items: center;
    color: #fff;
}
.footer__social a:hover { background: var(--accent); }

.footer__bottom {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 18px 0;
    font-size: 13px;
}
.footer__bottom-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* ============ Whatsapp FAB ============ */
.whatsapp-fab {
    position: fixed;
    bottom: 24px; right: 24px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: #25D366;
    color: #fff !important;
    display: grid; place-items: center;
    font-size: 28px;
    box-shadow: 0 8px 24px rgba(37, 211, 102, .4);
    z-index: 999;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

/* ============ Toast ============ */
.toast {
    position: fixed;
    bottom: 92px; right: 24px;
    background: var(--primary);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    z-index: 1000;
    animation: slideIn .3s ease;
}
@keyframes slideIn {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============ Static info pages ============ */
.info-page { padding: 48px 0; max-width: 800px; margin: 0 auto; }
.info-page h1 { color: var(--primary); margin-top: 0; }
.info-page p, .info-page li { color: var(--text-soft); line-height: 1.7; }

/* ============ Mobile drawer ============ */
.header__burger {
    display: none;
    width: 44px; height: 44px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 20px;
    align-items: center;
    justify-content: center;
}
.header__burger:hover { background: var(--primary); color: #fff; }

.drawer { position: fixed; inset: 0; z-index: 200; }
.drawer[hidden] { display: none; }
.drawer__backdrop {
    position: absolute; inset: 0;
    background: rgba(15, 26, 45, .55);
    animation: fadeIn .25s ease;
}
.drawer__panel {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: min(86vw, 340px);
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
    animation: slideRight .28s ease;
    overflow-y: auto;
}
.drawer__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: #fff; z-index: 1;
}
.drawer__close {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--text);
    font-size: 18px;
    display: grid; place-items: center;
}
.drawer__close:hover { background: var(--danger); color: #fff; }
.drawer__nav { display: flex; flex-direction: column; padding: 8px 0; }
.drawer__nav a {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 20px;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    border-left: 3px solid transparent;
}
.drawer__nav a:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
}
.drawer__nav a i { width: 20px; color: var(--primary); }
.drawer__nav-pro { color: var(--accent) !important; }
.drawer__nav-pro i { color: var(--accent) !important; }
.drawer__section {
    border-top: 1px solid var(--border);
    padding: 14px 0 8px;
}
.drawer__section h4 {
    margin: 0 0 4px;
    padding: 0 20px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-soft);
}
.drawer__contact {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.drawer__contact .btn { justify-content: center; }
.drawer__contact small {
    color: var(--text-soft);
    text-align: center;
    font-size: 12px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideRight { from { transform: translateX(-100%); } to { transform: translateX(0); } }

body.no-scroll { overflow: hidden; }

/* ============ Sticky add-to-cart (product page) ============ */
.product-sticky {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 18px rgba(15,76,129,.10);
    padding: 10px 14px;
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 50;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
.product-sticky img {
    width: 48px; height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--bg-soft);
    flex-shrink: 0;
}
.product-sticky__info {
    flex: 1;
    min-width: 0;
}
.product-sticky__name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}
.product-sticky__price s {
    color: var(--text-soft);
    font-size: 11px;
    margin-right: 4px;
}
.product-sticky__price strong {
    color: var(--primary);
    font-size: 15px;
    font-weight: 800;
}
.product-sticky__btn {
    padding: 12px 18px;
    font-size: 14px;
    flex-shrink: 0;
}

/* ============ Responsive ============ */
@media (max-width: 1100px) {
    .highlights { grid-template-columns: repeat(2, 1fr); }
    .categories { grid-template-columns: repeat(4, 1fr); }
    .products { grid-template-columns: repeat(3, 1fr); }
    .scroller__track { grid-auto-columns: calc((100% - 44px) / 3); }
    .footer__grid { grid-template-columns: repeat(2, 1fr); }
    .split-2 { grid-template-columns: 1fr; }
    .product-detail { grid-template-columns: 1fr; gap: 24px; }
    .catalogue { grid-template-columns: 1fr; gap: 16px; padding-top: 16px; }
    .catalogue > div { min-width: 0; }
    /* Catalogue card overrides live inline in pages/category.php */
    .sidebar {
        position: static;
        padding: 12px 16px;
        border-radius: var(--radius-sm);
    }
    .sidebar h4 { display: none; }
    .sidebar ul {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 2px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        max-width: 100%;
    }
    .sidebar ul::-webkit-scrollbar { display: none; }
    .sidebar li { flex-shrink: 0; }
    .sidebar li a {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 7px 16px;
        border-radius: 20px;
        background: var(--bg-soft);
        border: 1px solid var(--border);
        white-space: nowrap;
        font-size: 13px;
        font-weight: 500;
    }
    .sidebar li a.is-active,
    .sidebar li a.is-active:hover {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }
    .sidebar li a.is-active span { background: rgba(255,255,255,.25); color: #fff; }
    .sidebar li a span {
        font-size: 11px;
        background: rgba(0,0,0,.08);
        padding: 1px 6px;
        border-radius: 10px;
        color: var(--text-soft);
    }
    .cart { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
}

/* ─── Catalogue listing — mobile 2-col grid (shared by catalogue.php + category.php) ── */
@media (max-width: 1100px) {
    section.catalogue {
        display: block !important;
        padding: 14px 12px 48px !important;
    }
    section.catalogue .sidebar {
        position: sticky;
        top: 0;
        z-index: 5;
        margin: 0 -16px 14px;
        padding: 10px 16px !important;
        border-radius: 0 !important;
        background: #fff !important;
        border: none !important;
        border-bottom: 1px solid var(--border) !important;
    }
    section.catalogue .sidebar ul { padding-left: 0 !important; }

    section.catalogue .products {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        align-items: stretch !important;
        padding: 4px 2px !important;
    }
    section.catalogue .product {
        min-width: 0 !important;
        height: 100%;
        display: flex !important;
        flex-direction: column !important;
        border-radius: 10px !important;
        overflow: hidden;
        position: relative;
    }
    section.catalogue .product:hover { transform: none; }
    section.catalogue .product__media {
        aspect-ratio: 1 !important;
        background: var(--bg-soft);
        position: relative;
        overflow: hidden;
    }
    section.catalogue .product__media img { width: 100%; height: 100%; object-fit: cover; }
    section.catalogue .product__badge { display: none !important; }
    section.catalogue .product__fav {
        position: absolute;
        right: 6px; top: 6px;
        width: 26px; height: 26px;
        border-radius: 50%;
        background: rgba(255,255,255,.95);
        border: none;
        font-size: 11px;
    }
    section.catalogue .product__body {
        padding: 8px 10px 10px !important;
        gap: 4px !important;
        display: flex !important;
        flex-direction: column !important;
        flex: 1;
    }
    section.catalogue .product__name {
        font-size: 12px !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        min-height: 31px !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        color: var(--text);
    }
    section.catalogue .product__name a { color: inherit; }
    section.catalogue .product__price {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0 !important;
        margin: 4px 0 0 !important;
        line-height: 1.15;
    }
    section.catalogue .product__price-old {
        font-size: 10px !important;
        color: var(--text-soft) !important;
        text-decoration: line-through;
        white-space: nowrap;
    }
    section.catalogue .product__price-current {
        font-size: 14px !important;
        font-weight: 800 !important;
        color: var(--primary) !important;
        white-space: nowrap;
    }
    section.catalogue .product__price-tag {
        display: inline-block;
        font-size: 9px !important;
        padding: 1px 5px !important;
        border-radius: 3px;
        margin-top: 3px;
        background: var(--danger);
        color: #fff;
        font-weight: 700;
        align-self: flex-start;
    }
    section.catalogue .product__cta {
        padding: 6px !important;
        font-size: 11px !important;
        font-weight: 600 !important;
        margin-top: 6px;
        border-radius: 18px;
    }
    section.catalogue .product__cta i { font-size: 10px; }
}
@media (max-width: 380px) {
    section.catalogue .product__price-current { font-size: 13px !important; }
    section.catalogue .product__body { padding: 6px 8px 8px !important; }
}

@media (max-width: 900px) {
    .topbar__links { display: none; }
    .topbar__inner { justify-content: center; }

    /* Breathing room above the logo row and below the search bar */
    .topbar { margin-bottom: 8px; }
    .header { margin-bottom: 12px; }

    .header__inner {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        row-gap: 10px;
    }
    .header__burger { display: inline-flex; }
    .logo__text small { display: none; }
    .logo__text strong { font-size: 18px; }
    .logo__icon { width: 36px; height: 36px; font-size: 18px; }

    /* Search occupies its own row below */
    .search {
        grid-column: 1 / -1;
        order: 99;
        max-width: none;
        padding: 4px 4px 4px 14px;
    }
    .search input { padding: 8px 6px; font-size: 13px; }
    .search button { padding: 8px 16px; font-size: 13px; }

    /* Hide desktop-only actions */
    .header__phone,
    .header__action--desktop { display: none; }
    .header__actions { gap: 6px; }
    .header__action i { font-size: 22px; }
    .header__cart {
        width: 44px; height: 44px;
        border-radius: 10px;
        background: var(--primary);
        color: #fff;
        display: grid;
        place-items: center;
    }
    .header__cart i { color: #fff; font-size: 18px; }
    .header__cart-count { top: -4px; right: -4px; }

    /* Hide the secondary nav row entirely on mobile — menu lives in drawer */
    .nav { display: none; }

    .container { padding: 0 16px; }
    .section { padding: 8px 0; }
}

/* ============ Checkout ============ */
.checkout-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
}
@media (max-width: 820px) {
    .checkout-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 760px) {
    .hero { padding: 16px 0; }
    .hero__arrow {
        width: 36px; height: 36px;
        background: rgba(255,255,255,.92);
        color: var(--primary);
    }
    .hero__arrow--prev { left: 8px; }
    .hero__arrow--next { right: 8px; }
    .hero__dots { bottom: 12px; }

    .section__title { font-size: 22px; }
    .section__head { margin-bottom: 18px; }

    .categories { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .cat-card { padding: 14px 6px; }
    .cat-card__icon { width: 56px; height: 56px; font-size: 22px; margin-bottom: 8px; }
    .cat-card__name { font-size: 12px; }

    .products { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product__media { aspect-ratio: 4/3; }
    .product__body { padding: 12px; gap: 8px; }
    .product__name { font-size: 13px; min-height: 36px; }
    .product__price-current { font-size: 15px; }
    .product__price-old { font-size: 12px; }
    .product__cta { padding: 8px 12px; font-size: 13px; }

    .scroller__track { grid-auto-columns: calc((100% - 12px) / 2); gap: 12px; }
    .scroller__btn { display: none; }

    /* Horizontal scroll on mobile — cards become a swipeable row */
    .highlights {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 4px 0 16px 4px;   /* tiny left inset so cards align with the heading */
        margin: 0;
        scrollbar-width: none;
    }
    .highlights::-webkit-scrollbar { display: none; }
    .highlight {
        flex: 0 0 78%;
        aspect-ratio: 1 / 1.05;
        scroll-snap-align: start;
    }

    .footer__grid { grid-template-columns: 1fr; gap: 24px; }
    .footer__bottom-inner { flex-direction: column; text-align: center; gap: 6px; }

    .cart-item { grid-template-columns: 70px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; }
    .cart-item img { width: 70px; height: 70px; }
    .cart-item__qty { grid-column: 2; grid-row: 2; }
    .cart-item__price { grid-column: 3; grid-row: 1 / 3; align-self: center; }
    .cart-item__remove { grid-column: 3; grid-row: 2; align-self: end; }

    .page-head { padding: 24px 0; }
    .page-head--slim { padding: 12px 0; }
    .page-head h1 { font-size: 24px; }

    .breadcrumb { font-size: 12px; gap: 2px 6px; flex-wrap: nowrap; overflow: hidden; }
    .breadcrumb li + li::before { margin-right: 6px; }
    .breadcrumb__hide-mobile { display: none; }
    .breadcrumb__current {
        max-width: none;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }
    .breadcrumb li:not(.breadcrumb__current) {
        flex-shrink: 0;
    }

    .whatsapp-fab { width: 50px; height: 50px; font-size: 24px; bottom: 18px; right: 18px; }

    /* Show the sticky bar only on mobile, on product pages */
    .product-sticky { display: flex; }
    body:has(.product-sticky) { padding-bottom: 78px; }
    body:has(.product-sticky) .whatsapp-fab { bottom: 92px; }
    /* Compact "Voir panier" link inside the sticky bar (shown after first add) */
    .product-sticky__view {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 8px 10px;
        font-size: 12px;
        flex-shrink: 0;
        white-space: nowrap;
    }
    .product-sticky__view[hidden] { display: none !important; }
    .product-sticky__view-text { display: none; }   /* keep label off on mobile, icon + count only */
    .product-sticky__view-count {
        background: var(--danger);
        color: #fff;
        min-width: 18px; height: 18px;
        border-radius: 50%;
        font-size: 11px;
        font-weight: 700;
        display: inline-grid;
        place-items: center;
        padding: 0 5px;
    }

    /* Compact the desktop action row inside product detail */
    .product-detail h1 { font-size: 22px; }
    .product-detail__price { font-size: 26px; margin: 12px 0; }
    .product-detail__price s { font-size: 16px; }
    .product-detail__actions .btn { flex: 1; justify-content: center; }
}
