/* Header de las páginas públicas (php/header.php)
   Clases nuevas (.kd-header, .kd-hd-*) para no heredar las reglas de #cabecera / #navbar / #menu_bar de k.css. */

.kd-header,
.kd-hd-menu {
    --kd-hd-negro: #15171c;
    --kd-hd-negro-2: #1f2229;
    --kd-hd-linea: rgba(255, 255, 255, .1);
    --kd-hd-naranja: #f07b1d;
    --kd-hd-naranja-hover: #d96a10;
    --kd-hd-gris: #a7adb8;
    font-family: 'Poppins', Arial, sans-serif;
}

.kd-header *,
.kd-hd-menu * {
    box-sizing: border-box;
}

.kd-header {
    position: -webkit-sticky;
    position: sticky;
    top: -35px; /* la franja superior (34px + borde) se va con el scroll y queda fija la barra */
    z-index: 950; /* arriba de .img_new (900) y debajo de los modales de las páginas (1000) */
    width: 100%;
    background: var(--kd-hd-negro);
    color: #fff;
    text-align: left;
}

.kd-header a,
.kd-hd-menu a {
    text-decoration: none;
}

.kd-hd-wrap {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Franja superior (solo desktop) ---------- */
.kd-hd-top {
    border-bottom: 1px solid var(--kd-hd-linea);
    background: #0f1115;
    color: var(--kd-hd-gris);
    font-size: 13px;
}

.kd-hd-top .kd-hd-wrap {
    justify-content: space-between;
    height: 34px;
}

.kd-hd-top strong {
    color: #fff;
    font-weight: 600;
}

.kd-hd-redes {
    display: inline-flex;
    gap: 14px;
}

.kd-hd-redes a {
    color: var(--kd-hd-gris);
    font-size: 16px;
    transition: color .2s ease;
}

.kd-hd-redes a:hover {
    color: var(--kd-hd-naranja);
}

/* ---------- Barra principal ---------- */
.kd-hd-bar .kd-hd-wrap {
    gap: 24px;
    height: 78px;
}

.kd-hd-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #fff;
    font-family: inherit;
    font-size: 22px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.kd-hd-btn:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.kd-hd-abrir-menu,
.kd-hd-lupa,
.kd-hd-carrito-movil {
    display: none;
}

.kd-hd-hamburguesa {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 24px;
}

.kd-hd-hamburguesa span {
    display: block;
    height: 2.5px;
    border-radius: 2px;
    background: #fff;
}

/* Logo */
.kd-hd-logo {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    color: #fff;
    line-height: 1;
}

.kd-hd-marca {
    color: #fff;
    font-size: 34px;
    font-style: italic;
    font-weight: 800;
    letter-spacing: 1px;
}

.kd-hd-marca span {
    color: var(--kd-hd-naranja);
}

.kd-hd-lema {
    margin-top: 4px;
    color: #e6e8ec;
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Buscador */
.kd-hd-buscar {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    max-width: 560px;
    margin: 0 auto;
}

.kd-hd-buscar .fa {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: #7c838f;
    font-size: 16px;
    pointer-events: none;
}

.kd-header .kd-hd-buscar input[type="search"] {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 46px;
    margin: 0;
    padding: 0 12px 0 44px;
    border: 1px solid transparent;
    border-radius: 23px 0 0 23px;
    background: #fff;
    color: #1f2a44;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.kd-header .kd-hd-buscar input[type="search"]:focus {
    border-color: var(--kd-hd-naranja);
}

.kd-hd-buscar button {
    flex: 0 0 auto;
    height: 46px;
    margin: 0;
    padding: 0 22px;
    border: 0;
    border-radius: 0 23px 23px 0;
    background: var(--kd-hd-naranja);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease;
}

.kd-hd-buscar button:hover {
    background: var(--kd-hd-naranja-hover);
}

/* Acciones (usuario + carritos) */
.kd-hd-acciones {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.kd-hd-usuario {
    position: relative;
}

.kd-hd-usuario-btn {
    gap: 10px;
    padding: 0 10px;
    font-size: 20px;
}

.kd-hd-usuario-txt {
    display: flex;
    flex-direction: column;
    max-width: 150px;
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kd-hd-usuario-txt small {
    color: var(--kd-hd-gris);
    font-size: 11px;
    font-weight: 400;
}

.kd-hd-caret {
    font-size: 16px;
    transition: transform .2s ease;
}

.kd-hd-usuario.kd-hd-abierto .kd-hd-caret {
    transform: rotate(180deg);
}

.kd-hd-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 10;
    display: none;
    min-width: 230px;
    padding: 8px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .25);
}

.kd-hd-usuario.kd-hd-abierto .kd-hd-dropdown {
    display: block;
}

.kd-hd-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #1f2a44;
    font-size: 14px;
    font-weight: 500;
}

.kd-hd-dropdown a:hover {
    background: #f3f4f7;
    color: #1f2a44;
}

.kd-hd-dropdown .fa {
    width: 18px;
    color: var(--kd-hd-naranja);
    text-align: center;
}

.kd-hd-dropdown .kd-hd-salir {
    margin-top: 4px;
    border-top: 1px solid #eceef2;
    border-radius: 0 0 8px 8px;
}

.kd-hd-dd-monto {
    margin-left: auto;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
}

/* Carritos de desktop */
.kd-hd-carrito {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--kd-hd-linea);
    border-radius: 12px;
    background: var(--kd-hd-negro-2);
    color: #fff;
    transition: border-color .2s ease;
}

