/* =============================================
   PORTAL — Header y footer compartidos
   Se carga en todas las páginas del portal.
   ============================================= */

/* El reset de mayorista.css achica las imágenes: el logo necesita su tamaño propio */
body.mayorista-body .mh-logo-img { height: 44px !important; width: auto !important; max-width: none !important; }
body.mayorista-body .pf-logo { width: 120px !important; height: auto !important; max-width: none !important; max-height: none !important; }

/* ════════════════════════════════════
   HEADER
════════════════════════════════════ */
body.mayorista-body .mh {
    background: #fff;
    border-bottom: 1px solid #E6E7EA;
    position: sticky;
    top: 0;
    z-index: 200;
}
body.mayorista-body .mh-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

body.mayorista-body .mh-logo { flex-shrink: 0; display: flex; align-items: center; }
body.mayorista-body .mh-logo-txt {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--cc-carbon);
    letter-spacing: -.03em;
}

/* Navegación */
body.mayorista-body .mh-nav { display: flex; align-items: center; gap: .15rem; margin-left: 1rem; }
body.mayorista-body .mh-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .8rem;
    border-radius: 8px;
    color: #3F434A;
    font-size: .92rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color .15s, background .15s;
}
body.mayorista-body .mh-nav-link:hover { color: var(--cc-carbon); background: #F3F4F6; }
body.mayorista-body .mh-nav-link.is-active { color: var(--cc-naranja); font-weight: 600; }
body.mayorista-body .mh-nav-link.is-active::after {
    content: '';
    position: absolute;
    left: .8rem; right: .8rem; bottom: .1rem;
    height: 2px;
    border-radius: 2px;
    background: var(--cc-naranja);
}
body.mayorista-body .mh-nav-wa svg { width: 16px; height: 16px; flex-shrink: 0; color: #1A8F4D; }

/* Lado derecho */
body.mayorista-body .mh-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }

body.mayorista-body .mh-redes { display: flex; align-items: center; gap: .15rem; margin-right: .4rem; }
body.mayorista-body .mh-red {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #6B7078;
    transition: color .15s, background .15s;
}
body.mayorista-body .mh-red:hover { color: var(--cc-carbon); background: #F3F4F6; }
body.mayorista-body .mh-red svg { width: 17px; height: 17px; display: block; }

body.mayorista-body .mh-carrito {
    position: relative;
    width: 40px; height: 40px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #3F434A;
    border: 1px solid #E6E7EA;
    transition: color .15s, border-color .15s, background .15s;
    flex-shrink: 0;
}
body.mayorista-body .mh-carrito:hover,
body.mayorista-body .mh-carrito.is-active { color: var(--cc-naranja); border-color: rgba(232,114,45,.45); background: #FFF8F3; }
body.mayorista-body .mh-carrito svg { width: 19px; height: 19px; }
body.mayorista-body .mh-carrito-badge {
    position: absolute;
    top: -6px; right: -6px;
    min-width: 19px; height: 19px;
    padding: 0 5px;
    border-radius: 10px;
    border: 2px solid #fff;
    background: var(--cc-naranja);
    color: #fff;
    font-size: .66rem;
    font-weight: 700;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
body.mayorista-body .mh-carrito-badge[hidden] { display: none; }

/* Cuenta */
body.mayorista-body .mh-cuenta { position: relative; }
body.mayorista-body .mh-cuenta-btn {
    display: flex; align-items: center; gap: .45rem;
    height: 40px;
    padding: 0 .7rem 0 .6rem;
    border: 1px solid #E6E7EA;
    border-radius: 8px;
    background: #fff;
    color: #3F434A;
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s, background .15s;
}
body.mayorista-body .mh-cuenta-btn:hover { border-color: #CBCED4; background: #F9FAFB; }
body.mayorista-body .mh-cuenta-btn > svg:first-child { width: 20px; height: 20px; flex-shrink: 0; }
body.mayorista-body .mh-cuenta-chevron { width: 18px; height: 18px; flex-shrink: 0; transition: transform .2s; }
body.mayorista-body .mh-cuenta-btn[aria-expanded="true"] .mh-cuenta-chevron { transform: rotate(180deg); }

body.mayorista-body .mh-cuenta-drop {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 230px;
    display: none;
    overflow: hidden;
    z-index: 300;
    background: #fff;
    border: 1px solid #E6E7EA;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(17,24,39,.12);
}
body.mayorista-body .mh-cuenta-drop.is-open { display: block; animation: mhDropIn .15s ease; }
@keyframes mhDropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

body.mayorista-body .mh-cuenta-drop-header {
    display: flex; flex-direction: column; gap: .15rem;
    padding: .95rem 1rem;
    border-bottom: 1px solid #F0F1F3;
}
body.mayorista-body .mh-cuenta-drop-header strong { font-size: .92rem; color: var(--cc-carbon); }
body.mayorista-body .mh-cuenta-drop-header span { font-size: .78rem; color: #6B7078; overflow-wrap: anywhere; }

body.mayorista-body .mh-cuenta-drop-link {
    display: flex; align-items: center; gap: .65rem;
    width: 100%;
    padding: .7rem 1rem;
    border: none;
    background: none;
    color: #3F434A;
    font-family: inherit;
    font-size: .9rem;
    text-align: left;
    cursor: pointer;
    transition: background .15s, color .15s;
}
body.mayorista-body .mh-cuenta-drop-link:hover { background: #F9FAFB; color: var(--cc-naranja); }
body.mayorista-body .mh-cuenta-drop-link svg { width: 18px; height: 18px; flex-shrink: 0; }
body.mayorista-body .mh-logout { color: #B42318; }
body.mayorista-body .mh-logout:hover { background: #FEF3F2; color: #912018; }

/* Botón ingresar */
body.mayorista-body .mh-btn-registro {
    display: inline-flex; align-items: center;
    height: 40px;
    padding: 0 1.15rem;
    border-radius: 8px;
    background: var(--cc-carbon);
    color: #fff;
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .15s;
}
body.mayorista-body .mh-btn-registro:hover { background: #000; color: #fff; }

/* Hamburguesa (mobile) */
body.mayorista-body .mh-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px; height: 40px;
    margin-left: auto;
    padding: 9px;
    border: none;
    background: none;
    cursor: pointer;
    flex-shrink: 0;
}
body.mayorista-body .mh-hamburger span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: #3F434A;
    transition: transform .25s, opacity .2s;
}
body.mayorista-body .mh-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.mayorista-body .mh-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
body.mayorista-body .mh-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

body.mayorista-body .mh-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(17,24,39,.48);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
body.mayorista-body .mh-overlay.is-open { display: block; }

/* Menú mobile */
body.mayorista-body .mh-mobile-menu {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    max-height: calc(100svh - 68px);
    overflow-y: auto;
    background: #fff;
    border-top: 1px solid #E6E7EA;
    box-shadow: 0 16px 32px rgba(17,24,39,.14);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}
body.mayorista-body .mh-mobile-menu.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear 0s;
}

body.mayorista-body .mhm-user {
    display: flex; align-items: center; gap: .85rem;
    padding: 1.1rem 1.25rem;
    background: #F9FAFB;
    border-bottom: 1px solid #F0F1F3;
}
body.mayorista-body .mhm-user-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--cc-naranja);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}
body.mayorista-body .mhm-user-info { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
body.mayorista-body .mhm-user-info strong { font-size: .92rem; color: var(--cc-carbon); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.mayorista-body .mhm-user-info span { font-size: .78rem; color: #6B7078; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

body.mayorista-body .mhm-sep { height: 1px; margin: .3rem 1.25rem; background: #F0F1F3; }

body.mayorista-body .mhm-link {
    display: flex; align-items: center; gap: .75rem;
    width: 100%;
    padding: .85rem 1.25rem;
    border: none;
    border-left: 3px solid transparent;
    background: none;
    color: #3F434A;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: color .15s, background .15s, border-color .15s;
}
body.mayorista-body .mhm-link svg { width: 20px; height: 20px; flex-shrink: 0; opacity: .65; }
body.mayorista-body .mhm-link:hover { color: var(--cc-naranja); background: #FFF8F3; border-left-color: rgba(232,114,45,.4); }
body.mayorista-body .mhm-link:hover svg,
body.mayorista-body .mhm-link.is-active svg { opacity: 1; }
body.mayorista-body .mhm-link.is-active { color: var(--cc-naranja); background: #FFF8F3; border-left-color: var(--cc-naranja); font-weight: 600; }
body.mayorista-body .mhm-link-wa { color: #1A8F4D; }
body.mayorista-body .mhm-link-wa:hover { color: #126C3B; background: #F0FAF4; border-left-color: rgba(26,143,77,.45); }
body.mayorista-body .mhm-link-reg { color: var(--cc-naranja); font-weight: 600; }
body.mayorista-body .mhm-link-reg svg { opacity: 1; }
body.mayorista-body .mhm-logout { color: #B42318; }
body.mayorista-body .mhm-logout:hover { color: #912018; background: #FEF3F2; border-left-color: rgba(180,35,24,.4); }

@media (max-width: 768px) {
    body.mayorista-body .mh-nav,
body.mayorista-body .mh-redes,
body.mayorista-body .mh-cuenta,
body.mayorista-body .mh-btn-registro { display: none; }
    body.mayorista-body .mh-hamburger { display: flex; }
    body.mayorista-body .mh-inner { gap: .75rem; }
    body.mayorista-body .mh-right { margin-left: auto; }
    body.mayorista-body .mh-hamburger { margin-left: 0; }
}
@media (max-width: 420px) {
    body.mayorista-body .mh-logo-img { height: 36px !important; }
}

/* ════════════════════════════════════
   FOOTER
════════════════════════════════════ */
body.mayorista-body .pf {
    margin-top: 3.5rem;
    background: #131417;
    color: rgba(255,255,255,.62);
    font-size: .92rem;
    line-height: 1.65;
}
body.mayorista-body .pf-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 3rem 2rem 2.25rem;
    display: grid;
    grid-template-columns: 240px 1fr 1.8fr;
    gap: 0 5rem;
    align-items: start;
}
/* Según lo que esté configurado, el footer tiene 1 a 3 columnas */
body.mayorista-body .pf-inner:not(:has(.pf-mapa-col)) { grid-template-columns: 240px 1fr; }
body.mayorista-body .pf-inner:not(:has(.pf-info)) { grid-template-columns: 240px 1.8fr; }
body.mayorista-body .pf-inner:not(:has(.pf-info)):not(:has(.pf-mapa-col)) { grid-template-columns: 1fr; }

body.mayorista-body .pf-marca { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .9rem; }
body.mayorista-body .pf-marca-logo { display: flex; justify-content: center; align-items: center; width: 100%; }
body.mayorista-body .pf-logo { display: block; object-fit: contain; filter: brightness(0) invert(1); }
body.mayorista-body .pf-nombre-text { font-size: 1.3rem; font-weight: 800; color: #fff; letter-spacing: -.03em; line-height: 1.1; }
body.mayorista-body .pf-tagline { margin: 0; font-size: .65rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.4); }
body.mayorista-body .pf-data-fiscal { margin-top: .4rem; }
body.mayorista-body .pf-fiscal-img { display: block; width: 56px; height: auto; margin: 0 auto; opacity: .9; transition: opacity .2s; }
body.mayorista-body .pf-fiscal-img:hover { opacity: 1; }

body.mayorista-body .pf-redes { display: flex; justify-content: center; gap: .5rem; margin-top: .25rem; }
body.mayorista-body .pf-red {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.18);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.7);
    flex-shrink: 0;
    transition: color .2s, background .2s, border-color .2s;
}
body.mayorista-body .pf-red:hover { color: #131417; background: #fff; border-color: #fff; }
body.mayorista-body .pf-red svg { width: 15px; height: 15px; display: block; }

body.mayorista-body .pf-info { display: flex; flex-direction: column; gap: 2rem; padding-top: .1rem; }
body.mayorista-body .pf-titulo {
    margin: 0 0 .9rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .18em !important;
    text-transform: uppercase !important;
    color: #fff !important;
}
body.mayorista-body .pf-lista { display: flex; flex-direction: column; gap: .7rem; }
body.mayorista-body .pf-lista li { display: flex; align-items: flex-start; gap: .65rem; }
body.mayorista-body .pf-lista a { color: rgba(255,255,255,.7); transition: color .2s; }
body.mayorista-body .pf-lista a:hover { color: #fff; }
body.mayorista-body .pf-icon { width: 15px; height: 15px; min-width: 15px; margin-top: .28rem; color: rgba(255,255,255,.35); }
body.mayorista-body .pf-icon-wa { color: #25D366; }
body.mayorista-body .pf-icon-mail { color: var(--cc-naranja); }
body.mayorista-body .pf-horarios { display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; color: rgba(255,255,255,.58); }

body.mayorista-body .pf-mapa-col { padding-top: .1rem; }
body.mayorista-body .pf-mapa {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: .9rem 0 .5rem;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.1);
}
body.mayorista-body .pf-mapa iframe { width: 100%; height: 100%; border: none; display: block; filter: grayscale(25%) brightness(.95); }
body.mayorista-body .pf-mapa-txt { margin: 0; font-size: .78rem; line-height: 1.4; color: rgba(255,255,255,.4); }

body.mayorista-body .pf-legal {
    padding: 1.1rem 2rem;
    border-top: 1px solid rgba(255,255,255,.07);
    text-align: center;
    font-size: .76rem;
    letter-spacing: .04em;
    color: rgba(255,255,255,.35);
}

@media (max-width: 860px) {
    body.mayorista-body .pf-inner,
body.mayorista-body .pf-inner:not(:has(.pf-mapa-col)),
body.mayorista-body .pf-inner:not(:has(.pf-info)),
body.mayorista-body .pf-inner:not(:has(.pf-info)):not(:has(.pf-mapa-col)) {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
        padding: 3rem 1.5rem 2.5rem;
    }
    body.mayorista-body .pf-marca { grid-column: 1 / -1; padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,.08); }
    body.mayorista-body .pf-mapa-col { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
    body.mayorista-body .pf-inner,
body.mayorista-body .pf-inner:not(:has(.pf-mapa-col)),
body.mayorista-body .pf-inner:not(:has(.pf-info)),
body.mayorista-body .pf-inner:not(:has(.pf-info)):not(:has(.pf-mapa-col)) {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 2rem 1.5rem 1.5rem;
    }
    body.mayorista-body .pf-marca { gap: .75rem; padding-bottom: 1.75rem; }
    body.mayorista-body .pf-info { padding: 1.75rem 0; border-top: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.08); }
    body.mayorista-body .pf-mapa-col { padding-top: 1.75rem; }
}
