/* =========================================================
   WQB HEADERS — All 5 templates + shared components
   Author: Rhadys Reinoso
   ========================================================= */

/* ── CSS Variables (set per-page by WQB_Header::print_css_vars) ── */
:root {
    --wqb-h-bg:     #ffffff;
    --wqb-h-text:   #1d2327;
    --wqb-h-accent: #e53935;
    --wqb-h-hover:  #c62828;
    --wqb-h-cta-bg: #e53935;
    --wqb-h-cta-tx: #ffffff;
    --wqb-h-border: #e2e4e7;
    --wqb-h-tb-bg:  #1d2327;
    --wqb-h-tb-tx:  #ffffff;
    --wqb-logo-w:   160px;
    --wqb-h-height: 64px;
}

/* ── Reset for header context ──────────────────────────── */
.wqb-header *,
.wqb-top-bar *,
.wqb-footer * { box-sizing: border-box; }

/* ── Top Bar ────────────────────────────────────────────── */
.wqb-top-bar {
    background: var(--wqb-h-tb-bg);
    color: var(--wqb-h-tb-tx);
    font-size: 12px;
    padding: 6px 0;
    width: 100%;
}
.wqb-top-bar__inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.wqb-top-bar__left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.wqb-top-bar__left a,
.wqb-top-bar__left span { color: var(--wqb-h-tb-tx); text-decoration: none; }
.wqb-top-bar__left a:hover { opacity: .8; }
.wqb-top-bar__right { display: flex; align-items: center; gap: 10px; }
.wqb-tb-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: var(--wqb-h-tb-tx);
    transition: background .15s;
}
.wqb-tb-social:hover { background: rgba(255,255,255,.25); }
.wqb-tb-social svg { display: block; }

/* ── Header base ────────────────────────────────────────── */
.wqb-header {
    background: var(--wqb-h-bg);
    color: var(--wqb-h-text);
    width: 100%;
    z-index: 1000;
    transition: box-shadow .3s;
}
.wqb-header--border { border-bottom: 1px solid var(--wqb-h-border); }
.wqb-header--sticky {
    position: sticky;
    top: 0;
}
.wqb-header--sticky.is-scrolled {
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
}

/* Shared inner container */
.wqb-header__inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px;
    height: var(--wqb-h-height);
    display: flex;
    align-items: center;
    gap: 28px;
}

/* ── Logo ───────────────────────────────────────────────── */
.wqb-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}
.wqb-logo img {
    max-width: var(--wqb-logo-w);
    height: auto;
    display: block;
}
.wqb-logo--text span {
    font-size: 20px;
    font-weight: 800;
    color: var(--wqb-h-accent);
    letter-spacing: -.5px;
}
.wqb-logo--small img { max-width: calc(var(--wqb-logo-w) * .75); }
.wqb-logo--footer img { max-width: 140px; filter: brightness(.9); }

/* ── Navigation ─────────────────────────────────────────── */
.wqb-nav { flex: 1; }
.wqb-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.wqb-nav__list a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--wqb-h-text);
    text-decoration: none;
    border-radius: 6px;
    transition: color .15s, background .15s;
    white-space: nowrap;
}
.wqb-nav__list a:hover,
.wqb-nav__list a.active {
    color: var(--wqb-h-accent);
    background: rgba(0,0,0,.04);
}
.wqb-nav__list a.active { font-weight: 700; }
.wqb-nav__icon { font-size: 13px; }

/* ── Actions ────────────────────────────────────────────── */
.wqb-header__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}
.wqb-hdr-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: var(--wqb-h-text);
    cursor: pointer;
    border-radius: 8px;
    text-decoration: none;
    position: relative;
    transition: background .15s, color .15s;
}
.wqb-hdr-icon-btn svg { width: 20px; height: 20px; display: block; }
.wqb-hdr-icon-btn:hover { background: rgba(0,0,0,.06); color: var(--wqb-h-accent); }

.wqb-cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--wqb-h-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}
.wqb-cart-count:empty,
.wqb-cart-count[data-count="0"] { display: none; }

