/* ============================================================
   PORTAVIDA
   HEADER / NAVEGACIÓN PRINCIPAL
   ============================================================ */

:root {
    --pv-green-dark: #0d4f3c;
    --pv-green: #2f7d32;
    --pv-green-light: #69a82f;

    --pv-blue: #312db4;

    --pv-cream: #f8f5ee;
    --pv-white: #ffffff;

    --pv-text: #153f35;
    --pv-muted: #66746e;

    --pv-border: #dfe5da;

    --pv-radius: 18px;
    --pv-radius-small: 13px;

    --pv-shadow:
        0 10px 30px rgba(26, 65, 48, 0.08);
}


/* ============================================================
   CONTENEDOR GENERAL
   ============================================================ */

.pv-main-header {
    width: 100%;
    background: var(--pv-white);
    color: var(--pv-text);
    position: relative;
    z-index: 100;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;
}


/* ============================================================
   DESKTOP
   ============================================================ */

.pv-header-desktop {
    width: min(1440px, calc(100% - 40px));
    margin: 0 auto;

    min-height: 105px;

    display: flex;
    align-items: center;
    gap: 18px;

    background: var(--pv-white);
}


/* ============================================================
   LOGO
   ============================================================ */

.pv-header-logo {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    text-decoration: none;
}

.pv-header-logo img {
    display: block;

    width: auto;
    max-width: 225px;
    max-height: 64px;

    object-fit: contain;
}

.pv-header-logo-text {
    font-size: 31px;
    line-height: 1;
    font-weight: 800;

    letter-spacing: -1.2px;

    color: var(--pv-blue);
}

.pv-header-logo-text strong {
    color: var(--pv-green-light);
}


/* ============================================================
   PESTAÑAS
   ============================================================ */

.pv-header-tabs {
    display: flex;
    align-items: stretch;

    gap: 6px;

    flex: 1 1 auto;

    min-width: 0;
}


/* pestaña individual */

