

/* Sección principal */
.insurance-section {
    padding: 60px 0;
    background: var(--colors-blue-100);
    color: white;
}

.insurance-section .section-header {
    display: flex;
    flex-flow: column;
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

/* Embla Carousel Styles */
.embla {
    position: relative;
    padding-left: 1.5rem;
}

.embla__viewport {
    overflow: hidden;
}

.embla__container {
    display: flex;
    touch-action: pan-y pinch-zoom;
    margin-left: calc(1rem * -1);
    transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);   
}

.embla__slide {
    transform: translate3d(0, 0, 0);
    flex: 0 0 100%;
    min-width: 0;
    padding-left: 1rem;
}

/* Tarjetas */
.card {
    background: #000000;
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
}

@media (width > 768px) {
    .card {
        height: 500px;
        padding: 1.5rem;
    }
}


.card-1 {
    background: url("../img/servicios/poliza-01.webp") ;
    background-position: bottom center;
    background-size: 100%;
}

.card-2 {
    background: url("../img/servicios/poliza-02.webp");
    background-position: bottom center;
    background-size: 100%;
}

.card-3 {
    background: url("../img/servicios/poliza-03.webp");
    background-position: bottom center;
    background-size: 100%;
}


.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #ffffff;
}

.card-description {
    font-size: 0.875rem;
    color: var(--colors-light-300);
    line-height: 1.5;
}

/* Controles de Embla */
.embla__controls {
    display: grid;
    grid-template-columns: auto 1fr;
    justify-content: space-between;
    gap: 1.2rem;
    margin-top: 1.8rem;
}

.embla__buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    align-items: center;
}

.embla__button {
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
    -webkit-appearance: none;
    appearance: none;
    background-color: transparent;
    touch-action: manipulation;
    display: inline-flex;
    text-decoration: none;
    cursor: pointer;
    border: 0;
    padding: 0;
    margin: 0;
    box-shadow: inset 0 0 0 0.2rem rgba(255, 255, 255, 0.2);
    width: 3.6rem;
    height: 3.6rem;
    z-index: 1;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.embla__button:disabled {
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

.embla__button:not(:disabled):hover {
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 0 0.2rem rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.embla__button:not(:disabled):active {
    transform: scale(0.95);
}

.embla__button svg {
    transition: transform 0.2s ease;
}

.embla__button:hover svg {
    transform: scale(1.1);
}

/* Dots/Indicadores */
.embla__dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    margin-right: calc((2.6rem - 1.4rem) / 2 * -1);
}

.embla__dot {
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
    -webkit-appearance: none;
    appearance: none;
    background-color: transparent;
    touch-action: manipulation;
    display: inline-flex;
    text-decoration: none;
    cursor: pointer;
    border: 0;
    padding: 0;
    margin: 0;
    width: 2.6rem;
    height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.embla__dot:after {
    box-shadow: inset 0 0 0 0.2rem rgba(255, 255, 255, 0.2);
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    content: "";
    transition: all 0.3s ease;
}

.embla__dot:hover:after {
    box-shadow: inset 0 0 0 0.2rem rgba(255, 255, 255, 0.4);
}

.embla__dot--selected:after {
    box-shadow: inset 0 0 0 0.2rem rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.9);
}

/* Mejoras visuales adicionales */
.card-image::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
    pointer-events: none;
}

/* Responsive Design */

/* Desktop: Grid layout cuando no hay carrusel */
@media (min-width: 1024px) {
    .embla.desktop-grid .embla__viewport {
        overflow: visible;
    }

    .embla.desktop-grid .embla__container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 24px;
        margin-left: 0;
    }

    .embla.desktop-grid .embla__slide {
        padding-left: 0;
        flex: none;
    }

    .embla.desktop-grid .embla__controls {
        display: none;
    }

    .embla.desktop-grid .embla__dots {
        display: none;
    }

}

/* Tablet */
@media (max-width: 1023px) and (min-width: 768px) {
    .embla__slide {
        flex: 0 0 85%;
    }

}

/* Mobile */
@media (max-width: 767px) {

    .insurance-section {
        padding: 40px 0;
    }

    .embla__slide {
        flex: 0 0 90%;
    }

    .embla__button {
        width: 3rem;
        height: 3rem;
    }

    .embla__button svg {
        width: 20px;
        height: 20px;
    }

    .embla__controls {
        margin-top: 1.2rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .card-description {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .embla__slide {
        flex: 0 0 95%;
    }

    .embla__controls {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .embla__buttons {
        justify-self: center;
    }

    .embla__dots {
        justify-content: center;
        margin-right: 0;
        margin-top: 1rem;
    }
}

@media (max-width: 767px) {
    /* ...existing code... */

    .embla__controls {
        justify-content: flex-end;
        grid-template-columns: 1fr;
        text-align: right;
    }

    .embla__buttons {
        justify-self: flex-end;
        justify-content: flex-end;
        display: flex;
        gap: 0.6rem;
    }
}

/* Estados de focus para accesibilidad */
.embla__dot:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.embla.desktop-grid .embla__controls {
    display: none;
}

@media (min-width: 1024px) {
    .embla:not(.desktop-grid) .embla__slide {
        flex: 0 0 33.3333%;
        max-width: 33.3333%;
    }
}

@media (width > 1024px) {

    .insurance-section .section-header {
            display: flex;
            flex-flow: row nowrap;
            padding: 0;
    }

    .embla {
        padding-left: 0rem;
    }

    .card {
        height: 550px;
    }
    .card-1 {
        background: url("../img/servicios/poliza-01-xl.webp");
        background-position: bottom center;
        background-size: cover;
    }
    
    .card-2 {
        background: url("../img/servicios/poliza-02-xl.webp");
        background-position: bottom center;
        background-size: cover;
    }
    
    .card-3 {
        background: url("../img/servicios/poliza-03-xl.webp");
        background-size: cover;
        background-position: bottom center;
    }
}


@media (width > 1920px) {

    .card {
        height: 650px;
    }

}