/* --------------------------------------------
   BLOQUE: Esencia viva (ha-esencia)
-------------------------------------------- */

/* 1. Contenedor principal */
.ha-esencia {
    padding: 4em 0;
    background-color: #ffffff;
    overflow: hidden;
    max-width: 100%;
    width: 100%;
}

/* 2. Encabezado */
.ha-esencia__header {
    text-align: center;
    margin-bottom: 2.2em;
    max-width: 100%;
    overflow: hidden;
}

.ha-esencia__eyebrow {
    margin-bottom: 0.4em;
    color: #847732;
    text-transform: uppercase;
}

.ha-esencia__title {
    margin-top: 0;
    margin-bottom: 0.35em;
    color: #393F38;
    font-family: 'Poiret One', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    word-wrap: break-word;
    max-width: 100%;
}

.ha-esencia__intro {
    max-width: 760px;
    margin: 0 auto;
    color: #6e6e6e;
    line-height: 1.8;
    padding: 0 15px;
    word-wrap: break-word;
}

/* 3. Carrusel - CONTENEDOR PRINCIPAL */
.ha-esencia__carousel {
    margin-top: 1em;
    position: relative;
    max-width: 100%;
    overflow: hidden;
    padding: 0 5px;
}

/* 3.1 Viewport de Flickity */
.ha-esencia__carousel .flickity-viewport {
    overflow: hidden !important;
    width: 100%;
    position: relative;
    transition: height 0.2s;
    max-width: 100%;
}

/* 3.2 Slider interno */
.ha-esencia__carousel .flickity-slider {
    position: absolute;
    width: 100%;
    height: 100%;
    max-width: 100%;
}

/* Botones de navegación */
.ha-esencia__carousel .flickity-button {
    background: #ffffff;
    color: #847732;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: background 0.25s ease, box-shadow 0.25s ease;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    padding: 0;
}

.ha-esencia__carousel .flickity-button:hover {
    background: #f1f1f1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.ha-esencia__carousel .flickity-button.previous {
    left: 5px;
}

.ha-esencia__carousel .flickity-button.next {
    right: 5px;
}
.ha-esencia__carousel .flickity-prev-next-button .flickity-button-icon {
    left: 30%;
    top: 30%;
}
.ha-esencia__carousel .flickity-button:disabled {
    opacity: 0.3;
    pointer-events: none;
}

.ha-esencia__carousel .flickity-button-icon {
    fill: #847732;
    width: 16px;
    height: 16px;
}

/* Puntos de paginación */
.ha-esencia__carousel .flickity-page-dots {
    bottom: -35px;
    text-align: center;
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
    position: absolute;
}

.ha-esencia__carousel .flickity-page-dots .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 6px;
    border-radius: 50%;
    background: #d4d4d4;
    transition: background 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    border: none;
    padding: 0;
}

.ha-esencia__carousel .flickity-page-dots .dot.is-selected {
    background: #847732;
    transform: scale(1.3);
}

/* ============================================================
   TARJETAS - ESTILOS UNIFICADOS
============================================================ */

/* 4. Tarjetas - Base */
.ha-esencia__card {
    width: 100%;
    min-height: 250px;
    padding: 1.8em 1.4em;
    border-radius: 20px;
    background-color: #fff;
    border: 1px solid #eaeaea;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    box-sizing: border-box;
    overflow: hidden;
    height: auto;
    max-width: 100%;
    /* hyphens: auto; */
    word-break: keep-all;
    overflow-wrap: break-word;
}

.ha-esencia__carousel .ha-esencia__card {
    float: left;
}

/* ============================================================
   MÁRGENES DE TARJETAS - RESPONSIVE
============================================================ */

/* Escritorio (≥ 1200px) */
@media (min-width: 1200px) {
    .ha-esencia__card {
        width: 24%;
        min-height: 250px;
        margin: 0 15px;
    }
    /* Primer elemento: margen izquierdo extra usando padding del contenedor */
    .ha-esencia__carousel {
        padding-left: 35px;
    }
}

