/* ---------------------------------------------------------------------------
 * Header: logo · search · account & basket, with the menu on a second row
 * ------------------------------------------------------------------------- */
.kp-header { padding: 0 !important; background: var(--white); }
.kp-header-container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 15px; }
.kp-header .kp-header-main {
    display: flex;
    align-items: center;
    gap: 40px;
    min-height: 84px;
}
.kp-header .header-left { flex: 0 0 auto; }
.kp-header .box-open-menu-mobile { flex: 0 0 auto; }
.kp-header-logo { display: inline-flex; align-items: center; }
.kp-header-logo img { display: block; height: 44px; width: auto; max-width: 200px; object-fit: contain; }

.kp-header-search { flex: 1 1 auto; max-width: 680px; margin: 0 auto; }
.kp-header .header-right { flex: 0 0 auto; margin-left: auto; }

.kp-header-nav { position: relative; border-top: 1px solid var(--line); }
.kp-header-nav .box-navigation { display: flex; justify-content: center; }
.kp-header-nav .box-nav-menu { gap: 36px; }
.kp-header-nav .box-nav-menu > .menu-item > .item-link {
    position: relative;
    padding-top: 15px;
    padding-bottom: 15px;
    font-weight: 500;
}

/* ---------------------------------------------------------------------------
 * Shop mega menu: category rail on the left, the hovered category's panel right
 * ------------------------------------------------------------------------- */
