/*
 * ==============================================================
 * PORTAVIDA – HOME RESPONSIVE / PROPORCIONES PROFESIONALES
 * ==============================================================
 *
 * OBJETIVO
 * - Mantener la estructura actual de la Home.
 * - Reducir escala, alturas, padding y espacios sobredimensionados.
 * - Acercar la página al diseño visual aprobado.
 * - Diseñar desde el inicio para escritorio, tablet y celular.
 * - Este archivo es SOLO PRESENTACIÓN. No contiene lógica comercial.
 *
 * GUÍA DE IMÁGENES (referencia oficial Portavida)
 * --------------------------------------------------------------
 * PRODUCTOS
 *   Ideal:       1200 x 900 px
 *   Proporción:  4:3
 *   Formato web: WebP preferentemente (JPG aceptable)
 *   Peso objetivo: 150–250 KB aprox.
 *   Uso: tarjetas, carruseles y Single Product.
 *
 * SABORES
 *   Ideal:       300 x 300 px
 *   Proporción:  1:1
 *   Uso: popup / selector de sabores.
 *
 * HERO
 *   Ideal:       1920 x 800 px aprox.
 *   Proporción:  panorámica
 *   Recomendación: mantener el sujeto principal en zona central
 *   para tolerar recortes en tablet/celular.
 *
 * BREAKPOINTS DE DISEÑO
 * --------------------------------------------------------------
 * Escritorio: > 1024 px   → 4 productos visibles
 * Tablet:     768–1024 px → 2–3 productos visibles
 * Celular:    < 768 px    → 2 productos visibles
 *
 * REGLA VISUAL
 * Responsive + proporcional + compacto. Evitar botones, tarjetas,
 * títulos o espacios gigantes. Priorizar densidad equilibrada.
 * ==============================================================
 */

/* ==============================================================
   PALETA LOCAL DE HOME
   No se cambian aquí checkout ni pantallas administrativas.
   ============================================================= */
.pv-main-header,
.pv-hero,
body.portavida .pv-category {
    --pv-home-ink: #173f2d;
    --pv-home-green: #528737;
    --pv-home-cream: #f7f5ef;
    --pv-home-border: #dce3d7;
    --pv-home-muted: #64716a;
}

/* ==============================================================
   HEADER – ESCRITORIO
   Compactamos sin cambiar estructura ni iconos.
   ============================================================= */
@media (min-width: 901px) {
    .pv-header-desktop {
        width: min(1240px, calc(100% - 32px));
        min-height: 78px;
        gap: 9px;
    }

    .pv-header-logo img {
        max-width: 168px;
        max-height: 46px;
    }

    .pv-header-logo-text {
        font-size: 26px;
        letter-spacing: -0.8px;
    }

    .pv-header-tabs {
        gap: 4px;
    }

    .pv-header-tab {
        min-width: 76px;
        min-height: 60px;
        padding: 6px 7px;
        gap: 3px;
        border-radius: 11px;
    }

    .pv-header-tab-icon,
    .pv-header-tab-icon svg {
        width: 22px;
        height: 22px;
    }

    .pv-header-tab-label {
        max-width: 88px;
        font-size: 11.5px;
        line-height: 1.12;
    }

    .pv-header-search {
        width: 145px;
        height: 39px;
        padding: 0 10px;
        border-radius: 11px;
    }

    .pv-header-search input[type="search"] {
        height: 37px;
        font-size: 12px;
    }

    .pv-header-search-icon,
    .pv-header-search-icon svg {
        width: 18px;
        height: 18px;
    }

    .pv-header-actions {
        gap: 5px;
    }

    .pv-header-action {
        width: 35px;
        height: 35px;
    }

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

    .pv-header-cart-count {
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        font-size: 10px;
    }

    .pv-header-delivery {
        min-width: 154px;
        height: 42px;
        padding: 0 13px;
        gap: 7px;
        border-radius: 22px;
        font-size: 12.5px;
    }

    .pv-header-delivery-icon,
    .pv-header-delivery svg {
        width: 18px;
        height: 18px;
    }
}

/* Ajuste intermedio para notebooks / desktop angosto. */
@media (min-width: 901px) and (max-width: 1220px) {
    .pv-header-desktop {
        width: min(1100px, calc(100% - 24px));
        gap: 6px;
    }

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

    .pv-header-tab {
        min-width: 68px;
        padding-inline: 5px;
    }

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

    .pv-header-delivery {
        min-width: 142px;
        padding-inline: 10px;
    }
}

