/* =========================================================
   APHAREL — HEADER
   ========================================================= */


/* =========================================================
   1. HEADER PRINCIPAL
========================================================= */

.apharel-header {

    position: relative;

    z-index: 1000;

    width: 100%;

    background: #ffffff;

    border-bottom: 1px solid #eeeeee;

    /* 🔴 CAMBIO
       El contenido general del header utiliza
       Arial/Helvetica. */

    font-family: var(--apharel-font-body);
}


/* =========================================================
   2. CONTENEDOR PRINCIPAL
========================================================= */

.apharel-header-inner {

    width: min(1400px, calc(100% - 80px));

    min-height: 82px;

    margin: 0 auto;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 40px;
}


/* =========================================================
   3. LOGO
========================================================= */

/* 🔴 CAMBIO
   El logo ahora utiliza la imagen real de APHAREL.
   El enlace continúa llevando a la página de inicio. */

.apharel-logo {

    display: inline-flex;

    align-items: center;
    justify-content: flex-start;

    width: 210px;
    height: auto;

    color: #111111;

    text-decoration: none;

    line-height: 0;

    flex-shrink: 0;
}


.apharel-logo img {

    display: block;

    /* 🔴 CAMBIO
       El logo aumenta de 150px a 210px
       para que tenga mayor presencia en el header. */

    width: 210px;

    height: auto;

    max-width: 100%;
}


.apharel-logo:hover {

    color: #111111;
}


/* =========================================================
   4. MENÚ PRINCIPAL
========================================================= */

.apharel-nav {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 38px;

    margin-left: auto;
    margin-right: auto;
}


.apharel-nav a {

    position: relative;

    padding: 8px 0;

    color: #222222;

    font-family: var(--apharel-font-body);

    font-size: 12px;

    font-weight: 500;

    letter-spacing: 1.5px;

    line-height: 1;

    text-decoration: none;

    text-transform: uppercase;

    transition:
        color 0.25s ease,
        opacity 0.25s ease;
}


.apharel-nav a:hover {

    color: #777777;
}


/* Línea debajo del enlace */

.apharel-nav a::after {

    content: "";

    position: absolute;

    left: 0;
    bottom: 0;

    width: 0;
    height: 1px;

    background: #111111;

    transition: width 0.25s ease;
}


.apharel-nav a:hover::after {

    width: 100%;
}


/* =========================================================
   5. ACCIONES DEL HEADER
========================================================= */

.apharel-header-actions {

    display: flex;

    align-items: center;

    gap: 22px;
}


/* =========================================================
   6. BOTÓN DE BÚSQUEDA — LUPA
========================================================= */

.apharel-search-toggle {

    display: flex;

    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    padding: 0;

    border: 0;

    background: transparent;

    color: #111111;

    font-family: var(--apharel-font-body);

    cursor: pointer;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}


.apharel-search-toggle:hover {

    opacity: 0.65;

    transform: translateY(-1px);
}


/* Contenedor de la lupa */

.apharel-search-toggle .apharel-search-icon {

    position: static;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 21px;
    height: 21px;

    color: #111111;

    pointer-events: none;
}


/* SVG de la lupa */

