/*
 * Comprarteycafé — Portada Compacta v1.1.0
 * Alcance estricto: sólo Inicio y sólo elementos etiquetados por el JS.
 * Header, footer, navegación, Sommelier y lógica WooCommerce quedan fuera.
 */

body.home.cyc-home-compact {
    --cyc-home-section-min-pad: 18px;
}

/* Compactación general de secciones */
body.home.cyc-home-compact .cyc-home-band {
    box-sizing: border-box !important;
    padding-top: var(--cyc-compact-pt, clamp(20px, 2.6vw, 40px)) !important;
    padding-bottom: var(--cyc-compact-pb, clamp(20px, 2.6vw, 40px)) !important;
    margin-top: var(--cyc-compact-mt, 0px) !important;
    margin-bottom: var(--cyc-compact-mb, 0px) !important;
    min-height: 0 !important;
}

body.home.cyc-home-compact .cyc-home-band .cyc-home-gap {
    margin-top: var(--cyc-gap-top, 0px) !important;
    margin-bottom: var(--cyc-gap-bottom, 0px) !important;
}

body.home.cyc-home-compact .cyc-home-grid {
    gap: var(--cyc-compact-gap, clamp(12px, 1.4vw, 20px)) !important;
    row-gap: var(--cyc-compact-gap, clamp(12px, 1.4vw, 20px)) !important;
}

body.home.cyc-home-compact .cyc-home-card {
    box-sizing: border-box !important;
    padding-top: var(--cyc-card-pt, 18px) !important;
    padding-bottom: var(--cyc-card-pb, 18px) !important;
    min-height: 0 !important;
}

body.home.cyc-home-compact .cyc-home-title {
    margin-top: 0 !important;
    margin-bottom: clamp(8px, 1vw, 14px) !important;
}

body.home.cyc-home-compact .cyc-home-kicker {
    margin-top: 0 !important;
    margin-bottom: 6px !important;
}

/* Franja 25 años / 100% / Origen / Fuengirola */
body.home.cyc-home-compact .cyc-home-stats {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    min-height: 0 !important;
}
body.home.cyc-home-compact .cyc-home-stats > * {
    padding-top: 9px !important;
    padding-bottom: 9px !important;
}

/* Bloques editoriales principales */
body.home.cyc-home-compact .cyc-home-four-worlds,
body.home.cyc-home-compact .cyc-home-selection,
body.home.cyc-home-compact .cyc-home-families,
body.home.cyc-home-compact .cyc-home-google-zone {
    padding-top: clamp(20px, 2.5vw, 34px) !important;
    padding-bottom: clamp(20px, 2.5vw, 34px) !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* =========================================================
   CUATRO MUNDOS — tarjetas mucho más pequeñas
   ========================================================= */
body.home.cyc-home-compact .cyc-home-four-worlds .cyc-worlds-grid {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: clamp(10px, 1.1vw, 16px) !important;
    align-items: stretch !important;
    overflow: visible !important;
}

body.home.cyc-home-compact .cyc-home-four-worlds .cyc-world-card {
    min-width: 0 !important;
    min-height: 210px !important;
    height: auto !important;
    padding: clamp(18px, 1.5vw, 24px) !important;
    border-radius: clamp(20px, 1.6vw, 26px) !important;
}

body.home.cyc-home-compact .cyc-home-four-worlds .cyc-world-card h2,
body.home.cyc-home-compact .cyc-home-four-worlds .cyc-world-card h3,
body.home.cyc-home-compact .cyc-home-four-worlds .cyc-world-card h4 {
    font-size: clamp(25px, 2vw, 34px) !important;
    line-height: 1.05 !important;
    margin-top: 8px !important;
    margin-bottom: 8px !important;
}

body.home.cyc-home-compact .cyc-home-four-worlds .cyc-world-card p {
    margin-top: 6px !important;
    margin-bottom: 0 !important;
    line-height: 1.35 !important;
}

body.home.cyc-home-compact .cyc-home-four-worlds .cyc-world-card [class*="number"],
body.home.cyc-home-compact .cyc-home-four-worlds .cyc-world-card [class*="index"] {
    margin-bottom: 8px !important;
}

/* =========================================================
   UNA SELECCIÓN DE LA TIENDA — una sola fila de muestra
   ========================================================= */
body.home.cyc-home-compact .cyc-home-selection .cyc-selection-products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: clamp(12px, 1.35vw, 20px) !important;
    align-items: stretch !important;
    overflow: visible !important;
}

