﻿/* ── Variables del diseño ── */
.ch-site-header {
    --ch-cream: #F8F6F3;
    --ch-sand: #EDE9E2;
    --ch-black: #111;
    --ch-mid: rgba(17,17,17,.45);
    --ch-red: #B91C1C;
    --ch-f: 'Plus Jakarta Sans', sans-serif;
}

/* ── SAM BAR ── */
.ch-sam-bar {
    background-color: #0d0d0d;
    padding: 6px 16px;
    font-family: var(--ch-f);
}

.ch-sam-link {
    color: rgba(248,246,243,.85);
    text-decoration: none;
    padding: 0 6px;
    transition: color .2s;
}

    .ch-sam-link:hover {
        color: #fff;
    }

.ch-sam-info {
    color: rgba(248,246,243,.65);
    font-size: 11px;
    font-weight: 500;
}



/* ── FILA SUPERIOR ── */
.ch-htop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 52px;
}

/* ── LOGO ── */
.ch-hlogo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.ch-logo-img {
    height: 38px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* ── ACCIONES (iconos) ── */
.ch-hacts {
    display: flex;
    align-items: center;
    gap: 1px;
}

.ch-hbtn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--ch-black);
    position: relative;
    transition: background .15s, transform .15s;
    text-decoration: none;
}

/* Ocultar el centro en pantallas que no caben */
@media (max-width: 992px) {
    .navbar-band-sam .sam-center-label {
        display: none !important;
    }
}

.ch-hbtn:hover {
    background: rgba(17,17,17,.08);
    transform: scale(1.05);
}

.ch-hbtn svg {
    width: 17px;
    height: 17px;
    stroke: var(--ch-black);
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ch-hbtn-cart {
    position: relative;
}

.ch-ccnt {
    position: absolute;
    top: 3px;
    right: 3px;
    background: var(--ch-red);
    color: #fff;
    font-size: 7px;
    font-weight: 700;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── BÚSQUEDA DESKTOP ── */
.ch-hsearch {
    display: none;
}

.ch-sw {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F0EDE8;
    border-radius: 10px;
    padding: 8px 12px;
}

.ch-si {
    border: none;
    background: none;
    font-size: 13px;
    font-family: var(--ch-f);
    color: var(--ch-black);
    outline: none;
    width: 100%;
    font-weight: 500;
}

    .ch-si::placeholder {
        color: rgba(17,17,17,.35);
    }

/* ── BÚSQUEDA MOBILE (colapsable) ── */
.ch-msearch {
    overflow: hidden;
    max-height: 0;
    transition: max-height .28s ease, padding .28s ease;
    background: var(--ch-cream);
    border-bottom: 1px solid transparent;
}

    .ch-msearch.ch-open {
        max-height: 60px;
        padding: 6px 14px 8px;
        border-bottom-color: rgba(17,17,17,.08);
    }

.ch-msw {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F0EDE8;
    border-radius: 10px;
    padding: 9px 13px;
}

.ch-msi {
    border: none;
    background: none;
    font-size: 14px;
    font-family: var(--ch-f);
    color: var(--ch-black);
    outline: none;
    width: 100%;
    font-weight: 500;
}

    .ch-msi::placeholder {
        color: rgba(17,17,17,.38);
    }

.ch-hbtn-search-mobile {
    display: flex;
}

/* ══════════════════════════════════════════
       DESKTOP (≥768px)
    ══════════════════════════════════════════ */
@media (min-width: 768px) {
    .ch-site-header {
        box-shadow: 0 1px 0 rgba(17,17,17,.08);
    }

    .ch-htop {
        padding: 0 20px;
        height: 70px;
    }

    .ch-logo-img {
        height: 40px;
    }

    .ch-hacts {
        gap: 2px;
    }

    .ch-hbtn {
        width: 40px;
        height: 40px;
    }

        .ch-hbtn svg {
            width: 18px;
            height: 18px;
        }
    /* Búsqueda Desktop */
    .ch-hsearch {
        display: flex;
        align-items: center;
        margin-right: 6px;
    }

    .ch-sw {
        gap: 7px;
        padding: 7px 13px;
        width: 220px;
        transition: box-shadow .2s, background .2s, width .3s;
    }

        .ch-sw:focus-within {
            background: #ECEAE5;
            box-shadow: 0 0 0 2px rgba(17,17,17,.12);
            width: 260px;
        }

    .ch-si {
        font-size: 13px;
        min-width: 0;
    }

    .ch-hbtn-search-mobile {
        display: none;
    }

    .ch-msearch {
        display: none;
    }
}

/* ══════════════════════════════════════════
       HEADER INTELIGENTE (sticky + ocultar al bajar)
       Se queda pegado arriba; al bajar se oculta y al subir reaparece.
       La lógica está en js/header.js
    ══════════════════════════════════════════ */
.navbar.ch-site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    /* Al aparecer: responde de inmediato pero con avance parejo y frenado suave
       (curva estándar de entrada; evita el "golpe" de curvas tipo ease-out-quint). */
    transition: transform .42s cubic-bezier(.25, .8, .25, 1), opacity .5s ease-out, box-shadow .4s ease;
}

    /* Sombra suave cuando ya no estamos hasta arriba */
    .navbar.ch-site-header.ch-hdr-scrolled {
        box-shadow: 0 4px 18px rgba(17,17,17,.08);
    }

    /* Solo se aplica transform al ocultar: un transform permanente rompería
       el position: fixed de los submenús del menú desktop. */
    .navbar.ch-site-header.ch-hdr-hidden {
        transform: translateY(-100%);
        opacity: 0;
        box-shadow: none;
        /* Al ocultarse: se desliza con calma, sin tirón */
        transition: transform .5s cubic-bezier(.4, 0, .2, 1), opacity .5s ease .1s, box-shadow .3s ease;
    }

@media (prefers-reduced-motion: reduce) {
    .navbar.ch-site-header {
        transition: none;
    }
}