.apharel-search-toggle .apharel-search-icon svg {

    display: block;

    width: 20px;
    height: 20px;

    fill: none;

    stroke: currentColor;

    stroke-width: 1.7;

    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   7. CARRITO
========================================================= */

.apharel-cart-link {

    position: relative;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    color: #111111;

    font-family: var(--apharel-font-body);

    text-decoration: none;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}


.apharel-cart-link:hover {

    opacity: 0.65;

    transform: translateY(-1px);
}


/* Icono carrito */

.apharel-cart-icon {

    display: flex;

    align-items: center;
    justify-content: center;

    width: 21px;
    height: 21px;
}


.apharel-cart-icon svg {

    display: block;

    width: 20px;
    height: 20px;

    fill: none;

    stroke: currentColor;

    stroke-width: 1.5;

    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   8. CONTADOR DEL CARRITO
========================================================= */

.apharel-cart-count {

    position: absolute;

    top: -2px;
    right: -4px;

    display: flex;

    align-items: center;
    justify-content: center;

    min-width: 17px;
    height: 17px;

    padding: 0 4px;

    border-radius: 50%;

    background: #111111;

    color: #ffffff;

    font-family: var(--apharel-font-body);

    font-size: 9px;

    font-weight: 600;

    line-height: 1;
}


.apharel-cart-count:empty {

    display: none;
}


/* =========================================================
   9. ANIMACIÓN DEL CARRITO
========================================================= */

.apharel-cart-link.apharel-cart-added {

    animation: apharelCartAdded 0.45s ease;
}


@keyframes apharelCartAdded {

    0% {

        transform: scale(1);
    }

    50% {

        transform: scale(1.18);
    }

    100% {

        transform: scale(1);
    }
}


/* =========================================================
   10. PANEL DEL BUSCADOR
========================================================= */

.apharel-search-panel {

    position: absolute;

    top: 100%;
    left: 0;
    right: 0;

    width: 100%;

    padding: 18px 0 22px;

    background: #ffffff;

    border-top: 1px solid #eeeeee;
    border-bottom: 1px solid #eeeeee;

    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.06);

    opacity: 0;

    visibility: hidden;

    transform: translateY(-8px);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        visibility 0.25s ease;

    z-index: 9998;

    font-family: var(--apharel-font-body);
}


/* Buscador abierto */

.apharel-search-panel.is-open {

    opacity: 1;

    visibility: visible;

    transform: translateY(0);
}


/* =========================================================
   11. FORMULARIO DE BÚSQUEDA
========================================================= */

.apharel-search-form {

    position: relative;

    display: flex;

    align-items: center;

    width: min(780px, calc(100% - 40px));

    height: 48px;

    margin: 0 auto;
}


/* =========================================================
   12. LUPA DENTRO DEL BUSCADOR
========================================================= */

.apharel-search-form-icon {

    position: absolute;

    left: 18px;
    top: 50%;

    display: flex;

    width: 20px;
    height: 20px;

    color: #777777;

    transform: translateY(-50%);

    pointer-events: none;

    z-index: 2;
}


.apharel-search-form-icon svg {

    display: block;

    width: 20px;
    height: 20px;

    fill: none;

    stroke: currentColor;

    stroke-width: 1.7;

    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   13. INPUT
========================================================= */

.apharel-search-form input[type="search"],
.apharel-search-input {

    box-sizing: border-box;

    width: 100%;
    height: 48px;

    padding: 0 55px 0 48px;

    border: 1px solid #dddddd !important;

    border-radius: 999px;

    outline: none !important;

    background: #ffffff;

    color: #111111;

    /* 🔴 CAMBIO
       El buscador utiliza la fuente general. */

    font-family: var(--apharel-font-body);

    font-size: 14px;

    box-shadow: none !important;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.apharel-search-form input[type="search"]:focus,
.apharel-search-input:focus {

    border-color: #111111 !important;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.04) !important;
}


.apharel-search-form input[type="search"]::placeholder,
.apharel-search-input::placeholder {

    color: #999999;

    font-family: var(--apharel-font-body);
}


/* =========================================================
   14. BOTÓN CERRAR BUSCADOR
========================================================= */

.apharel-search-close {

    position: absolute;

    top: 50%;
    right: 12px;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    padding: 0;

    border: 0;

    background: transparent;

    color: #555555;

    font-family: var(--apharel-font-body);

    font-size: 25px;

    font-weight: 300;

    line-height: 1;

    cursor: pointer;

    transform: translateY(-50%);

    transition: color 0.2s ease;
}


.apharel-search-close:hover {

    color: #111111;
}


/* =========================================================
   15. RESULTADOS / RECOMENDACIONES
========================================================= */

/*
   IMPORTANTE:

   Los resultados aparecen DEBAJO del buscador.
   No al costado.
*/

.apharel-search-results {

    box-sizing: border-box;

    width: min(780px, calc(100% - 40px));

    max-height: 480px;

    margin: 10px auto 0;

    padding: 8px;

    overflow-y: auto;

    background: #ffffff;

    border: 1px solid #eeeeee;

    border-radius: 16px;

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.10);

    opacity: 0;

    visibility: hidden;

    transform: translateY(-5px);

    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;

    font-family: var(--apharel-font-body);
}


.apharel-search-results.is-visible {

    opacity: 1;

    visibility: visible;

    transform: translateY(0);
}


/* =========================================================
   16. SECCIONES DE RESULTADOS
========================================================= */

.apharel-search-section {

    padding: 8px 0;
}


.apharel-search-section + .apharel-search-section {

    margin-top: 5px;

    padding-top: 13px;

    border-top: 1px solid #eeeeee;
}


/* Título PRODUCTOS / CATEGORÍAS */

/* 🔴 CAMBIO
   No es un título editorial de la página.
   Por eso se mantiene Arial/Helvetica. */

.apharel-search-heading {

    padding: 7px 12px;

    color: #888888;

    font-family: var(--apharel-font-body);

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 0.12em;

    text-transform: uppercase;
}


/* =========================================================
   17. PRODUCTOS RECOMENDADOS
========================================================= */

.apharel-search-product {

    display: flex;

    align-items: center;

    gap: 13px;

    width: 100%;

    padding: 9px 10px;

    box-sizing: border-box;

    border-radius: 10px;

    text-decoration: none;

    transition:
        background 0.2s ease;
}


.apharel-search-product:hover {

    background: #f6f6f6;
}


/* Imagen */

.apharel-search-product-image {

    display: flex;

    align-items: center;
    justify-content: center;

    width: 52px;
    height: 62px;

    flex: 0 0 52px;

    overflow: hidden;

    border-radius: 8px;

    background: #f2f2f2;
}


.apharel-search-product-image img {

    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


.apharel-search-product-image span {

    color: #999999;

    font-family: var(--apharel-font-body);

    font-size: 7px;

    letter-spacing: 0.08em;
}


/* Información */

.apharel-search-product-info {

    display: flex;

    flex-direction: column;

    min-width: 0;

    gap: 5px;

    font-family: var(--apharel-font-body);
}


.apharel-search-product-info strong {

    display: block;

    overflow: hidden;

    color: #111111;

    font-family: var(--apharel-font-body);

    font-size: 13px;

    font-weight: 600;

    white-space: nowrap;

    text-overflow: ellipsis;
}


.apharel-search-product-info span {

    color: #555555;

    font-family: var(--apharel-font-body);

    font-size: 12px;
}


/* =========================================================
   18. CATEGORÍAS RECOMENDADAS
========================================================= */

.apharel-search-category {

    display: flex;

    align-items: center;

    gap: 8px;

    width: 100%;

    padding: 10px 12px;

    box-sizing: border-box;

    border-radius: 9px;

    color: #111111;

    font-family: var(--apharel-font-body);

    font-size: 13px;

    text-decoration: none;

    transition:
        background 0.2s ease;
}


.apharel-search-category:hover {

    background: #f6f6f6;
}


.apharel-search-category span {

    color: #888888;

    font-family: var(--apharel-font-body);
}


/* =========================================================
   19. SIN RESULTADOS / CARGANDO
========================================================= */

.apharel-search-loading,
.apharel-search-empty {

    padding: 22px 15px;

    text-align: center;

    color: #777777;

    font-family: var(--apharel-font-body);

    font-size: 13px;
}


.apharel-search-empty strong {

    color: #111111;

    font-family: var(--apharel-font-body);
}


/* =========================================================
   20. BOTÓN MENÚ MÓVIL
========================================================= */

.apharel-menu-toggle {

    display: none;

    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    padding: 0;

    border: 0;

    border-radius: 6px;

    background: #111111;

    color: #ffffff;

    font-family: var(--apharel-font-body);

    font-size: 24px;

    line-height: 1;

    cursor: pointer;

    z-index: 10001;
}


/* =========================================================
   21. MENÚ MÓVIL
========================================================= */

@media (max-width: 768px) {

    .apharel-header {

        z-index: 9999;
    }


    .apharel-header-inner {

        width: calc(100% - 32px);

        min-height: 70px;

        gap: 15px;
    }


    /* 🔴 CAMBIO
       Logo más grande en móvil. */

    .apharel-logo {

        width: 155px;
    }


    .apharel-logo img {

        width: 155px;
    }


    /* Ocultar navegación normal */

    .apharel-nav {

        position: absolute;

        top: 100%;
        left: 0;
        right: 0;

        display: flex;

        flex-direction: column;

        align-items: stretch;

        gap: 0;

        padding: 10px 22px 25px;

        background: #111111;

        border-top: 1px solid #333333;

        box-shadow:
            0 15px 30px rgba(0, 0, 0, 0.18);

        opacity: 0;

        visibility: hidden;

        transform: translateY(-10px);

        pointer-events: none;

        transition:
            opacity 0.3s ease,
            transform 0.3s ease,
            visibility 0.3s ease;

        z-index: 10000;
    }


    /* Menú abierto */

    .apharel-header.apharel-menu-open .apharel-nav {

        opacity: 1;

        visibility: visible;

        transform: translateY(0);

        pointer-events: auto;
    }


    /* Enlaces */

    .apharel-header.apharel-menu-open .apharel-nav a {

        display: block;

        padding: 18px 5px;

        border-bottom: 1px solid #333333;

        color: #ffffff !important;

        font-family: var(--apharel-font-body);

        font-size: 12px;

        font-weight: 500;

        letter-spacing: 0.14em;

        text-decoration: none;

        text-transform: uppercase;
    }


    .apharel-header.apharel-menu-open .apharel-nav a:hover {

        color: #aaaaaa !important;

        padding-left: 10px;
    }


    .apharel-header.apharel-menu-open .apharel-nav a:last-child {

        border-bottom: 0;
    }


    /* Botón móvil */

    .apharel-menu-toggle {

        display: flex !important;
    }


    /* Acciones */

    .apharel-header-actions {

        margin-left: auto;

        gap: 10px;
    }


    .apharel-search-toggle,
    .apharel-cart-link {

        width: 34px;

        height: 34px;
    }


    /* Panel de búsqueda */

    .apharel-search-panel {

        padding: 12px 0 16px;
    }


    .apharel-search-form {

        width: calc(100% - 24px);

        height: 46px;
    }


    .apharel-search-form input[type="search"],
    .apharel-search-input {

        height: 46px;

        font-size: 13px;
    }


    /* Recomendaciones */

    .apharel-search-results {

        width: calc(100% - 24px);

        max-height: 60vh;

        border-radius: 14px;
    }


    /* Bloquear scroll con menú abierto */

    body.apharel-mobile-menu-open {

        overflow: hidden;
    }
}


/* =========================================================
   22. TABLET
========================================================= */

@media (min-width: 769px) and (max-width: 900px) {

    .apharel-header-inner {

        width: calc(100% - 40px);

        gap: 20px;
    }


    .apharel-nav {

        gap: 22px;
    }


    .apharel-nav a {

        font-size: 11px;

        letter-spacing: 1px;
    }


    /* 🔴 CAMBIO
       Logo más grande en tablet. */

    .apharel-logo {

        width: 180px;
    }


    .apharel-logo img {

        width: 180px;
    }
}


/* =========================================================
   23. ESCRITORIO
========================================================= */

@media (min-width: 769px) {

    .apharel-menu-toggle {

        display: none !important;
    }
}