.box-navigation .menu-item.kp-mega-item { position: static !important; }
.kp-mega {
    position: absolute;
    top: 100%;
    left: 50%;
    z-index: 1001;
    width: min(1410px, calc(100vw - 30px));
    background: var(--white);
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 24px 48px rgba(16, 16, 16, .12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
/* The short delay stops the menu flashing open when the pointer only passes over Shop. */
.kp-mega-item:hover > .kp-mega,
.kp-mega-item:focus-within > .kp-mega {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
    transition: opacity .16s ease .08s, transform .16s ease .08s, visibility 0s linear .08s;
}
.kp-mega-item.is-dismissed > .kp-mega { opacity: 0; visibility: hidden; pointer-events: none; }
.kp-mega a:focus-visible,
.kp-mega button:focus-visible { outline: 2px solid var(--bg-3, #2C2762); outline-offset: 2px; }

.kp-mega-inner { display: flex; max-height: min(680px, calc(100vh - 160px)); }
.kp-mega-rail {
    flex: 0 0 310px;
    list-style: none;
    margin: 0;
    padding: 12px;
    border-right: 1px solid var(--line);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.kp-mega-rail-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 10px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
}
.kp-mega-rail-link:hover,
.kp-mega-rail-link.is-active { background: var(--bg-2); color: var(--text); }
.kp-mega-rail-link.is-active .kp-mega-rail-name { color: var(--primary); }
.kp-mega-rail-link > .icon { font-size: 12px; color: var(--text-3); transition: transform .2s ease, color .2s ease; }
.kp-mega-rail-link.is-active > .icon { color: var(--primary); transform: translateX(2px); }
.kp-mega-rail-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.kp-mega-rail-name { font-size: 15px; font-weight: 600; }
.kp-mega-rail-text small {
    font-size: 12.5px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kp-mega-rail-divider { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.kp-mega-shop-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--bg-3, #2C2762);
    color: var(--white);
    font-weight: 600;
}
.kp-mega-shop-all:hover { background: var(--text); color: var(--white); }

.kp-mega-thumb {
    position: relative;
    flex: 0 0 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    background: var(--surface, #F6F6F6);
    color: var(--bg-3, #2C2762);
    font-size: 13px;
    font-weight: 700;
}
/* The image sits over the initials so a missing file falls back to them. */
.kp-mega-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--surface, #F6F6F6); mix-blend-mode: multiply; }
.kp-mega-thumb .icon { font-size: 18px; }
.kp-mega-thumb-sm { flex-basis: 34px; height: 34px; border-radius: 8px; font-size: 12px; }

.kp-mega-panels { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 32px 30px; }
.kp-mega-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.kp-mega-panel-head h3 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.2; }
.kp-mega-view-all { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.kp-mega-view-all:hover { color: var(--text); }
.kp-mega-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 28px; align-items: start; }
.kp-mega-group-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 -8px;
    padding: 7px 8px;
    border-radius: 10px;
    font-weight: 600;
    color: var(--text);
}
.kp-mega-group-title:hover { background: var(--bg-2); color: var(--primary); }
.kp-mega-links { list-style: none; margin: 0 0 8px 46px; padding: 0; }
.kp-mega-links a { display: block; padding: 4px 0; font-size: 14px; color: var(--text-2); }
.kp-mega-links a:hover { color: var(--primary); }
.kp-mega-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 8px 46px;
    padding: 2px 0;
    border: 0;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
}
.kp-mega-brands { list-style: none; margin: 0; padding: 0; columns: 4 170px; column-gap: 28px; }
.kp-mega-brands li { break-inside: avoid; }
.kp-mega-brands a { display: block; padding: 5px 0; color: var(--text-2); }
.kp-mega-brands a:hover { color: var(--primary); }
.kp-mega-empty { margin: 0; color: var(--text-2); }

/* Account and basket: 44px tap targets, labelled on wide screens */
.tf-header .nav-icon { list-style: none; margin: 0; padding: 0; gap: 4px; }
.tf-header .nav-icon-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--text);
    transition: background-color .2s ease;
}
.tf-header .nav-icon-link:hover,
.tf-header .nav-icon-link:focus-visible { background-color: var(--surface); }
.tf-header .nav-icon-link .icon { font-size: 26px; line-height: 1; }
.kp-header-action-icon { position: relative; display: inline-flex; }
.tf-header .nav-icon-link .count-box {
    position: absolute;
    top: -7px;
    right: -11px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 2px solid var(--white);
    box-sizing: content-box;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: var(--white);
    background-color: var(--primary);
}
.kp-header-action-text { display: none; }
.tf-header .nav-icon-link .count-box.is-empty { display: none; }

@media (min-width: 1200px) {
    .kp-header-actions { gap: 8px; }
    .tf-header .kp-header-action {
        width: auto;
        gap: 14px;
        padding: 0 14px 0 10px;
        border-radius: 12px;
    }
    .kp-header-action-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
    .kp-header-action-text small { font-size: 12px; color: var(--text-2); white-space: nowrap; }
    .kp-header-action-text strong { font-size: 15px; font-weight: 600; white-space: nowrap; }
}

@media (max-width: 1199px) {
    .kp-header .kp-header-main { gap: 16px; min-height: 72px; }
    .kp-header-logo img { height: 38px; }
}
@media (max-width: 767px) {
    .kp-header-container { padding: 0 16px; }
    .kp-header .kp-header-main { min-height: 60px; gap: 8px; }
    .kp-header .box-open-menu-mobile { flex: 1 1 0; }
    .kp-header .header-left { flex: 0 0 auto; }
    .kp-header .header-right { flex: 1 1 0; display: flex; justify-content: flex-end; }
    .kp-header-logo img { height: 32px; max-width: 150px; }
    .tf-header .nav-icon-link { width: 40px; height: 40px; }
    .tf-header .nav-icon-link .icon { font-size: 24px; }
    .kp-header-search-mobile { padding: 0 0 12px; }
}

/* ---------------------------------------------------------------------------
 * Search field
 * ------------------------------------------------------------------------- */
.kp-search { position: relative; width: 100%; }
.kp-search-field {
    display: flex;
    align-items: center;
    height: 50px;
    padding-left: 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #f2f2f4;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.kp-search-field:hover { border-color: var(--line); }
.kp-search.is-open .kp-search-field,
.kp-search-field:focus-within {
    background: var(--white);
    border-color: var(--bg-3, #2C2762);
    box-shadow: 0 0 0 4px rgba(44, 39, 98, .1), 0 8px 24px rgba(16, 16, 16, .06);
}
.kp-search-field input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 0 10px 0 0;
    font-size: 16px;
    color: var(--text);
}
.kp-search-field input::placeholder { color: #7b7f86; }
.kp-search-field input::-webkit-search-cancel-button { display: none; }
.kp-search-clear {
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: var(--text-3);
    padding: 0 10px;
}
.kp-search-clear:hover { color: var(--text); }
.kp-search-submit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 5px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--bg-3, #2C2762);
    color: var(--white);
    transition: transform .15s ease, background .2s ease;
}
.kp-search-submit .icon { font-size: 19px; line-height: 1; }
.kp-search-submit:hover { background: var(--text); }
.kp-search-submit:active { transform: scale(.94); }
.kp-search.is-loading .kp-search-submit .icon { animation: kp-pulse 1s infinite; }
@keyframes kp-pulse { 50% { opacity: .35; } }

.kp-search-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: min(75vh, 620px);
    overflow-y: auto;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(16, 16, 16, .14);
    padding: 12px;
}
@media (min-width: 992px) {
    .kp-header-search .kp-search-panel { min-width: 720px; }
}
.kp-search-columns { display: flex; gap: 12px; }
.kp-search-side { flex: 0 0 38%; border-right: 1px solid var(--line); padding-right: 12px; }
.kp-search-main { flex: 1; min-width: 0; }
@media (max-width: 767px) {
    .kp-search-columns { flex-direction: column; }
    .kp-search-side { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
}
.kp-search-heading {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-2);
    margin: 4px 8px 6px;
}
.kp-search-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
}
.kp-search-option:hover,
.kp-search-option.is-active { background: var(--bg-2); color: var(--text); }
.kp-search-option mark { background: transparent; color: inherit; font-weight: 700; padding: 0; }
.kp-search-term { justify-content: space-between; }
.kp-search-term small { color: var(--text-2); }
.kp-search-term .icon { color: var(--text-3); }
.kp-search-meta { white-space: nowrap; font-size: 12px; }
.kp-search-thumb {
    flex: 0 0 52px;
    height: 52px;
    border-radius: 8px;
    background: var(--bg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kp-search-thumb img { width: 100%; height: 100%; object-fit: contain; }
.kp-search-product-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kp-search-product-name { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.kp-search-product-text small { color: var(--text-2); }
.kp-search-price { font-weight: 600; white-space: nowrap; }
.kp-search-price.is-sale { color: var(--primary); }
.kp-search-product-row { display: flex; align-items: center; gap: 8px; }
.kp-search-product-row .kp-search-option { flex: 1; min-width: 0; }
.kp-search-add {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 76px;
    padding: 8px 14px;
    border: 1px solid var(--text);
    border-radius: 999px;
    background: var(--text);
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    transition: background .2s, color .2s, border-color .2s;
}
.kp-search-add:hover { background: var(--white); color: var(--text); }
.kp-search-add.is-secondary { background: var(--white); color: var(--text); border-color: var(--line); }
.kp-search-add.is-secondary:hover { border-color: var(--text); }
.kp-search-add.is-disabled { background: var(--bg-2); color: var(--text-3); border-color: transparent; font-weight: 500; }
@media (max-width: 575px) {
    .kp-search-add { min-width: 0; padding: 8px 10px; }
    .kp-search-add span { display: none; }
}

/* ---------------------------------------------------------------------------
 * Quick add to basket: product cards and search suggestions
 * ------------------------------------------------------------------------- */
.kp-card-add {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    padding: 9px 12px;
    border: 1px solid var(--text);
    border-radius: 999px;
    background: var(--text);
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}
.kp-card-add.is-secondary { background: var(--white); color: var(--text); border-color: var(--line); }
[data-kp-quick-add].is-loading { opacity: .6; pointer-events: none; cursor: progress; }

/* Once the product is in the basket the add button becomes a − qty + stepper */
.kp-qty-add.is-in-cart [data-kp-quick-add] { display: none; }
.kp-qty-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--text);
    border-radius: 999px;
    background: var(--white);
    color: var(--text);
    overflow: hidden;
}
.kp-qty-stepper button {
    flex: 0 0 40px;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: none;
    color: inherit;
    font-size: 12px;
    transition: background .2s;
}
.kp-qty-stepper button:hover { background: var(--bg-2); }
.kp-qty-value { flex: 1; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.kp-qty-stepper.is-loading { opacity: .6; pointer-events: none; cursor: progress; }
.kp-card-qty { margin-top: 10px; }
.kp-card-qty .kp-card-add { margin-top: 0; }
.kp-search-qty { flex: 0 0 auto; }
.kp-search-qty .kp-qty-stepper { width: 104px; min-height: 34px; }
.kp-search-qty .kp-qty-stepper button { flex-basis: 32px; }
/* Keep the stepper on screen on desktop cards instead of only on hover */
.card-product:has(.kp-qty-add.is-in-cart) .product-action_bot { transform: none; opacity: 1; visibility: visible; }
.kp-search-all {
    display: block;
    margin-top: 8px;
    padding: 12px;
    border-radius: 10px;
    background: var(--bg-2);
    text-align: center;
    font-weight: 600;
    color: var(--text);
}
.kp-search-all:hover,
.kp-search-all.is-active { background: var(--text); color: var(--white); }
.kp-search-correction { margin: 4px 8px 10px; color: var(--text-2); }
.kp-search-empty { padding: 16px; color: var(--text-2); }

/* ---------------------------------------------------------------------------
 * Shop listing: facets, chips, empty state
 * ------------------------------------------------------------------------- */
.kp-correction { color: var(--text-2); }
.kp-facets { display: flex; flex-direction: column; }
.kp-facet { border-bottom: 1px solid var(--line); padding: 14px 0; }
.kp-facet:first-child { padding-top: 0; }
.kp-facet-title {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    border: 0;
    background: none;
    padding: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}
.kp-facet-title .icon,
.kp-facet-expand .icon { transition: transform .2s; }
.kp-facet-title.collapsed .icon,
.kp-facet-expand.collapsed .icon { transform: rotate(-90deg); }
.kp-facet .collapse > :first-child { margin-top: 12px; }
.kp-facet-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.kp-facet-children { padding-left: 26px; margin-top: 2px; }
.kp-facet-row { display: flex; align-items: center; gap: 4px; }
.kp-facet-row .kp-check { flex: 1; }
.kp-facet-expand { border: 0; background: none; padding: 4px 6px; color: var(--text-2); }
.kp-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 4px;
    border-radius: 8px;
    cursor: pointer;
    margin: 0;
}
.kp-check:hover { background: var(--bg-2); }
.kp-check-label { flex: 1; line-height: 1.3; }
.kp-check input:checked ~ .kp-check-label { font-weight: 600; }
.kp-check input:disabled ~ .kp-check-label { color: var(--text-3); }
.kp-count {
    min-width: 28px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--bg-2);
    color: var(--text-2);
    font-size: 12px;
    text-align: center;
}
.kp-facet-extra { display: none !important; }
.kp-facet-expanded .kp-facet-extra,
.kp-facet-searching .kp-facet-extra { display: block !important; }
.kp-facet-hidden { display: none !important; }
.kp-facet-more { border: 0; background: none; padding: 6px 4px 0; font-weight: 600; color: var(--text); text-decoration: underline; }
.kp-facet-search {
    width: 100%;
    height: 38px;
    margin-bottom: 8px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.kp-price-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.kp-price-inputs { display: flex; align-items: center; gap: 8px; }
.kp-price-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0;
}
.kp-price-field input { width: 100%; border: 0; outline: 0; padding: 0; background: transparent; }
.kp-price-go {
    height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: var(--text);
    color: var(--white);
    font-weight: 600;
}
.kp-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    color: var(--text);
    font-size: 14px;
    text-decoration: none;
}
.kp-pill:hover { border-color: var(--text); color: var(--text); }
.kp-pill.active { background: var(--text); border-color: var(--text); color: var(--white); }