/* ==============================================================
   HEADER – TABLET / CELULAR
   Se conserva el header móvil existente, pero menos alto/pesado.
   ============================================================= */
@media (max-width: 900px) {
    .pv-header-mobile {
        height: 60px;
        grid-template-columns: 48px 1fr 48px;
        padding: 0 12px;
        box-shadow: 0 3px 12px rgba(21, 63, 49, 0.05);
    }

    .pv-mobile-menu-button,
    .pv-mobile-cart {
        width: 38px;
        height: 38px;
    }

    .pv-mobile-menu-button svg,
    .pv-mobile-cart svg {
        width: 23px;
        height: 23px;
    }

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

    .pv-mobile-panel {
        width: min(360px, 92vw);
        padding: 16px;
    }

    .pv-mobile-panel-head {
        min-height: 50px;
        margin-bottom: 12px;
    }

    .pv-mobile-panel-logo img {
        max-width: 150px;
        max-height: 42px;
    }

    .pv-mobile-close {
        width: 36px;
        height: 36px;
    }

    .pv-mobile-tabs {
        gap: 6px;
    }

    .pv-mobile-tab {
        min-height: 48px;
        grid-template-columns: 29px 1fr 19px;
        gap: 8px;
        padding: 6px 11px;
        border-radius: 13px;
    }

    .pv-mobile-tab-icon,
    .pv-mobile-tab-icon svg {
        width: 24px;
        height: 24px;
    }

    .pv-mobile-tab-text {
        font-size: 13.5px;
    }

    .pv-mobile-secondary {
        margin-top: 14px;
        padding-top: 12px;
    }

    .pv-mobile-secondary a {
        min-height: 42px;
        font-size: 13.5px;
    }

    .pv-mobile-order-button {
        min-height: 46px;
        margin-top: 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .pv-header-mobile {
        height: 56px;
        padding-inline: 8px;
    }

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

/* ==============================================================
   HERO – MÁS BAJO Y PROPORCIONAL
   ============================================================= */
@media (min-width: 1025px) {
    .pv-hero {
        width: min(1240px, calc(100% - 32px));
        margin-bottom: 6px;
    }

    .pv-hero-main {
        min-height: 205px;
        grid-template-columns: minmax(350px, 40%) minmax(0, 60%);
    }

    .pv-hero-content {
        padding: 18px 22px 18px 40px;
    }

    .pv-hero-kicker {
        margin-bottom: 5px;
        font-size: 10px;
        letter-spacing: 3.2px;
    }

    .pv-hero-title {
        font-size: clamp(36px, 3.3vw, 47px);
        line-height: .96;
        letter-spacing: -1.3px;
    }

    .pv-hero-line {
        margin: 8px 0 7px;
    }

    .pv-hero-description {
        max-width: 390px;
        margin-bottom: 10px;
        font-size: 13.5px;
        line-height: 1.28;
    }

    .pv-hero-button {
        min-height: 36px;
        padding-inline: 14px;
        font-size: 12.5px;
    }

    .pv-hero-image img {
        min-height: 205px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .pv-hero {
        width: min(960px, calc(100% - 24px));
    }

    .pv-hero-main {
        min-height: 190px;
        grid-template-columns: 46% 54%;
    }

    .pv-hero-content {
        padding: 16px 14px 15px 24px;
    }

    .pv-hero-title {
        font-size: 34px;
    }

    .pv-hero-description {
        font-size: 12.5px;
        margin-bottom: 9px;
    }

    .pv-hero-image img {
        min-height: 190px;
    }
}

@media (max-width: 767px) {
    .pv-hero-main {
        min-height: 172px;
        grid-template-columns: 60% 40%;
    }

    .pv-hero-content {
        padding: 13px 0 12px 14px;
    }

    .pv-hero-kicker {
        margin-bottom: 4px;
        font-size: 7.5px;
        letter-spacing: 2.2px;
    }

    .pv-hero-title {
        width: 200px;
        font-size: 27px;
        letter-spacing: -0.8px;
    }

    .pv-hero-line {
        width: 30px;
        margin: 6px 0;
    }

    .pv-hero-description {
        width: 185px;
        margin-bottom: 8px;
        font-size: 10.5px;
        line-height: 1.22;
    }

    .pv-hero-button {
        width: 190px;
        min-height: 32px;
        padding-inline: 10px;
        font-size: 11px;
    }

    .pv-hero-image img {
        min-height: 172px;
        height: 172px;
    }
}

/* ==============================================================
   SECCIONES / CARRUSELES
   Menos espacio exterior y títulos más finos.
   ============================================================= */
body.portavida .pv-category {
    padding: 26px 18px 30px !important;
}

body.portavida .pv-category > .e-con-inner {
    max-width: 1240px !important;
    gap: 16px !important;
}

body.portavida .pv-category .pv-category-title .elementor-heading-title {
    font-size: clamp(25px, 2.5vw, 32px) !important;
    line-height: 1.12 !important;
    letter-spacing: -.4px !important;
}

body.portavida .pv-product-carousel .swiper {
    padding-bottom: 17px !important;
}

body.portavida .pv-product-carousel .swiper-slide {
    padding: 5px !important;
}

body.portavida .pv-product-carousel .swiper-slide > .e-con {
    padding: 14px 13px !important;
    gap: 10px !important;
    border-radius: 17px !important;
    box-shadow: 0 4px 12px rgba(23, 63, 45, .045) !important;
}

/* Foto principal de tarjeta: estándar 4:3. */
body.portavida .pv-product-carousel :is(.pv-product-image, .elementor-widget-image) img {
    width: 100% !important;
    aspect-ratio: 4 / 3 !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 12px !important;
}

body.portavida .pv-product-carousel .pv-product-title .elementor-heading-title {
    font-size: 19px !important;
    line-height: 1.15 !important;
    min-height: 44px !important;
    letter-spacing: -.25px !important;
}

body.portavida .pv-product-carousel .pv-product-price .price {
    font-size: 21px !important;
    line-height: 1.15 !important;
}

body.portavida .pv-product-carousel .pv-size-selector {
    gap: 5px !important;
}

body.portavida .pv-product-carousel .pv-size-selector .elementor-button {
    min-height: 35px !important;
    padding: 7px 3px !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
}

body.portavida .pv-product-carousel .pv-flavor-button {
    padding-top: 2px !important;
}

body.portavida .pv-product-carousel .pv-flavor-button .elementor-button {
    min-height: 40px !important;
    padding: 9px 8px !important;
    border-radius: 9px !important;
    font-size: 13px !important;
}

body.portavida .pv-product-carousel .elementor-swiper-button {
    width: 34px !important;
    height: 34px !important;
    padding: 8px !important;
}

body.portavida .pv-product-carousel .elementor-swiper-button svg {
    width: 15px !important;
    height: 15px !important;
}

/* ==============================================================
   TABLET
   ============================================================= */
@media (min-width: 768px) and (max-width: 1024px) {
    body.portavida .pv-category {
        padding: 22px 14px 26px !important;
    }

    body.portavida .pv-category > .e-con-inner {
        gap: 14px !important;
    }

    body.portavida .pv-category .pv-category-title .elementor-heading-title {
        font-size: 27px !important;
    }

    body.portavida .pv-product-carousel .swiper-slide > .e-con {
        padding: 13px 12px !important;
        gap: 9px !important;
    }

    body.portavida .pv-product-carousel .pv-product-title .elementor-heading-title {
        font-size: 18px !important;
        min-height: 42px !important;
    }
}

/* ==============================================================
   CELULAR – 2 PRODUCTOS VISIBLES
   Las dimensiones están pensadas para dos tarjetas reales, no para
   achicar una tarjeta desktop gigantesca.
   ============================================================= */
@media (max-width: 767px) {
    body.portavida .pv-category {
        padding: 18px 7px 22px !important;
    }

    body.portavida .pv-category > .e-con-inner {
        gap: 11px !important;
    }

    body.portavida .pv-category .pv-category-title .elementor-heading-title {
        font-size: 23px !important;
    }

    body.portavida .pv-product-carousel .swiper {
        padding-bottom: 14px !important;
    }

    body.portavida .pv-product-carousel .swiper-slide {
        padding: 3px !important;
    }

    body.portavida .pv-product-carousel .swiper-slide > .e-con {
        padding: 9px 8px !important;
        gap: 7px !important;
        border-radius: 14px !important;
    }

    body.portavida .pv-product-carousel :is(.pv-product-image, .elementor-widget-image) img {
        border-radius: 9px !important;
    }

    body.portavida .pv-product-carousel .pv-product-title .elementor-heading-title {
        font-size: 15.5px !important;
        line-height: 1.12 !important;
        min-height: 35px !important;
    }

    body.portavida .pv-product-carousel .pv-product-price .price {
        font-size: 17px !important;
    }

    body.portavida .pv-product-carousel .pv-size-selector {
        gap: 3px !important;
    }

    body.portavida .pv-product-carousel .pv-size-selector .elementor-button {
        min-height: 31px !important;
        padding: 5px 1px !important;
        border-radius: 7px !important;
        font-size: 11.5px !important;
    }

    body.portavida .pv-product-carousel .pv-flavor-button .elementor-button {
        min-height: 35px !important;
        padding: 7px 5px !important;
        border-radius: 8px !important;
        font-size: 11.5px !important;
        line-height: 1.2 !important;
    }

    body.portavida .pv-product-carousel .elementor-swiper-button {
        width: 30px !important;
        height: 30px !important;
        padding: 7px !important;
    }
}

/* Teléfonos muy estrechos: seguimos usando dos tarjetas, pero damos
   un poco más de aire al texto y evitamos desbordes. */
@media (max-width: 360px) {
    body.portavida .pv-product-carousel .swiper-slide > .e-con {
        padding-inline: 6px !important;
    }

    body.portavida .pv-product-carousel .pv-product-title .elementor-heading-title {
        font-size: 14.5px !important;
    }

    body.portavida .pv-product-carousel .pv-size-selector .elementor-button,
    body.portavida .pv-product-carousel .pv-flavor-button .elementor-button {
        font-size: 10.5px !important;
    }
}

/* ==============================================================
   HOME REAL – CARRUSEL DEL CATÁLOGO PORTAVIDA
   --------------------------------------------------------------
   La Home actual usa el carrusel propio de Portavida Commerce
   (.pv-home-catalogo / .pv-catalog-card), no el Loop Carousel
   antiguo de Elementor. Estos estilos son únicamente visuales.

   Regla Portavida:
   - Escritorio: 4 tarjetas proporcionadas.
   - Tablet: 3 tarjetas (2 en tablet angosta).
   - Celular: 2 tarjetas.
   - Foto producto: 4:3.
   - Nada gigante: alturas, textos y botones compactos.
   ============================================================== */

body .pv-home-catalogo {
    max-width: 1280px !important;
    margin-inline: auto !important;
    padding: 10px 18px 28px !important;
}

body .pv-home-catalogo .pv-catalog-section {
    margin-bottom: 22px !important;
}

body .pv-home-catalogo .pv-catalog-section-heading {
    margin-bottom: 10px !important;
}

body .pv-home-catalogo .pv-catalog-section-heading h2 {
    font-size: clamp(25px, 2.2vw, 31px) !important;
    line-height: 1.08 !important;
}

body .pv-home-catalogo .pv-catalog-section-subtitle {
    margin-top: 4px !important;
    font-size: 13px !important;
}

body .pv-home-catalogo .pv-product-carousel {
    grid-auto-columns: calc((100% - 36px) / 4) !important;
    gap: 12px !important;
    align-items: start !important;
    padding: 2px 2px 8px !important;
}

body .pv-home-catalogo .pv-catalog-card {
    height: auto !important;
    min-height: 0 !important;
    align-self: start !important;
    border-radius: 15px !important;
    box-shadow: 0 3px 10px rgba(23, 63, 45, .065) !important;
}

body .pv-home-catalogo .pv-catalog-card-image,
body .pv-home-catalogo .pv-catalog-card:not(:has(.pv-catalog-card-image))::before {
    width: 100% !important;
    aspect-ratio: 4 / 3 !important;
    background: #f1f2ed !important;
}

/* Mantiene una proporción limpia aunque el producto aún no tenga foto. */
body .pv-home-catalogo .pv-catalog-card:not(:has(.pv-catalog-card-image))::before {
    content: "";
    display: block;
    border-bottom: 1px solid #edf0ea;
    background:
        radial-gradient(circle at 50% 42%, rgba(82,135,55,.10) 0 10%, transparent 10.5%),
        linear-gradient(135deg, #f7f5ef 0%, #eef2e9 100%) !important;
}

body .pv-home-catalogo .pv-catalog-card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
}

body .pv-home-catalogo .pv-catalog-card-body {
    padding: 9px 10px 10px !important;
}

body .pv-home-catalogo h3.pv-catalog-card-title {
    min-height: 34px !important;
    margin: 0 0 4px !important;
}

body .pv-home-catalogo h3.pv-catalog-card-title,
body .pv-home-catalogo h3.pv-catalog-card-title a {
    font-family: Georgia, "Times New Roman", serif !important;
    font-size: 17px !important;
    font-weight: 500 !important;
    line-height: 1.12 !important;
    color: #173f2d !important;
}

body .pv-home-catalogo .pv-catalog-card-price {
    margin: 0 0 7px !important;
    color: #4c8f26 !important;
    font-size: 19px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
}

body .pv-home-catalogo .pv-catalog-format-options {
    gap: 5px !important;
    margin-bottom: 7px !important;
}

body .pv-home-catalogo button.pv-catalog-format-button {
    min-height: 33px !important;
    padding: 5px 2px !important;
    border-radius: 7px !important;
    font-size: 12px !important;
    font-weight: 650 !important;
}

body .pv-home-catalogo a.pv-catalog-cta,
body .pv-home-catalogo button.pv-catalog-cta {
    min-height: 35px !important;
    padding: 7px 6px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
}

body .pv-home-catalogo .pv-carousel-arrow {
    top: 42% !important;
    width: 34px !important;
    height: 34px !important;
    margin-top: -17px !important;
    font-size: 24px !important;
    box-shadow: 0 2px 7px rgba(20, 40, 29, .12) !important;
}

body .pv-home-catalogo .pv-carousel-prev {
    left: -10px !important;
}

body .pv-home-catalogo .pv-carousel-next {
    right: -10px !important;
}

/* Desktop/notebook: mantenemos cuatro tarjetas siempre que el header
   ya esté trabajando en modo escritorio. */
@media (min-width: 1025px) {
    body .pv-home-catalogo .pv-product-carousel {
        grid-auto-columns: calc((100% - 36px) / 4) !important;
    }
}

/* Tablet horizontal. */
@media (min-width: 768px) and (max-width: 1024px) {
    body .pv-home-catalogo {
        padding-inline: 14px !important;
    }

    body .pv-home-catalogo .pv-product-carousel {
        grid-auto-columns: calc((100% - 20px) / 3) !important;
        gap: 10px !important;
    }

    body .pv-home-catalogo h3.pv-catalog-card-title,
    body .pv-home-catalogo h3.pv-catalog-card-title a {
        font-size: 16px !important;
    }
}

/* Tablet angosta: dos tarjetas cómodas. */
@media (min-width: 768px) and (max-width: 860px) {
    body .pv-home-catalogo .pv-product-carousel {
        grid-auto-columns: calc((100% - 10px) / 2) !important;
    }
}

/* Celular: dos tarjetas reales y compactas. */
@media (max-width: 767px) {
    body .pv-home-catalogo {
        padding: 0 7px 22px !important;
    }

    body .pv-home-catalogo .pv-catalog-section {
        margin-bottom: 18px !important;
    }

    body .pv-home-catalogo .pv-catalog-section-heading {
        margin-bottom: 8px !important;
    }

    body .pv-home-catalogo .pv-catalog-section-heading h2 {
        font-size: 22px !important;
    }

    body .pv-home-catalogo .pv-product-carousel {
        grid-auto-columns: calc((100% - 7px) / 2) !important;
        gap: 7px !important;
        padding-bottom: 6px !important;
    }

    body .pv-home-catalogo .pv-catalog-card {
        border-radius: 11px !important;
    }

    body .pv-home-catalogo .pv-catalog-card-body {
        padding: 7px 6px 8px !important;
    }

    body .pv-home-catalogo h3.pv-catalog-card-title {
        min-height: 30px !important;
        margin-bottom: 3px !important;
    }

    body .pv-home-catalogo h3.pv-catalog-card-title,
    body .pv-home-catalogo h3.pv-catalog-card-title a {
        font-size: 13px !important;
        line-height: 1.1 !important;
    }

    body .pv-home-catalogo .pv-catalog-card-price {
        margin-bottom: 5px !important;
        font-size: 14px !important;
    }

    body .pv-home-catalogo .pv-catalog-format-options {
        gap: 3px !important;
        margin-bottom: 5px !important;
    }

    body .pv-home-catalogo button.pv-catalog-format-button {
        min-height: 28px !important;
        padding: 3px 1px !important;
        font-size: 10.5px !important;
    }

    body .pv-home-catalogo a.pv-catalog-cta,
    body .pv-home-catalogo button.pv-catalog-cta {
        min-height: 31px !important;
        padding: 5px 3px !important;
        font-size: 10.5px !important;
    }

    body .pv-home-catalogo .pv-carousel-arrow {
        width: 28px !important;
        height: 28px !important;
        margin-top: -14px !important;
        font-size: 20px !important;
    }

    body .pv-home-catalogo .pv-carousel-prev {
        left: -3px !important;
    }

    body .pv-home-catalogo .pv-carousel-next {
        right: -3px !important;
    }
}