/* Tablets grandes y portátiles (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .ha-esencia__card {
        width: 27%;
        min-height: 230px;
        margin: 0 12px;
    }
    .ha-esencia__carousel {
        padding-left: 30px;
    }
}

/* Móvil horizontal y tablets pequeñas (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .ha-esencia__card {
        width: 40%;
        min-height: 220px;
        margin: 0 10px;
    }
    .ha-esencia__carousel {
        padding-left: 25px;
    }
}

/* Móvil vertical (≤ 767px) */
@media (max-width: 767px) {
    .ha-esencia {
        padding: 3em 0;
    }

    .ha-esencia__card {
        width: 78%;
        min-height: 200px;
        margin: 0 8px;
        padding: 1.5em 1em;
    }

    .ha-esencia__carousel {
        padding-left: 18px;
    }

    .ha-esencia__card h3 {
        font-size: 1.4rem;
    }

    .ha-esencia__card p {
        font-size: 1.3rem;
    }

    .ha-esencia__icon {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .ha-esencia__carousel .flickity-page-dots {
        bottom: -25px;
    }

    .ha-esencia__carousel .flickity-button {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    .ha-esencia__carousel .flickity-button.previous {
        left: 3px;
    }
    .ha-esencia__carousel .flickity-button.next {
        right: 3px;
    }
}

/* Pantallas muy pequeñas (≤ 335px) */
@media (max-width: 335px) {
    .ha-esencia {
        padding: 2em 0;
    }

    .ha-esencia__header {
        padding: 0 8px;
    }

    .ha-esencia__title {
        font-size: 2rem;
        letter-spacing: 0;
    }

    .ha-esencia__intro {
        font-size: 1.3rem;
        padding: 0 5px;
        line-height: 1.5;
    }

    .ha-esencia__carousel {
        padding: 0 2px;
        padding-left: 12px;
    }

    .ha-esencia__card {
        width: 76%;
        min-height: 180px;
        padding: 1.2em 0.8em;
        margin: 0 5px;
        border-radius: 15px;
    }

    .ha-esencia__card h3 {
        font-size: 1.2rem;
        margin-bottom: 0.4em;
    }

    .ha-esencia__card p {
        font-size: 1.1rem;
        line-height: 1.4;
    }

    .ha-esencia__icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        margin-bottom: 0.6em;
    }

    .ha-esencia__carousel .flickity-button {
        display: none !important;
    }

    .ha-esencia__carousel .flickity-page-dots {
        bottom: -20px;
    }

    .ha-esencia__carousel .flickity-page-dots .dot {
        width: 8px;
        height: 8px;
        margin: 0 4px;
    }

    .ha-esencia .container {
        padding: 0 5px;
        max-width: 100%;
        overflow: hidden;
    }
}

/* 6. Iconos */
.ha-esencia__icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 1em auto;
    border-radius: 50%;
    background-color: rgba(132, 119, 50, 0.12);
    color: #847732;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: background-color 0.25s ease;
    flex-shrink: 0;
}

.ha-esencia__card:hover .ha-esencia__icon {
    background-color: rgba(132, 119, 50, 0.22);
}

.ha-esencia__card h3 {
    margin-top: 0;
    margin-bottom: 0.7em;
    color: #847732;
    font-family: 'Quicksand', sans-serif;
    font-size: 1.7rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    word-wrap: break-word;
    max-width: 100%;
}

.ha-esencia__card p {
    margin-bottom: 0;
    color: #333;
    line-height: 1.7;
    font-size: 1.5rem;
    word-wrap: break-word;
    max-width: 100%;
}

/* 7. Corrección general */
.ha-esencia__carousel .flickity-viewport {
    transition: height 0.3s ease;
}

/* 8. Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .ha-esencia__card {
        transition: none;
    }

    .ha-esencia__card:hover {
        transform: none;
    }

    .ha-esencia__carousel .flickity-button {
        transition: none;
    }

    .ha-esencia__carousel .flickity-page-dots .dot {
        transition: none;
    }

    .ha-esencia__carousel .flickity-viewport {
        transition: none;
    }
}