.wqb-hdr-btn-login {
    padding: 7px 16px;
    border: 1.5px solid var(--wqb-h-text);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--wqb-h-text);
    text-decoration: none;
    white-space: nowrap;
    transition: .15s;
}
.wqb-hdr-btn-login:hover { background: var(--wqb-h-text); color: var(--wqb-h-bg); }
.wqb-hdr-btn-login--minimal { border: none; font-size: 13px; }

.wqb-hdr-cta {
    display: inline-flex;
    align-items: center;
    padding: 9px 18px;
    background: var(--wqb-h-cta-bg);
    color: var(--wqb-h-cta-tx) !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .15s, transform .15s;
}
.wqb-hdr-cta:hover { opacity: .9; transform: translateY(-1px); }
.wqb-hdr-cta--full { width: 100%; justify-content: center; border-radius: 8px; padding: 13px; font-size: 14px; }

/* ── Hamburger ───────────────────────────────────────────── */
.wqb-hamburger {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: rgba(0,0,0,.04);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    color: var(--wqb-h-text);
    position: relative;
    z-index: 1002;
    flex-shrink: 0;
}
.wqb-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
}
.wqb-hamburger.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.wqb-hamburger.is-open span:nth-child(2) { opacity: 0; }
.wqb-hamburger.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ═══════════════════════════════════════════════════════════
   TEMPLATE 1: CLÁSICO
   ═══════════════════════════════════════════════════════════ */
.wqb-header--clasico .wqb-header__inner {
    /* Default layout: logo | nav flex:1 | actions */
}

/* ═══════════════════════════════════════════════════════════
   TEMPLATE 2: CENTRADO
   ═══════════════════════════════════════════════════════════ */
.wqb-header--centrado { display: flex; flex-direction: column; height: auto; }