.pv-header-tab {
    min-width: 90px;
    min-height: 78px;

    padding: 8px 10px;

    border: 1px solid var(--pv-border);
    border-radius: var(--pv-radius-small);

    background: #fbfcf9;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 4px;

    color: var(--pv-text);

    text-decoration: none;

    transition:
        background 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.pv-header-tab:hover {
    background: #f2f7ee;

    border-color: #c8d7c2;

    color: var(--pv-green-dark);

    transform: translateY(-1px);

    box-shadow:
        0 5px 12px rgba(20, 65, 47, 0.08);
}


/* pestaña activa */

.pv-header-tab.is-active {
    color: #ffffff;

    background:
        linear-gradient(
            145deg,
            var(--pv-green-dark),
            var(--pv-green)
        );

    border-color: transparent;

    box-shadow:
        0 6px 16px rgba(13, 79, 60, 0.18);
}

.pv-header-tab.is-active:hover {
    color: #ffffff;
}


/* iconos */

.pv-header-tab-icon {
    width: 27px;
    height: 27px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.pv-header-tab-icon svg {
    width: 27px;
    height: 27px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* texto */

.pv-header-tab-label {
    max-width: 100px;

    text-align: center;

    font-size: 13px;
    font-weight: 600;
    line-height: 1.15;
}


/* ============================================================
   BUSCADOR
   ============================================================ */

.pv-header-search {
    width: 180px;
    height: 46px;

    flex: 0 0 auto;

    display: flex;
    align-items: center;

    padding: 0 12px;

    border: 1px solid var(--pv-border);
    border-radius: 14px;

    background: #fbfcf9;
}

.pv-header-search-icon {
    width: 21px;
    height: 21px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--pv-green-dark);

    flex: 0 0 auto;
}

.pv-header-search-icon svg {
    width: 21px;
    height: 21px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pv-header-search input[type="search"] {
    width: 100%;
    height: 42px;

    border: 0 !important;
    outline: 0 !important;

    padding: 0 0 0 8px;

    background: transparent !important;

    color: var(--pv-text);

    font-size: 13px;

    box-shadow: none !important;
}

.pv-header-search input[type="search"]::placeholder {
    color: #89958f;
}


/* ============================================================
   ACCIONES
   ============================================================ */

.pv-header-actions {
    display: flex;
    align-items: center;

    gap: 9px;

    flex: 0 0 auto;
}


/* cuenta / carrito */

.pv-header-action {
    width: 39px;
    height: 39px;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;

    color: var(--pv-green-dark);

    text-decoration: none;

    border-radius: 50%;

    transition:
        background 0.18s ease,
        color 0.18s ease;
}

.pv-header-action:hover {
    background: var(--pv-cream);

    color: var(--pv-green);
}

.pv-header-action svg {
    width: 25px;
    height: 25px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* contador carrito */

.pv-header-cart-count {
    position: absolute;

    top: -5px;
    right: -5px;

    min-width: 21px;
    height: 21px;

    padding: 0 5px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 30px;

    background: var(--pv-green);
    color: #ffffff;

    font-size: 11px;
    font-weight: 700;

    line-height: 1;
}


/* ============================================================
   BOTÓN PROGRAMA TU ENTREGA
   ============================================================ */

.pv-header-delivery {
    height: 52px;

    min-width: 188px;

    padding: 0 17px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    border-radius: 28px;

    background:
        linear-gradient(
            90deg,
            var(--pv-green),
            var(--pv-green-light)
        );

    color: #ffffff;

    text-decoration: none;

    font-size: 14px;
    font-weight: 700;

    box-shadow:
        0 7px 16px rgba(80, 138, 45, 0.17);

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.pv-header-delivery:hover {
    color: #ffffff;

    transform: translateY(-1px);

    box-shadow:
        0 9px 20px rgba(80, 138, 45, 0.23);
}

.pv-header-delivery-icon,
.pv-header-delivery-arrow {
    width: 20px;
    height: 20px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.pv-header-delivery svg {
    width: 20px;
    height: 20px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pv-header-delivery-arrow {
    width: 17px;
}


/* ============================================================
   MOBILE
   ============================================================ */

.pv-header-mobile {
    display: none;
}


/* ============================================================
   PANEL MOBILE
   ============================================================ */

.pv-mobile-overlay {
    position: fixed;

    inset: 0;

    background:
        rgba(13, 46, 37, 0.38);

    backdrop-filter: blur(2px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.22s ease,
        visibility 0.22s ease;

    z-index: 998;
}

.pv-mobile-overlay.is-open {
    opacity: 1;
    visibility: visible;
}


.pv-mobile-panel {
    position: fixed;

    top: 0;
    right: 0;

    width: min(390px, 92vw);
    height: 100vh;

    padding: 20px;

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fbfaf5 100%
        );

    box-shadow:
        -15px 0 35px rgba(21, 60, 48, 0.18);

    transform: translateX(105%);

    transition:
        transform 0.28s ease;

    overflow-y: auto;

    z-index: 999;
}

.pv-mobile-panel.is-open {
    transform: translateX(0);
}


/* cabecera panel */

.pv-mobile-panel-head {
    min-height: 60px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 18px;
}

.pv-mobile-panel-logo img {
    width: auto;
    max-width: 180px;
    max-height: 50px;
}

.pv-mobile-panel-logo .pv-header-logo-text {
    font-size: 28px;
}


.pv-mobile-close {
    width: 42px;
    height: 42px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: transparent;

    color: var(--pv-green-dark);

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
}

.pv-mobile-close:hover {
    background: var(--pv-cream);
}

.pv-mobile-close svg {
    width: 23px;
    height: 23px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
}


/* ============================================================
   PESTAÑAS MOBILE
   ============================================================ */

.pv-mobile-tabs {
    display: flex;
    flex-direction: column;

    gap: 7px;
}

.pv-mobile-tab {
    min-height: 55px;

    display: grid;

    grid-template-columns:
        34px
        1fr
        22px;

    align-items: center;

    gap: 9px;

    padding: 8px 13px;

    border: 1px solid var(--pv-border);
    border-radius: 16px;

    background: #ffffff;

    color: var(--pv-text);

    text-decoration: none;

    transition:
        background 0.18s ease,
        color 0.18s ease;
}

.pv-mobile-tab:hover {
    color: var(--pv-green-dark);

    background: #f5f8f2;
}

.pv-mobile-tab.is-active {
    color: #ffffff;

    border-color: transparent;

    background:
        linear-gradient(
            90deg,
            var(--pv-green-dark),
            var(--pv-green-light)
        );
}

.pv-mobile-tab-icon {
    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.pv-mobile-tab-icon svg {
    width: 26px;
    height: 26px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pv-mobile-tab-text {
    font-size: 15px;
    font-weight: 600;
}

.pv-mobile-tab-arrow {
    width: 19px;
    height: 19px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.pv-mobile-tab-arrow svg {
    width: 18px;
    height: 18px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ============================================================
   OPCIONES SECUNDARIAS MOBILE
   ============================================================ */

.pv-mobile-secondary {
    margin-top: 19px;
    padding-top: 16px;

    border-top: 1px solid var(--pv-border);

    display: flex;
    flex-direction: column;
}

.pv-mobile-secondary a {
    min-height: 48px;

    display: flex;
    align-items: center;

    gap: 13px;

    color: var(--pv-text);

    text-decoration: none;

    font-size: 15px;
    font-weight: 500;

    border-radius: 12px;

    padding: 5px 9px;
}

.pv-mobile-secondary a:hover {
    background: var(--pv-cream);
}

.pv-mobile-secondary svg {
    width: 23px;
    height: 23px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* botón pedir */

.pv-mobile-order-button {
    min-height: 55px;

    margin-top: 22px;

    padding: 0 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    border-radius: 28px;

    color: #ffffff;

    background:
        linear-gradient(
            90deg,
            var(--pv-green),
            var(--pv-green-light)
        );

    text-decoration: none;

    font-size: 17px;
    font-weight: 700;

    box-shadow:
        0 7px 18px rgba(61, 116, 42, 0.18);
}

.pv-mobile-order-button:hover {
    color: #ffffff;
}

.pv-mobile-order-button svg {
    width: 22px;
    height: 22px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1220px) {

    .pv-header-desktop {
        gap: 10px;
    }

    .pv-header-tab {
        min-width: 78px;
        padding-left: 7px;
        padding-right: 7px;
    }

    .pv-header-tab-label {
        font-size: 12px;
    }

    .pv-header-search {
        display: none;
    }

    .pv-header-delivery {
        min-width: 165px;
        padding-left: 14px;
        padding-right: 14px;
    }

}


@media (max-width: 900px) {

    .pv-header-desktop {
        display: none;
    }


    .pv-header-mobile {
        height: 72px;

        display: grid;

        grid-template-columns:
            55px
            1fr
            55px;

        align-items: center;

        width: 100%;

        padding: 0 16px;

        background: #ffffff;

        border-bottom:
            1px solid #edf0e9;

        box-shadow:
            0 5px 18px
            rgba(21, 63, 49, 0.06);
    }


    /* hamburguesa */

    .pv-mobile-menu-button {
        width: 44px;
        height: 44px;

        padding: 0;

        border: 0;
        border-radius: 50%;

        background: transparent;

        color: var(--pv-green-dark);

        display: flex;
        align-items: center;
        justify-content: center;

        cursor: pointer;
    }

    .pv-mobile-menu-button:hover {
        background: var(--pv-cream);
    }

    .pv-mobile-menu-button svg {
        width: 27px;
        height: 27px;

        fill: none;

        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
    }


    /* logo */

    .pv-mobile-logo {
        display: flex;
        align-items: center;
        justify-content: center;

        text-decoration: none;
    }

    .pv-mobile-logo img {
        width: auto;
        max-width: 175px;
        max-height: 52px;
    }

    .pv-mobile-logo .pv-header-logo-text {
        font-size: 25px;
    }


    /* carrito */

    .pv-mobile-cart {
        width: 44px;
        height: 44px;

        justify-self: end;

        display: flex;
        align-items: center;
        justify-content: center;

        position: relative;

        color: var(--pv-green-dark);

        text-decoration: none;
    }

    .pv-mobile-cart svg {
        width: 27px;
        height: 27px;

        fill: none;

        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

}


@media (max-width: 480px) {

    .pv-header-mobile {
        height: 66px;

        padding-left: 9px;
        padding-right: 9px;
    }

    .pv-mobile-logo img {
        max-width: 145px;
    }

    .pv-mobile-logo .pv-header-logo-text {
        font-size: 22px;
    }

    .pv-mobile-panel {
        width: 94vw;

        padding:
            18px
            14px
            24px;
    }

}

/* ============================================================
   AJUSTE PALETA BASE PORTAVIDA
   Solo colores del header / navegación.
   Fuerza la paleta propia por sobre estilos globales de Astra /
   Elementor que puedan colorear los enlaces.
   ============================================================ */

/* Pestañas inactivas: verde oscuro de la base */
.pv-main-header .pv-header-tab,
.pv-main-header .pv-header-tab:visited,
.pv-main-header .pv-header-tab:hover,
.pv-main-header .pv-header-tab:focus {
    color: var(--pv-green-dark) !important;
}

.pv-main-header .pv-header-tab-label,
.pv-main-header .pv-header-tab-icon {
    color: inherit !important;
}

/* Pestaña activa: fondo verde + texto e icono blancos */
.pv-main-header .pv-header-tab.is-active,
.pv-main-header .pv-header-tab.is-active:visited,
.pv-main-header .pv-header-tab.is-active:hover,
.pv-main-header .pv-header-tab.is-active:focus {
    color: #ffffff !important;
}

/* Cuenta y carrito: verde oscuro */
.pv-main-header .pv-header-action,
.pv-main-header .pv-header-action:visited,
.pv-main-header .pv-header-action:hover,
.pv-main-header .pv-header-action:focus {
    color: var(--pv-green-dark) !important;
}

/* Botón Programa tu entrega: texto e iconos blancos */
.pv-main-header .pv-header-delivery,
.pv-main-header .pv-header-delivery:visited,
.pv-main-header .pv-header-delivery:hover,
.pv-main-header .pv-header-delivery:focus {
    color: #ffffff !important;
}

.pv-main-header .pv-header-delivery span,
.pv-main-header .pv-header-delivery svg {
    color: inherit !important;
}

/* Móvil: misma paleta de BASE PORTAVIDA */
.pv-main-header .pv-mobile-menu-button,
.pv-main-header .pv-mobile-cart {
    color: var(--pv-green-dark) !important;
}

.pv-main-header .pv-mobile-tab,
.pv-main-header .pv-mobile-tab:visited,
.pv-main-header .pv-mobile-tab:hover,
.pv-main-header .pv-mobile-tab:focus {
    color: var(--pv-green-dark) !important;
}

.pv-main-header .pv-mobile-tab.is-active,
.pv-main-header .pv-mobile-tab.is-active:visited,
.pv-main-header .pv-mobile-tab.is-active:hover,
.pv-main-header .pv-mobile-tab.is-active:focus {
    color: #ffffff !important;
}

.pv-main-header .pv-mobile-order-button,
.pv-main-header .pv-mobile-order-button:visited,
.pv-main-header .pv-mobile-order-button:hover,
.pv-main-header .pv-mobile-order-button:focus {
    color: #ffffff !important;
}

/* ============================================================
   PROGRAMA TU ENTREGA - MODAL TEMPRANO
   Solo interfaz. La validación final sigue en checkout.
   ============================================================ */

body.pv-delivery-modal-open {
    overflow: hidden;
}

.pv-delivery-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.pv-delivery-modal.is-open {
    display: flex;
}

.pv-delivery-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 35, 27, 0.38);
    backdrop-filter: blur(2px);
}

.pv-delivery-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: calc(100vh - 44px);
    overflow-y: auto;
    padding: 24px;
    border: 1px solid #dfe6d8;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(23, 63, 45, 0.22);
}

.pv-delivery-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #f3f5ef;
    color: var(--pv-green-dark);
    cursor: pointer;
}

.pv-delivery-modal-close svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.pv-delivery-modal-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-right: 40px;
    margin-bottom: 18px;
}

.pv-delivery-modal-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #edf4e6;
    color: var(--pv-green-dark);
}

.pv-delivery-modal-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pv-delivery-modal-head h2 {
    margin: 0 0 3px;
    color: var(--pv-green-dark);
    font-size: 23px;
    line-height: 1.2;
    font-weight: 700;
}

.pv-delivery-modal-head p {
    margin: 0;
    color: #667468;
    font-size: 14px;
    line-height: 1.4;
}

.pv-delivery-field,
.pv-delivery-fieldset {
    margin: 0 0 16px;
}

.pv-delivery-field label,
.pv-delivery-fieldset legend {
    display: block;
    margin: 0 0 7px;
    padding: 0;
    color: var(--pv-green-dark);
    font-size: 15px;
    line-height: 1.3;
    font-weight: 700;
}

.pv-delivery-field input[type="date"] {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #cad5c3;
    border-radius: 11px;
    background: #fff;
    color: var(--pv-green-dark);
    font: inherit;
}

.pv-delivery-prep-note {
    display: block;
    margin-top: 6px;
    color: #6b776d;
    font-size: 12px;
    line-height: 1.35;
}

.pv-delivery-fieldset {
    min-width: 0;
    padding: 0;
    border: 0;
}

.pv-delivery-choice-grid {
    display: grid;
    gap: 9px;
}

.pv-delivery-choice-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pv-delivery-choice-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pv-delivery-choice {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.pv-delivery-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pv-delivery-choice span {
    min-height: 44px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cad5c3;
    border-radius: 11px;
    background: #fff;
    color: var(--pv-green-dark);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    transition: .16s ease;
}

.pv-delivery-choice:hover span {
    border-color: var(--pv-green);
}

.pv-delivery-choice input:checked + span {
    border-color: var(--pv-green-dark);
    background: var(--pv-green-dark);
    color: #fff;
    box-shadow: inset 0 0 0 1px var(--pv-green-dark);
}

.pv-delivery-modal-error {
    min-height: 18px;
    margin: -3px 0 8px;
    color: #9b2c2c;
    font-size: 13px;
}

.pv-delivery-confirm {
    width: 100%;
    min-height: 46px;
    padding: 10px 18px;
    border: 0;
    border-radius: 23px;
    background: var(--pv-green);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.pv-delivery-confirm:hover,
.pv-delivery-confirm:focus {
    background: var(--pv-green-dark);
    color: #fff;
}

.pv-header-delivery.has-programming .pv-header-delivery-text {
    font-size: 12.5px;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .pv-delivery-modal {
        align-items: flex-end;
        padding: 0;
    }

    .pv-delivery-dialog {
        width: 100%;
        max-height: 88vh;
        padding: 20px 16px 18px;
        border-radius: 22px 22px 0 0;
    }

    .pv-delivery-modal-head h2 {
        font-size: 21px;
    }

    .pv-delivery-choice-grid--three {
        grid-template-columns: 1fr;
    }

    .pv-delivery-choice-grid--three .pv-delivery-choice span {
        min-height: 40px;
    }
}


/* Mensaje visible cuando la fecha fue cerrada desde Portavida > Configuración. */
.pv-delivery-date-closed-message {
    display: block;
    margin-top: 7px;
    padding: 8px 10px;
    border: 1px solid #efc8c0;
    border-radius: 9px;
    background: #fff7f5;
    color: #a23b2d;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 600;
}

.pv-delivery-date-closed-message[hidden] {
    display: none;
}
