/* Header reconstruido desde cero.
 * Desktop objetivo:
 * - Fila 1: 1920x88px
 * - Logo: 150x48px
 * - Buscador: 567x44px
 * - Acciones: icono + texto en 2 líneas (ej. Descargar / Catálogo / badge en carrito)
 * - Fila 2: 1920x60px
 * - Boton categorias: 178x36px
 * - Menu y telefono: 16px
 */
:root {
    --oz-header-black: #000000;
    --oz-header-orange: var(--oz-brand-accent, #5b6672);
    --oz-header-white: #ffffff;
    --oz-header-search-bg: #ffffff;
    --oz-header-search-border: #d8d8d8;
    --oz-header-search-text: #757575;
    --oz-header-search-placeholder: #9a9a9a;
    --oz-header-divider: rgba(255, 255, 255, 0.18);
    --oz-header-top-height: 88px;
    --oz-header-bottom-height: 60px;
    --oz-header-logo-w: 150px;
    --oz-header-logo-h: 48px;
    --oz-header-search-w: 567px;
    --oz-header-search-h: 44px;
    --oz-header-top-catalog-w: auto;
    --oz-header-top-catalog-h: auto;
    --oz-header-quote-w: auto;
    --oz-header-quote-h: auto;
    --oz-header-action-icon: 26px;
    --oz-header-cart-icon: url("assets/icons/icono-carrito.svg");
    --oz-header-badge-bg: #e30613;
    --oz-header-categories-w: 178px;
    --oz-header-categories-h: 36px;
    --oz-header-max: 1920px;
    --oz-header-shell-pad: 0px; /* padding eliminado */
    --oz-header-transition: 0.22s ease;
}

.main-header {
    position: relative;
    z-index: 100;
    width: 100%;
    background: var(--oz-header-black);
    color: var(--oz-header-white);
    font-family: var(--OZ-Font-Base);
    overflow-x: clip;
}

.main-header *,
.main-header *::before,
.main-header *::after {
    box-sizing: border-box;
}

.main-header__shell {
    width: 1440px; /* ancho fijo solicitado */
    max-width: 100%;
    margin: 0 auto;
    padding-inline: var(--oz-header-shell-pad);
}

.main-header__topbar {
    background: var(--oz-header-black);
}

.main-header__topbar-inner {
    min-height: var(--oz-header-top-height); /* alto exacto fila superior */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.main-header__logo-slot {
    flex: 0 0 auto;
    width: auto;
    display: flex;
    align-items: center;
}

@media (max-width: 1399px) {
    .main-header__logo-slot {
        flex-basis: var(--oz-header-logo-w);
        width: var(--oz-header-logo-w);
    }
}

.main-header__logo-link,
.logo-link,
.custom-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    max-width: 100%;
    text-decoration: none;
    color: inherit;
}

.main-header__logo-link img,
.logo-link img,
.custom-logo-link img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* En viewports reducidos sí se controla el tamaño para que encaje en la maqueta */
@media (max-width: 1399px) {
    .main-header__logo-link img,
    .logo-link img,
    .custom-logo-link img {
        width: var(--oz-header-logo-w);
        height: var(--oz-header-logo-h);
        object-fit: contain;
    }
}

.logo-text {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.main-header__search-slot {
    flex: 0 1 auto;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.search-container {
    width: var(--oz-header-search-w); /* 567px exactos */
    max-width: 100%;
    position: relative;
}

.search-container .ozpls-figma {
    width: 100% !important;
}

.search-container .ozpls-figma__form {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: var(--oz-header-search-h); /* 44px exactos */
    margin: 0;
    background: var(--oz-header-search-bg) !important;
    border: 1px solid var(--oz-header-search-border) !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

.search-container .ozpls-figma__inputWrap,
.search-container .ozpls-figma__bar {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.search-container .ozpls-figma__input,
.search-container .ozpls-figma__input:focus,
.search-container .ozpls-figma__input:hover,
.search-container .ozpls-figma__input:active {
    width: 100% !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 50px 0 18px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--oz-header-search-text) !important;
    -webkit-text-fill-color: var(--oz-header-search-text) !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 44px !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.search-container .ozpls-figma__input::placeholder {
    color: var(--oz-header-search-placeholder) !important;
    -webkit-text-fill-color: var(--oz-header-search-placeholder) !important;
}

.search-container .ozpls-figma__btn {
    position: absolute !important;
    inset: 0 0 0 auto !important;
    width: 44px !important;
    border: 0 !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

.search-container .ozpls-figma__btnText,
.search-container .ozpls-figma__btn svg,
.search-container .ozpls-figma__btn img {
    display: none !important;
}

.search-container .ozpls-figma__btn::after {
    content: "";
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'%3E%3C/circle%3E%3Cline x1='20' y1='20' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

.main-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    flex: 0 0 auto;
}

.main-header__top-catalog-btn {
    width: auto;
    min-width: 0;
    max-width: 100%;
    min-height: 40px;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
    border-right: 1px solid var(--oz-header-divider);
    padding: 6px 20px 6px 0;
}

.main-header__top-catalog-btn:hover,
.main-header__quote-btn:hover {
    color: #ffffff;
    text-decoration: none;
    opacity: 0.88;
}

.main-header__quote-slot {
    width: auto;
    min-width: 0;
    max-width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.main-header__quote-btn {
    width: auto;
    min-width: 0;
    min-height: 40px;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
    padding: 6px 0;
}

.main-header__action-icon {
    width: var(--oz-header-action-icon);
    height: var(--oz-header-action-icon);
    flex: 0 0 var(--oz-header-action-icon);
    display: block;
}

.main-header__action-icon--cart {
    flex-shrink: 0;
    background-image: var(--oz-header-cart-icon);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* Botón del plugin (p. ej. sidecart) dentro del slot del header */
.oz-header__quote-shortcode .ozc-sidecart-trigger::before {
    content: "";
    width: var(--oz-header-action-icon);
    height: var(--oz-header-action-icon);
    flex: 0 0 var(--oz-header-action-icon);
    display: block;
    background-image: var(--oz-header-cart-icon);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.main-header__action-icon-wrap {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
}

.main-header__cart-badge {
    position: absolute;
    top: -7px;
    right: -9px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--oz-header-badge-bg);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-sizing: border-box;
    pointer-events: none;
}

.main-header__action-text-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
    line-height: 1.05;
    text-align: left;
}

.main-header__action-line {
    display: block;
    color: inherit;
}

.main-header__action-line--sub {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.02em;
    opacity: 0.95;
}

.main-header__action-line--emph {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.oz-header__quote-shortcode {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.oz-header__quote-shortcode > * {
    min-width: 0;
}

/* Shortcode del cotizador: mismo ritmo visual que .main-header__quote-btn (ancho fluido) */
.oz-header__quote-shortcode a,
.oz-header__quote-shortcode button,
.oz-header__quote-shortcode .button,
.oz-header__quote-shortcode [class*="cart"],
.oz-header__quote-shortcode [class*="cotizador"] {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 6px 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #ffffff !important;
    font-size: inherit !important;
    line-height: 1.15 !important;
    text-decoration: none !important;
    white-space: normal !important;
}

.main-header__navband {
    background: var(--oz-header-orange);
}

.main-header__navband-inner {
    min-height: var(--oz-header-bottom-height); /* 60px exactos */
    display: flex;
    align-items: center;
    gap: 28px;
}

.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    color: #ffffff;
    background: transparent;
    border: 0;
    cursor: pointer;
    flex: 0 0 44px;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 22px;
    height: 2px;
    background-color: currentColor;
    position: relative;
    transition: transform var(--oz-header-transition);
}

.hamburger::before,
.hamburger::after {
    content: "";
    position: absolute;
    left: 0;
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    bottom: -7px;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger {
    background-color: transparent;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger::after {
    bottom: 0;
    transform: rotate(-45deg);
}

.main-header__categories-slot {
    position: relative;
    flex: 0 0 var(--oz-header-categories-w);
}

.categories-btn {
    width: var(--oz-header-categories-w); /* 178px exactos */
    height: var(--oz-header-categories-h); /* 36px exactos */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    background: var(--oz-brand-accent, #5b6672);
    border: 1px solid var(--oz-brand-accent, #5b6672);
    border-radius: 6px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
    cursor: pointer;
    transition: background-color var(--oz-header-transition), border-color var(--oz-header-transition), color var(--oz-header-transition), box-shadow var(--oz-header-transition);
}

.categories-btn:hover,
.categories-btn:focus-visible,
.categories-btn[aria-expanded="true"] {
    background: color-mix(in srgb, var(--oz-brand-accent, #5b6672) 82%, #000);
    border-color: color-mix(in srgb, var(--oz-brand-accent, #5b6672) 82%, #000);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.categories-btn .icon-menu {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.categories-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    z-index: 1000;
    width: 280px;
    max-width: min(280px, calc(100vw - 24px));
    max-height: 360px;
    margin: 0;
    padding: 10px 0;
    overflow-y: auto;
    list-style: none;
    background: var(--oz-brand-accent, #5b6672);
    border-radius: 8px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.categories-menu li {
    margin: 0;
}

.categories-menu .children {
    display: none;
}

.categories-menu a {
    display: block;
    padding: 10px 16px;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.3;
    text-decoration: none;
}

.categories-menu a:hover,
.categories-menu a:focus {
    background: rgba(0, 0, 0, 0.15);
    color: #ffffff;
    outline: none;
}

.main-header__menu-slot,
.main-nav {
    flex: 1 1 auto;
    min-width: 0;
}

.nav-list,
.nav-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.nav-list > li {
    margin: 0;
}

.nav-list > li > a {
    display: inline-flex;
    align-items: center;
    min-height: var(--oz-header-bottom-height);
    padding: 0 22px;
    color: #ffffff;
    font-size: 16px; /* especificacion exacta */
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
    text-decoration: none;
}

.nav-list > li > a:hover,
.nav-list > li.current-menu-item > a,
.nav-list > li.current_page_item > a,
.nav-list > li.current-menu-ancestor > a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.nav-list .sub-menu {
    display: none;
}

.main-header__phone-slot,
.header-phone {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.header-phone__label,
.header-phone__value {
    color: inherit;
    text-decoration: none;
    font-size: 16px; /* especificacion exacta */
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
}

.header-phone__value:hover {
    color: #ffffff;
    text-decoration: none;
}

/* ===== LAPTOP (<=1399px): reducir paddings, buscador algo menor, todo en una fila ===== */
@media (max-width: 1399px) {
    :root {
        --oz-header-shell-pad: 32px;
        --oz-header-search-w: 420px;
    }

    .main-header__shell {
        width: 100%;
    }

    .main-header__topbar-inner {
        gap: 18px;
    }

    .main-header__actions {
        gap: 14px;
    }

    .main-header__top-catalog-btn {
        padding-right: 14px;
    }

    .main-header__navband-inner {
        gap: 18px;
    }

    .nav-list > li > a {
        padding-inline: 14px;
        font-size: 15px;
    }
}

/* ===== LAPTOP (1200px–1439px, cubre 1366px): margen de 100px ===== */
@media (min-width: 1200px) and (max-width: 1439px) {
    :root {
        --oz-header-shell-pad: 100px;
    }
}

/* ===== LAPTOP PEQUEÑO (<=1199px): buscador pasa a segunda fila ===== */
@media (max-width: 1199px) {
    :root {
        --oz-header-top-height: auto;
        --oz-header-shell-pad: 24px;
        --oz-header-search-w: 100%;
        --oz-header-categories-w: 160px;
    }

    .main-header__topbar-inner {
        padding-block: 16px;
        flex-wrap: wrap;
        row-gap: 14px;
    }

    .main-header__logo-slot {
        order: 1;
    }

    .main-header__actions {
        order: 2;
        margin-left: auto;
        gap: 12px;
    }

    .main-header__search-slot {
        order: 3;
        flex: 1 0 100%;
        width: 100%;
    }

    .search-container {
        width: 100%;
    }

    .nav-list > li > a,
    .header-phone__label,
    .header-phone__value,
    .categories-btn {
        font-size: 15px;
    }
}

/* ===== TABLET / MÓVIL (<=991px): layout reestructurado en grid =====
 * Fila 1: logo + hamburguesa + catálogo + carrito
 * Fila 2: categorías + buscador
 * Sin franja naranja (navband se disuelve y se oculta su fondo).
 * El menú principal se muestra como popover bajo la cabecera al pulsar la hamburguesa.
 */
@media (max-width: 991px) {
    :root {
        --oz-header-shell-pad: 16px;
        --oz-header-logo-w: 132px;
        --oz-header-logo-h: 42px;
        --oz-header-categories-w: auto;
        --oz-header-categories-h: 38px;
    }

    .main-header {
        position: relative;
        background: var(--oz-header-black);
        padding: 12px var(--oz-header-shell-pad);
        display: grid;
        grid-template-columns: auto auto 1fr auto auto;
        grid-template-areas:
            "logo hamburger . catalog cart"
            "categories search search search search";
        align-items: center;
        gap: 12px 10px;
    }

    /* Disolver wrappers para que los elementos hijos sean items del grid */
    .main-header__topbar,
    .main-header__navband,
    .main-header__shell,
    .main-header__topbar-inner,
    .main-header__navband-inner,
    .main-header__actions {
        display: contents;
        background: transparent !important;
        padding: 0;
        margin: 0;
        min-height: 0;
        gap: 0;
    }

    /* Asignación de áreas del grid */
    .main-header__logo-slot {
        grid-area: logo;
        flex: 0 0 auto;
        width: auto;
    }

    .mobile-menu-toggle {
        grid-area: hamburger;
        display: inline-flex;
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
    }

    .main-header__top-catalog-btn {
        grid-area: catalog;
        min-width: 0;
        min-height: 40px;
        border-right: 0;
        padding: 6px 0;
        gap: 8px;
    }

    .main-header__quote-slot {
        grid-area: cart;
        width: auto;
        min-width: 0;
    }

    .main-header__categories-slot {
        grid-area: categories;
        flex: 0 0 auto;
        position: relative;
    }

    .main-header__search-slot {
        grid-area: search;
        width: 100%;
        min-width: 0;
    }

    .search-container {
        width: 100%;
    }

    .categories-btn {
        width: auto;
        min-width: 0;
        height: 40px;
        padding: 0 14px;
        font-size: 14px;
    }

    .categories-btn .icon-menu {
        width: 14px;
        height: 14px;
        flex-basis: 14px;
    }

    /* Teléfono oculto en tablet/móvil */
    .main-header__phone-slot,
    .header-phone {
        display: none;
    }

    /* Menú principal como popover desplegable bajo el header */
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1000;
        background: #111111;
        padding: 10px 16px;
        max-height: 70vh;
        overflow-y: auto;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
    }

    .main-nav.active {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 2px;
    }

    .nav-list > li {
        width: 100%;
    }

    .nav-list > li > a {
        width: 100%;
        min-height: 44px;
        padding: 10px 12px;
        font-size: 15px;
    }
}

/* ===== MÓVIL (<=767px): compactar acciones, ocultar texto del catálogo ===== */
@media (max-width: 767px) {
    :root {
        --oz-header-logo-w: 120px;
        --oz-header-logo-h: 38px;
        --oz-header-action-icon: 22px;
    }

    .main-header {
        grid-template-columns: auto auto 1fr auto auto;
        gap: 10px 8px;
    }

    .main-header__top-catalog-btn .main-header__action-text-stack {
        display: none;
    }

    .main-header__top-catalog-btn {
        width: 40px;
        min-width: 40px;
        padding: 4px;
        justify-content: center;
    }

    .main-header__action-line--sub {
        font-size: 9px;
    }

    .main-header__action-line--emph {
        font-size: 12px;
    }

    .categories-btn {
        height: 38px;
        padding: 0 12px;
        font-size: 13px;
    }
}

/* ===== MÓVIL PEQUEÑO (<=575px): sólo iconos, todo compactado ===== */
@media (max-width: 575px) {
    :root {
        --oz-header-shell-pad: 12px;
        --oz-header-logo-w: 108px;
        --oz-header-logo-h: 34px;
        --oz-header-action-icon: 20px;
    }

    .main-header {
        padding: 10px var(--oz-header-shell-pad);
        gap: 10px 6px;
    }

    .main-header__top-catalog-btn,
    .main-header__quote-btn,
    .oz-header__quote-shortcode a,
    .oz-header__quote-shortcode button,
    .oz-header__quote-shortcode .button,
    .oz-header__quote-shortcode [class*="cart"],
    .oz-header__quote-shortcode [class*="cotizador"] {
        min-width: 0 !important;
    }

    .main-header__top-catalog-btn {
        width: 40px;
        min-width: 40px;
        padding: 4px;
        justify-content: center;
    }

    .main-header__quote-btn .main-header__action-text-stack {
        display: none;
    }

    .main-header__quote-slot,
    .main-header__quote-btn {
        width: auto;
        min-width: 40px;
    }

    .oz-header__quote-shortcode a,
    .oz-header__quote-shortcode button,
    .oz-header__quote-shortcode .button,
    .oz-header__quote-shortcode [class*="cart"],
    .oz-header__quote-shortcode [class*="cotizador"] {
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        justify-content: center !important;
    }

    .main-header__action-icon {
        width: var(--oz-header-action-icon);
        height: var(--oz-header-action-icon);
        flex-basis: var(--oz-header-action-icon);
    }

    .search-container .ozpls-figma__input {
        font-size: 12px !important;
        padding-inline: 14px 46px !important;
    }

    .categories-btn {
        height: 36px;
        padding: 0 10px;
        font-size: 12px;
    }
}