.wqb-header__row {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.wqb-header__row--center {
    height: 64px;
    justify-content: space-between;
}
.wqb-header__center-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.wqb-header__row--nav {
    height: 44px;
    border-top: 1px solid var(--wqb-h-border);
    justify-content: center;
    gap: 0;
}
.wqb-header--centrado .wqb-nav { flex: 0 0 auto; }
.wqb-hdr-cta--nav { margin-left: 16px; }

/* ═══════════════════════════════════════════════════════════
   TEMPLATE 3: MINIMALISTA
   ═══════════════════════════════════════════════════════════ */
.wqb-header--minimalista {
    border-bottom: 2px solid var(--wqb-h-accent) !important;
}
.wqb-header--minimalista .wqb-header__inner--minimal {
    height: 56px;
}
.wqb-header--minimalista .wqb-nav__list a {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .3px;
}
.wqb-header--minimalista .wqb-hdr-icon-btn {
    width: 32px;
    height: 32px;
}
.wqb-header--minimalista .wqb-hdr-icon-btn svg { width: 18px; height: 18px; }
.wqb-header__actions--minimal { margin-left: auto; gap: 4px; }

/* ═══════════════════════════════════════════════════════════
   TEMPLATE 4: IMPACTANTE
   ═══════════════════════════════════════════════════════════ */
.wqb-header--impactante {
    --wqb-h-height: 72px;
}
.wqb-header--impactante .wqb-header__inner--bold {
    height: var(--wqb-h-height);
}
.wqb-header--impactante .wqb-logo--bold img {
    max-width: calc(var(--wqb-logo-w) * 1.1);
}
.wqb-header--impactante .wqb-nav__list a {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.wqb-header__mid { flex: 1; display: flex; justify-content: center; }
.wqb-header__actions--bold { gap: 8px; }
.wqb-hdr-cta--bold {
    padding: 11px 22px;
    font-size: 14px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ═══════════════════════════════════════════════════════════
   TEMPLATE 5: MODERNO
   ═══════════════════════════════════════════════════════════ */
.wqb-header--moderno { display: flex; flex-direction: column; height: auto; }

.wqb-header__row--modern-top {
    height: 68px;
    border-bottom: 1px solid var(--wqb-h-border);
}
.wqb-header__row--modern-nav {
    height: 44px;
    background: var(--wqb-h-accent);
    max-width: none;
    padding: 0 24px;
    justify-content: center;
}
.wqb-header__row--modern-nav .wqb-nav__list a {
    color: rgba(255,255,255,.85);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.wqb-header__row--modern-nav .wqb-nav__list a:hover,
.wqb-header__row--modern-nav .wqb-nav__list a.active {
    color: #fff;
    background: rgba(255,255,255,.15);
}
.wqb-hdr-cta--modern {
    background: rgba(255,255,255,.15);
    color: #fff !important;
    border: 1.5px solid rgba(255,255,255,.4);
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}
.wqb-hdr-cta--modern:hover { background: rgba(255,255,255,.3); }

/* Inline search bar (modern template) */
.wqb-header__search-bar {
    flex: 1;
    max-width: 520px;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 1px solid var(--wqb-h-border);
    border-radius: 8px;
    overflow: hidden;
    height: 42px;
}
.wqb-search-input-inline {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0 14px;
    font-size: 14px;
    color: var(--wqb-h-text);
    outline: none;
}
.wqb-header__search-bar button {
    width: 44px;
    height: 42px;
    background: var(--wqb-h-accent);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wqb-header__search-bar button svg { width: 18px; height: 18px; }

/* ── Mobile drawer ───────────────────────────────────────── */
.wqb-mobile-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 82%;
    max-width: 320px;
    height: 100dvh;
    background: var(--wqb-h-bg);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    padding: 0;
    transition: left .3s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 32px rgba(0,0,0,.18);
    overflow-y: auto;
}
.wqb-mobile-drawer.is-open { left: 0; }
.wqb-mobile-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--wqb-h-border);
}
.wqb-mobile-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--wqb-h-text);
    padding: 4px;
    line-height: 1;
}
.wqb-mobile-nav { flex: 1; padding: 12px 0; }
.wqb-mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.wqb-mobile-nav li a {
    display: flex;
    align-items: center;
    padding: 13px 24px;
    font-size: 15px;
    font-weight: 500;
    color: var(--wqb-h-text);
    text-decoration: none;
    border-bottom: 1px solid rgba(0,0,0,.05);
    transition: background .15s, color .15s;
}
.wqb-mobile-nav li a:hover { background: rgba(0,0,0,.04); color: var(--wqb-h-accent); }
.wqb-mobile-drawer .wqb-hdr-cta--full { margin: 16px 20px 24px; width: auto; }

.wqb-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}
.wqb-drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

/* ── Search overlay ─────────────────────────────────────── */
.wqb-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 10002;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}
.wqb-search-overlay.is-open { opacity: 1; pointer-events: auto; }
.wqb-search-overlay__inner {
    width: 92%;
    max-width: 580px;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.wqb-search-form { display: flex; flex: 1; height: 56px; }
.wqb-search-input {
    flex: 1;
    border: none;
    padding: 0 20px;
    font-size: 16px;
    outline: none;
    background: transparent;
}
.wqb-search-submit {
    width: 56px;
    background: var(--wqb-h-accent);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wqb-search-submit svg { width: 20px; height: 20px; }
.wqb-search-close {
    width: 48px;
    height: 56px;
    background: transparent;
    border: none;
    color: #646970;
    font-size: 22px;
    cursor: pointer;
}

/* ── Footer ─────────────────────────────────────────────── */
.wqb-footer {
    background: #1a1a2e;
    color: rgba(255,255,255,.8);
    margin-top: auto;
    padding-top: 40px;
}
.wqb-footer__inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px 32px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}
@media (max-width: 640px) { .wqb-footer__inner { grid-template-columns: 1fr; gap: 24px; } }

.wqb-footer__brand p { font-size: 13px; margin: 8px 0 0; }
.wqb-footer__brand a { color: rgba(255,255,255,.7); text-decoration: none; }
.wqb-footer__brand a:hover { color: #fff; }
.wqb-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding-top: 4px;
}
.wqb-footer__nav a {
    color: rgba(255,255,255,.6);
    font-size: 13px;
    text-decoration: none;
    transition: color .15s;
}
.wqb-footer__nav a:hover { color: #fff; }
.wqb-footer__bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 14px 24px;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,.4);
}