.kd-hd-carrito:hover {
    border-color: var(--kd-hd-naranja);
    color: #fff;
}

.kd-hd-carrito .fa {
    color: var(--kd-hd-naranja);
    font-size: 20px;
}

.kd-hd-carrito-txt {
    display: flex;
    flex-direction: column;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}

.kd-hd-carrito-txt small {
    color: var(--kd-hd-gris);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .8px;
    text-transform: uppercase;
}

/* Badge del carrito de celular */
.kd-hd-badge {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--kd-hd-naranja);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

/* ---------- Menú lateral ---------- */
html.kd-hd-sin-scroll,
html.kd-hd-sin-scroll body {
    overflow: hidden;
}

.kd-hd-menu {
    position: fixed;
    inset: 0;
    z-index: 3000;
    visibility: hidden;
    transition: visibility 0s linear .3s;
}

.kd-hd-menu.kd-hd-abierto {
    visibility: visible;
    transition: none;
}

.kd-hd-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    transition: opacity .3s ease;
}

.kd-hd-menu.kd-hd-abierto .kd-hd-overlay {
    opacity: 1;
}

.kd-hd-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    width: 86%;
    max-width: 340px;
    overflow-y: auto;
    background: #fff;
    color: #1f2a44;
    text-align: left;
    transform: translateX(-100%);
    transition: transform .3s ease;
    -webkit-overflow-scrolling: touch;
}

.kd-hd-menu.kd-hd-abierto .kd-hd-panel {
    transform: translateX(0);
}

.kd-hd-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--kd-hd-negro);
}

.kd-hd-panel-head .kd-hd-marca {
    font-size: 26px;
}

.kd-hd-panel-head .kd-hd-lema {
    font-size: 7.5px;
}

.kd-hd-panel-usuario {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #eceef2;
    font-size: 15px;
}

.kd-hd-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff1e5;
    color: var(--kd-hd-naranja);
    font-size: 18px;
}

.kd-hd-menu .kd-hd-ingresar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    border-radius: 10px;
    background: var(--kd-hd-naranja);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.kd-hd-links,
.kd-hd-cats,
.kd-hd-sub {
    margin: 0;
    padding: 0;
    list-style: none;
}

.kd-hd-links {
    padding: 6px 0;
    border-bottom: 1px solid #eceef2;
}

.kd-hd-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: #1f2a44;
    font-size: 15px;
    font-weight: 500;
}

.kd-hd-links a:hover {
    background: #f6f7f9;
    color: #1f2a44;
}

.kd-hd-links .fa {
    width: 20px;
    color: var(--kd-hd-naranja);
    font-size: 17px;
    text-align: center;
}