body.home.cyc-home-compact .cyc-home-selection .cyc-selection-product-card {
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
}

/* Sólo la primera fila de cuatro productos en escritorio. */
body.home.cyc-home-compact .cyc-home-selection .cyc-selection-product-card:nth-child(n+5) {
    display: none !important;
}

/* Tarjetas de producto algo más contenidas en portada */
body.home.cyc-home-compact .cyc-home-selection .cyc-selection-product-card img {
    max-height: 320px !important;
    object-fit: contain !important;
}

body.home.cyc-home-compact .cyc-home-selection .cyc-selection-product-card h2,
body.home.cyc-home-compact .cyc-home-selection .cyc-selection-product-card h3 {
    font-size: clamp(19px, 1.45vw, 26px) !important;
    line-height: 1.08 !important;
}

/* =========================================================
   CADA FAMILIA — conservar concepto, aún más compacto
   ========================================================= */
body.home.cyc-home-compact .cyc-home-families .cyc-family-sidecopy,
body.home.cyc-home-compact .cyc-home-families .cyc-family-sidecopy-wrap {
    display: none !important;
}

body.home.cyc-home-compact .cyc-home-families .cyc-family-title {
    font-size: clamp(32px, 3.6vw, 50px) !important;
    line-height: 1.02 !important;
}

body.home.cyc-home-compact .cyc-home-families .cyc-family-card {
    padding-top: clamp(16px, 1.4vw, 22px) !important;
    padding-bottom: clamp(16px, 1.4vw, 22px) !important;
}

/* Seguridad contra scroll horizontal general */
body.home.cyc-home-compact main,
body.home.cyc-home-compact #primary,
body.home.cyc-home-compact .site-main,
body.home.cyc-home-compact .entry-content {
    overflow-x: clip;
}

/* Tablet */
@media (max-width: 1199px) and (min-width: 769px) {
    body.home.cyc-home-compact .cyc-home-four-worlds .cyc-worlds-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    body.home.cyc-home-compact .cyc-home-selection .cyc-selection-products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    body.home.cyc-home-compact .cyc-home-selection .cyc-selection-product-card:nth-child(n+4) {
        display: none !important;
    }
}

/* Móvil: una sola fila horizontal compacta en productos;
   cartas editoriales en dos columnas cuando cabe. */
@media (max-width: 768px) {
    body.home.cyc-home-compact .cyc-home-band {
        padding-top: 18px !important;
        padding-bottom: 18px !important;
    }

    body.home.cyc-home-compact .cyc-home-four-worlds .cyc-worlds-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    body.home.cyc-home-compact .cyc-home-four-worlds .cyc-world-card {
        min-height: 170px !important;
        padding: 16px !important;
    }

    body.home.cyc-home-compact .cyc-home-four-worlds .cyc-world-card h2,
    body.home.cyc-home-compact .cyc-home-four-worlds .cyc-world-card h3,
    body.home.cyc-home-compact .cyc-home-four-worlds .cyc-world-card h4 {
        font-size: clamp(21px, 6vw, 29px) !important;
    }

    body.home.cyc-home-compact .cyc-home-selection .cyc-selection-products {
        display: flex !important;
        gap: 12px !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        padding-bottom: 8px !important;
    }

    body.home.cyc-home-compact .cyc-home-selection .cyc-selection-product-card {
        display: block !important;
        flex: 0 0 min(78vw, 300px) !important;
        scroll-snap-align: start;
    }

    body.home.cyc-home-compact .cyc-home-selection .cyc-selection-product-card:nth-child(n+5) {
        display: none !important;
    }

    body.home.cyc-home-compact .cyc-home-selection .cyc-selection-product-card img {
        max-height: 260px !important;
    }

    body.home.cyc-home-compact .cyc-home-stats {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }
}