/* ── Page wrap (full page template) ─────────────────────── */
.wqb-page-wrap {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}
.wqb-main {
    flex: 1;
    padding: 32px 24px;
    max-width: 1360px;
    margin: 0 auto;
    width: 100%;
}

/* ── Homepage / Store / Account: sin contenedor ─────────── */
.wqb-homepage-page .wqb-main,
.wqb-store-page .wqb-main,
.wqb-account-page .wqb-main {
    max-width: 100%;
    padding: 0;
    margin: 0;
    width: 100%;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
    .wqb-header .wqb-nav,
    .wqb-header__row--nav .wqb-nav,
    .wqb-header__row--modern-nav .wqb-nav { display: none; }
    .wqb-hamburger { display: inline-flex !important; }
    .wqb-header--centrado .wqb-header__row--nav { display: none; }
    .wqb-header--moderno .wqb-header__row--modern-nav { display: none; }
    .wqb-header--impactante .wqb-header__mid { display: none; }
    .wqb-hdr-cta { display: none; }
    .wqb-top-bar__left span:not(:first-child) { display: none; }

    .wqb-header__inner,
    .wqb-header__row--center,
    .wqb-header__row--modern-top {
        gap: 8px;
    }

    .wqb-header__actions {
        gap: 2px;
        margin-left: auto;
    }

    .wqb-header__actions .wqb-hdr-cta {
        display: none;
    }

    .wqb-hdr-btn-login {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 7px 10px;
        font-size: 12px;
        line-height: 1;
        min-height: 34px;
    }
}
@media (max-width: 480px) {
    .wqb-header__inner,
    .wqb-header__row { padding: 0 16px; }
    .wqb-top-bar { display: none; }
    .wqb-main { padding: 20px 16px; }
}

/* =========================================================
   Mobile header fit — evita que el botón menú salga de pantalla
   ========================================================= */
@media (max-width: 900px) {
    .wqb-header__inner,
    .wqb-header__row--center,
    .wqb-header__row--modern-top {
        width: 100%;
        max-width: 100%;
        padding-left: 12px;
        padding-right: 12px;
        gap: 6px;
        overflow: visible;
    }

    .wqb-logo {
        min-width: 0;
        max-width: 42vw;
        overflow: hidden;
    }

    .wqb-logo img {
        max-width: 100% !important;
        height: auto;
    }

    .wqb-logo--text span {
        display: block;
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 17px;
    }

    .wqb-header__actions {
        min-width: 0;
        flex-shrink: 1;
        margin-left: auto;
        gap: 1px;
    }

    .wqb-hdr-icon-btn {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    .wqb-hdr-icon-btn svg {
        width: 18px;
        height: 18px;
    }

    .wqb-hdr-btn-login {
        padding: 7px 8px;
        font-size: 11px;
        max-width: 72px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .wqb-hamburger {
        width: 40px;
        height: 40px;
        min-width: 40px;
        margin-left: 4px;
        flex-shrink: 0;
    }

    .wqb-hamburger span {
        width: 20px;
    }
}

@media (max-width: 420px) {
    .wqb-header__inner,
    .wqb-header__row--center,
    .wqb-header__row--modern-top {
        padding-left: 10px;
        padding-right: 10px;
    }

    .wqb-logo,
    .wqb-logo--text span {
        max-width: 36vw;
    }

    .wqb-header__actions .wqb-hdr-icon-btn:not(.wqb-cart-icon):not(.wqb-search-toggle) {
        display: none;
    }

    .wqb-hdr-btn-login {
        max-width: 64px;
        padding-left: 7px;
        padding-right: 7px;
    }

    .wqb-hamburger {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }
}