.kd-hd-titulo {
    display: block;
    padding: 16px 16px 6px 16px;
    color: #8a909c;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

/* Categorías (mismas paletas que el sidebar: 9 rosa, 10 verde agua, resto azul) */
.kd-hd-cat {
    --kd-hd-acento: #1664d8;
    --kd-hd-fondo: #e9f1fd;
}

.kd-hd-cat.kd-tema-damas {
    --kd-hd-acento: #d42a4e;
    --kd-hd-fondo: #fdebf0;
}

.kd-hd-cat.kd-tema-chicos {
    --kd-hd-acento: #1d8c97;
    --kd-hd-fondo: #e4f4f4;
}

.kd-hd-cat-fila {
    display: flex;
    align-items: center;
}

.kd-hd-cat-fila > a {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    gap: 12px;
    min-width: 0;
    padding: 9px 16px;
    color: #1f2a44;
    font-size: 15px;
    font-weight: 500;
}

.kd-hd-cat-fila > a:hover {
    background: var(--kd-hd-fondo);
    color: var(--kd-hd-acento);
}

.kd-hd-cat-fila img {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
}

.kd-hd-cat-toggle {
    flex: 0 0 48px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6b7280;
    font-size: 20px;
    cursor: pointer;
}

.kd-hd-cat-toggle .fa {
    transition: transform .2s ease;
}

.kd-hd-cat.kd-hd-abierto .kd-hd-cat-toggle .fa {
    transform: rotate(180deg);
}

.kd-hd-sub {
    display: none;
    margin: 0 16px 6px 54px;
    border-left: 2px solid var(--kd-hd-fondo);
}

.kd-hd-cat.kd-hd-abierto .kd-hd-sub {
    display: block;
}

.kd-hd-sub a {
    display: block;
    padding: 7px 12px;
    color: #4b5563;
    font-size: 14px;
}

.kd-hd-sub a:hover {
    color: var(--kd-hd-acento);
}

.kd-hd-panel-pie {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid #eceef2;
}

.kd-hd-panel-pie .kd-hd-salir {
    color: #c0392b;
    font-size: 15px;
    font-weight: 600;
}

.kd-hd-panel-pie .kd-hd-redes a {
    color: #6b7280;
    font-size: 20px;
}

/* Botón flotante de WhatsApp */
.kd-hd-whatsapp {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #4dc247;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
    color: #fff;
    font-size: 34px;
    text-decoration: none; /* sin esto se subrayan los espacios alrededor del ícono (línea blanca) */
}

.kd-hd-whatsapp:hover,
.kd-hd-whatsapp:focus {
    color: #fff;
    text-decoration: none;
}

/* El sidebar (sidebar.css) es sticky con top: 10px: se baja para que no quede debajo de la barra */
body #cuerpo #row #izquierda .kd-sidebar {
    top: 90px;
    max-height: calc(100vh - 100px);
}

/* ---------- Tablet / celular (el sidebar se oculta en ≤1100px) ---------- */
@media screen and (max-width: 1100px) {
    .kd-header {
        top: 0;
    }

    .kd-hd-top,
    .kd-hd-carrito,
    .kd-hd-usuario-txt,
    .kd-hd-caret {
        display: none;
    }

    .kd-hd-abrir-menu,
    .kd-hd-lupa,
    .kd-hd-carrito-movil {
        display: inline-flex;
    }

    .kd-hd-bar .kd-hd-wrap {
        position: relative;
        flex-wrap: wrap;
        gap: 0;
        height: auto;
        min-height: 68px;
        padding: 0 8px;
    }

    .kd-hd-usuario-btn {
        padding: 0;
    }

    /* Logo centrado entre la hamburguesa y los íconos */
    .kd-hd-bar .kd-hd-logo {
        position: absolute;
        top: 34px;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .kd-hd-bar .kd-hd-marca {
        font-size: 28px;
    }

    .kd-hd-bar .kd-hd-lema {
        font-size: 8px;
    }

    .kd-hd-acciones {
        gap: 0;
        height: 68px;
        margin-left: auto;
    }

    /* El buscador se despliega con la lupa, en una fila completa debajo */
    .kd-hd-buscar {
        display: none;
        order: 10;
        flex: 1 1 100%;
        max-width: none;
        margin: 0 4px 12px 4px;
    }

    .kd-header.kd-hd-buscando .kd-hd-buscar {
        display: flex;
    }

    .kd-header .kd-hd-buscar input[type="search"],
    .kd-hd-buscar button {
        height: 42px;
    }

    .kd-hd-dropdown {
        position: fixed;
        top: 64px;
        right: 8px;
    }
}

@media screen and (max-width: 420px) {
    .kd-hd-bar .kd-hd-marca {
        font-size: 23px;
    }

    .kd-hd-bar .kd-hd-lema {
        font-size: 6.5px;
        letter-spacing: 1.2px;
    }

    .kd-hd-btn {
        min-width: 38px;
        font-size: 20px;
    }
}