.kp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.kp-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 14px;
    border: 1px solid var(--text);
    border-radius: 999px;
    background: var(--white);
    font-size: 14px;
}
.kp-chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-2);
    font-size: 15px;
    line-height: 1;
}
.kp-chip:hover .kp-chip-x { background: var(--text); color: var(--white); }
.kp-chip-clear,
.kp-link { border: 0; background: none; padding: 0 6px; font-weight: 600; text-decoration: underline; color: var(--text); }

.kp-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--text);
    color: var(--white);
    font-size: 12px;
}
.kp-filter-footer { padding: 12px 20px 20px; border-top: 1px solid var(--line); background: var(--white); }

#gridLayout { transition: opacity .15s; }
#gridLayout.kp-loading { opacity: .45; pointer-events: none; }

.kp-no-results { grid-column: 1 / -1; text-align: center; padding: 48px 16px; }
.kp-no-results > .icon { display: block; font-size: 44px; color: var(--text-3); margin-bottom: 12px; }
.kp-no-results-tips { list-style: none; padding: 0; margin: 12px auto 24px; max-width: 520px; color: var(--text-2); }
.kp-no-results-tips li { margin-bottom: 4px; }

/* Product grid: 2 columns on phones (the theme's fixed 3-column grid overflowed small screens). */
.kp-shop .tf-grid-layout.tf-col-2,
.kp-shop .tf-grid-layout.tf-col-3,
.kp-shop .tf-grid-layout.tf-col-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) {
    .kp-shop .tf-grid-layout.tf-col-3,
    .kp-shop .tf-grid-layout.tf-col-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
    .kp-shop .tf-grid-layout.tf-col-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.kp-price-go { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
@media (max-width: 575px) {
    .kp-search-field { height: 46px; padding-left: 18px; }
    .kp-search-submit { width: 36px; height: 36px; }
}

/* The theme styles every text input; the search field draws its own frame. */
.kp-search .kp-search-field input[type="search"] {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    height: 100% !important;
    padding: 0 10px 0 0 !important;
}
