/* =====================================================================
   KANMATY — surcouche front (en-tête façon marketplace + sections dynamiques)
   Garde la charte : bleu #000BBD / marine #001F60 / jaune #FAD722.
   Tout est préfixé "kh-" (header) et "kc-" (cartes/sections) : aucun conflit avec le thème.
   ===================================================================== */

:root {
    --kc-blue: #000BBD;
    --kc-navy: #001F60;
    --kc-yellow: #FAD722;
    --kc-green: #0f8a3c;
    --kc-ink: #282828;
    --kc-muted: #75757a;
    --kc-line: #ededed;
    --kc-radius: 14px;
}

/* ============================ HEADER ============================ */
.kh-top { background: var(--kc-navy); color: #fff; font-size: 12px; }
.kh-top .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 34px; }
.kh-top a, .kh-top button { color: #fff; text-decoration: none; background: none; border: 0; font-size: 12px; padding: 0; cursor: pointer; }
.kh-top a:hover { text-decoration: underline; }
.kh-promo { display: flex; align-items: center; gap: 8px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kh-promo i { color: var(--kc-yellow); }
.kh-top-links { display: flex; align-items: center; gap: 18px; }
.kh-cur { position: relative; }
.kh-cur > button::after { content: " ▾"; font-size: 10px; }
.kh-cur ul { display: none; position: absolute; right: 0; top: 100%; background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); min-width: 90px; padding: 6px 0; z-index: 1200; list-style: none; margin: 0; }
.kh-cur:hover ul, .kh-cur:focus-within ul { display: block; }
.kh-cur li a { display: block; color: var(--kc-ink); padding: 6px 14px; }
.kh-cur li a:hover { background: #f4f5ff; text-decoration: none; }

.kh-main { background: #fff; border-bottom: 1px solid var(--kc-line); }
.kh-main .container { display: flex; align-items: center; gap: 18px; padding-top: 8px; padding-bottom: 8px; }
.kh-logo { flex: none; line-height: 0; }
.kh-burger { display: none; background: none; border: 0; font-size: 22px; color: var(--kc-navy); padding: 4px 8px; }
.kh-logo img { height: 52px; width: auto; display: block; }

.kh-search { flex: 1 1 auto; position: relative; max-width: 760px; }
.kh-search form { display: flex; align-items: stretch; border: 2px solid var(--kc-blue); border-radius: 10px; background: #fff; overflow: visible; }
.kh-search .kh-cat { border: 0; background: #f4f5ff; color: var(--kc-navy); font-size: 13px; font-weight: 600; padding: 0 12px; max-width: 170px; border-radius: 8px 0 0 8px; cursor: pointer; outline: none; border-right: 1px solid #dfe1ff; }
.kh-search input[type=search] { flex: 1 1 auto; border: 0; outline: none; padding: 11px 14px; font-size: 14px; min-width: 0; background: transparent; }
.kh-search input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
.kh-search .kh-go { border: 0; background: var(--kc-blue); color: #fff; font-weight: 700; font-size: 14px; padding: 0 22px; border-radius: 0 7px 7px 0; cursor: pointer; letter-spacing: .3px; }
.kh-search .kh-go:hover { background: var(--kc-navy); }

.kh-panel { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.18); z-index: 1300; max-height: 70vh; overflow-y: auto; }
.kh-panel.is-open { display: block; }
.kh-panel h6 { margin: 0; padding: 12px 16px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--kc-muted); display: flex; justify-content: space-between; }
.kh-panel h6 button { background: none; border: 0; color: var(--kc-blue); font-size: 11px; cursor: pointer; text-transform: none; letter-spacing: 0; }
.kh-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 14px; }
.kh-chip { display: inline-flex; align-items: center; gap: 6px; background: #f4f5ff; color: var(--kc-navy); border-radius: 99px; padding: 6px 12px; font-size: 13px; text-decoration: none; cursor: pointer; border: 0; }
.kh-chip:hover { background: var(--kc-blue); color: #fff; text-decoration: none; }
.kh-chip .x { opacity: .5; margin-left: 2px; }
.kh-item { display: flex; gap: 12px; align-items: center; padding: 9px 16px; color: var(--kc-ink); text-decoration: none; }
.kh-item:hover, .kh-item.is-active { background: #f4f5ff; text-decoration: none; color: var(--kc-ink); }
.kh-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: #f2f2f2; flex: none; }
.kh-item .ico { width: 44px; height: 44px; border-radius: 8px; background: #eef; display: flex; align-items: center; justify-content: center; color: var(--kc-blue); flex: none; }
.kh-item b { font-weight: 600; font-size: 14px; display: block; line-height: 1.25; }
.kh-item small { color: var(--kc-muted); font-size: 12px; }
.kh-item .px { margin-left: auto; font-weight: 700; font-size: 13px; white-space: nowrap; color: var(--kc-navy); }
.kh-all { display: block; text-align: center; padding: 12px; font-weight: 700; color: var(--kc-blue); border-top: 1px solid var(--kc-line); text-decoration: none; }
.kh-all:hover { background: #f4f5ff; text-decoration: none; }
.kh-empty { padding: 26px 16px; text-align: center; color: var(--kc-muted); }
.kh-empty b { display: block; color: var(--kc-ink); margin-bottom: 4px; }

.kh-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.kh-drop { position: relative; }
.kh-drop > a, .kh-drop > button.kh-btn { display: flex; align-items: center; gap: 8px; color: var(--kc-ink); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; background: none; border: 0; cursor: pointer; white-space: nowrap; }
.kh-drop > a:hover, .kh-drop > button.kh-btn:hover, .kh-drop:focus-within > button.kh-btn { background: #f4f5ff; text-decoration: none; }
.kh-drop > a i, .kh-drop > button i { font-size: 18px; color: var(--kc-navy); }
.kh-drop .caret { font-size: 10px; opacity: .6; }
.kh-menu { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.18); min-width: 240px; padding: 8px 0; z-index: 1250; }
.kh-drop:hover .kh-menu, .kh-drop:focus-within .kh-menu { display: block; }
.kh-menu a, .kh-menu button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px 18px; color: var(--kc-ink); font-size: 14px; text-decoration: none; background: none; border: 0; text-align: left; cursor: pointer; }
.kh-menu a:hover, .kh-menu button:hover { background: #f4f5ff; text-decoration: none; color: var(--kc-ink); }
.kh-menu i { width: 18px; text-align: center; color: var(--kc-navy); }
.kh-menu hr { margin: 6px 0; border-color: var(--kc-line); }
.kh-cta { display: block !important; text-align: center; background: var(--kc-blue) !important; color: #fff !important; font-weight: 700; border-radius: 10px; margin: 4px 14px 8px; width: auto !important; padding: 11px 14px !important; justify-content: center; }
.kh-cta:hover { background: var(--kc-navy) !important; }
.kh-cart-slot { margin-left: 2px; }

/* barre de navigation */
.kh-nav { background: #fff; border-bottom: 1px solid var(--kc-line); }
.kh-nav .container { display: flex; align-items: stretch; gap: 4px; min-height: 44px; }
.kh-all-cats { position: relative; flex: none; }
.kh-all-cats > button { white-space: nowrap; flex: none; height: 100%; display: flex; align-items: center; gap: 10px; background: var(--kc-blue); color: #fff; border: 0; padding: 0 18px; font-weight: 700; font-size: 14px; border-radius: 0; cursor: pointer; }
.kh-all-cats:hover > button, .kh-all-cats:focus-within > button { background: var(--kc-navy); }
.kh-mega { display: none; position: absolute; left: 0; top: 100%; background: #fff; box-shadow: 0 14px 40px rgba(0,0,0,.2); z-index: 1240; width: 300px; border-radius: 0 0 12px 12px; }
.kh-all-cats:hover .kh-mega, .kh-all-cats:focus-within .kh-mega { display: block; }
.kh-mega > ul { list-style: none; margin: 0; padding: 6px 0; }
.kh-mega > ul > li { position: static; }
.kh-mega > ul > li > a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 18px; color: var(--kc-ink); font-size: 14px; text-decoration: none; }
.kh-mega > ul > li:hover > a { background: #f4f5ff; color: var(--kc-blue); }
.kh-mega > ul > li > a img { width: 20px; height: 20px; object-fit: contain; }
.kh-mega > ul > li > a span { display: flex; align-items: center; gap: 10px; }
.kh-sub { display: none; position: absolute; left: 100%; top: 0; width: 620px; min-height: 100%; background: #fff; padding: 18px 22px; box-shadow: 14px 14px 40px rgba(0,0,0,.14); border-radius: 0 12px 12px 0; columns: 3; column-gap: 24px; }
.kh-mega > ul > li:hover > .kh-sub { display: block; }
.kh-sub div { break-inside: avoid; margin-bottom: 14px; }
.kh-sub b a { color: var(--kc-navy); font-size: 14px; text-decoration: none; }
.kh-sub b a:hover { color: var(--kc-blue); }
.kh-sub ul { list-style: none; margin: 4px 0 0; padding: 0; }
.kh-sub li a { color: var(--kc-muted); font-size: 13px; text-decoration: none; line-height: 1.9; }
.kh-sub li a:hover { color: var(--kc-blue); text-decoration: underline; }
.kh-links { display: flex; align-items: center; gap: 2px; overflow: hidden; flex: 1 1 auto; }
.kh-links a { color: var(--kc-ink); font-size: 13px; font-weight: 600; text-decoration: none; padding: 0 12px; display: flex; align-items: center; height: 44px; white-space: nowrap; }
.kh-links a:hover { color: var(--kc-blue); text-decoration: none; background: #f8f8ff; }
.kh-links a.hot { color: #BE1E3C; }
.kh-wa { margin-left: auto; display: flex; align-items: center; gap: 8px; color: #128c4a; font-weight: 700; font-size: 13px; text-decoration: none; padding: 0 6px; white-space: nowrap; }
.kh-wa:hover { text-decoration: none; color: #0b6b37; }

/* recherche mobile : barre sous le logo */
.kh-search-m { display: none; background: #fff; padding: 0 12px 10px; }
.kh-search-m button { width: 100%; display: flex; align-items: center; gap: 10px; border: 2px solid var(--kc-blue); border-radius: 10px; background: #fff; color: var(--kc-muted); padding: 10px 14px; font-size: 14px; text-align: left; }

@media (max-width: 991.98px) {
    .kh-top-links .kh-hide-m, .kh-nav, .kh-help, .kh-wa { display: none !important; }
    .kh-burger { display: block; }
    .kh-main .container { gap: 6px; }
    .kh-logo img { height: 40px; }
    .kh-search { display: none; }
    .kh-search-m { display: block; }
    .kh-drop > a span.lbl, .kh-drop > button span.lbl { display: none; }
    .kh-promo { font-size: 11px; }
}

/* ============================ SECTIONS ============================ */
.kc-section { --bg: var(--kc-blue); --fg: #fff; background: var(--bg); color: var(--fg); border-radius: 16px; padding: 16px 18px 18px; margin: 0 0 18px; }
.kc-section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.kc-section__titles { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.kc-section__titles h2 { margin: 0; font-size: 24px; font-weight: 800; color: var(--fg); letter-spacing: -.3px; line-height: 1.15; }
.kc-section__titles p { margin: 0; width: 100%; font-size: 13px; opacity: .85; color: var(--fg); }
.kc-countdown { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--bg); font-weight: 700; font-size: 13px; border-radius: 8px; padding: 4px 10px; white-space: nowrap; }
.kc-more { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--kc-ink); font-weight: 600; font-size: 14px; border-radius: 99px; padding: 9px 20px; text-decoration: none; white-space: nowrap; transition: transform .15s; }
.kc-more:hover { transform: translateX(2px); color: var(--kc-blue); text-decoration: none; }

.kc-rail-wrap { position: relative; }
.kc-rail { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -ms-overflow-style: none; padding: 2px; scroll-behavior: smooth; }
.kc-rail::-webkit-scrollbar { display: none; }
.kc-grid .kc-rail { flex-wrap: wrap; overflow: visible; }
.kc-arrow { position: absolute; top: 40%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--kc-ink); border: 1px solid #ddd; box-shadow: 0 3px 12px rgba(0,0,0,.2); z-index: 5; display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.kc-arrow:hover { background: var(--kc-blue); color: #fff; border-color: var(--kc-blue); }
.kc-arrow--prev { left: -14px; }
.kc-arrow--next { right: -14px; }
.kc-arrow[hidden] { display: none; }
.kc-grid .kc-arrow { display: none; }

.kc-card { position: relative; background: #fff; color: var(--kc-ink); border-radius: 12px; overflow: hidden; flex: 0 0 calc((100% - 50px) / 6); min-width: 150px; scroll-snap-align: start; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.kc-card:hover { box-shadow: 0 8px 22px rgba(0,0,0,.2); transform: translateY(-2px); }
.kc-grid .kc-card { flex: 0 0 calc((100% - 50px) / 6); }
.kc-card__img { position: relative; display: block; aspect-ratio: 1 / 1; background: #f4f4f4; }
.kc-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kc-add { position: absolute; top: 8px; right: 8px; width: 38px; height: 38px; border-radius: 50%; background: #2b2b2b; color: #fff; border: 0; font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; text-decoration: none; transition: background .15s, transform .15s; }
.kc-add:hover { background: var(--kc-blue); color: #fff; transform: scale(1.08); text-decoration: none; }
.kc-add[disabled] { opacity: .5; cursor: wait; }
.kc-tag { position: absolute; left: 8px; top: 8px; background: #BE1E3C; color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; letter-spacing: .4px; }
.kc-stock { background: #fff4d6; color: #b36a00; font-size: 12px; text-align: center; padding: 3px 6px; font-weight: 600; }
.kc-stock.low { background: #ffe5e5; color: #c0262d; }
.kc-card__body { padding: 9px 10px 11px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.kc-card__title { font-size: 14px; line-height: 1.3; color: #444; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; text-decoration: none; }
.kc-card__title:hover { color: var(--kc-blue); text-decoration: none; }
.kc-stars { font-size: 12px; color: #f68b1e; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.kc-stars small { color: var(--kc-muted); }
.kc-price { font-size: 17px; font-weight: 800; color: var(--kc-ink); margin-top: auto; padding-top: 4px; }
.kc-old { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.kc-old s { color: var(--kc-muted); font-size: 12px; }
.kc-off { background: var(--kc-green); color: #fff; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 5px; }

@media (max-width: 1199.98px) { .kc-card, .kc-grid .kc-card { flex-basis: calc((100% - 30px) / 4); } }
@media (max-width: 767.98px) {
    .kc-section { border-radius: 12px; padding: 12px 10px 14px; margin-left: -4px; margin-right: -4px; }
    .kc-section__titles h2 { font-size: 18px; }
    .kc-more { padding: 7px 14px; font-size: 13px; }
    .kc-card, .kc-grid .kc-card { flex-basis: 44%; min-width: 0; }
    .kc-arrow { display: none; }
    .kc-card__title { font-size: 13px; }
    .kc-price { font-size: 15px; }
}

/* Chargement : les cartes ne sautent pas */
.kc-card__img img.lazy { background: #eee; }

/* ===================== Corrections d'alignement / compacité (v2) ===================== */
.kh-search form { margin: 0 !important; height: 46px; border: 0; background: #f1f1f3; border-radius: 999px; overflow: hidden; align-items: stretch; }
.kh-search form:focus-within { box-shadow: 0 0 0 2px var(--kc-blue); background: #fff; }
.kh-search .kh-cat, .kh-search input[type=search], .kh-search .kh-go { height: 46px !important; margin: 0 !important; box-shadow: none !important; line-height: normal; }
.kh-search .kh-cat { background: transparent; border: 0; border-right: 1px solid #dcdce2; border-radius: 0; max-width: 150px; padding: 0 14px 0 18px; font-size: 13px; color: #444; }
.kh-search input[type=search] { padding: 0 14px; border-radius: 0; }
.kh-search .kh-go { border-radius: 999px; margin: 4px !important; height: 38px !important; padding: 0 22px; }
.kh-search { height: 46px; align-self: center; }
.kh-main .container { padding-top: 8px; padding-bottom: 8px; min-height: 0; }
.kh-logo img { height: 46px; }
.kh-actions { height: auto; }
.kh-drop > button.kh-btn { padding: 8px 10px; }
.kh-cart-slot { display: flex; align-items: center; padding: 0 6px 0 2px; }
.kh-cart-slot .dropdown { margin: 0 !important; }
.kh-cart-slot .dropdown-toggle::after, .kh-cart-slot .dropdown-arrow::after { display: none !important; }
.kh-cart-slot .cart-dropdown .dropdown-toggle { padding: 0 !important; }
.kh-nav .container { min-height: 40px; }
.kh-links a { height: 40px; }
.kh-all-cats > button { height: 40px; }
main.main { padding-top: 14px; }
.kc-old { min-height: 0; }
.kc-old:empty { display: none; }
.kc-section { margin-bottom: 16px; padding: 14px 16px 16px; }
.kc-card__body { padding: 8px 10px 10px; }
.kc-card__title { min-height: 34px; }
.hover-section.container { margin-bottom: 12px !important; }
.hover-section .section-title { margin: 6px 0 !important; }
@media (max-width: 991.98px) { .kh-search-m button { border: 0; background: #f1f1f3; border-radius: 999px; } main.main { padding-top: 8px; } }

.kh-links { min-width: 0; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.kh-wa { flex: none; }

/* Recherche plein écran mobile : doit passer au-dessus de l'en-tête fixe */
#modalSearch { z-index: 2000; }
.modal-backdrop { z-index: 1990; }
