.idiomas-row {
    display: flex;
    flex-wrap: nowrap;
    gap: clamp(8px, 1.5vw, 24px);
    justify-content: center;
    width: 100%;
}

.idiomas-card {
    width: clamp(180px, 15vw, 250px);
    height: clamp(320px, 35vw, 470px);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    flex: 0 0 auto;
    transition: transform 0.2s;
}

.idiomas-card:hover {
    transform: translateY(-8px) scale(1.04);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
            rgba(43, 46, 32, 0) 0%,
            rgba(43, 46, 32, 0) 60%,
            rgba(40, 43, 30, 0.4) 70%,
            rgba(0, 0, 0, 0.8) 100%);
}

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
}

.glass-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 18px 12px 18px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.card-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Prevent long titles from pushing the icon and allow wrapping */
.glass-container {
    display: flex;
    /* ensure flex context (already used via classes) */
    gap: 12px;
    align-items: center;
}

/* Allow text to shrink and wrap inside the flex item instead of growing beyond space */
.glass-container .flex-grow-1 {
    min-width: 0;
    /* critical to allow wrapping */
    flex: 1 1 auto;
}

.card-title {
    line-height: 1.15;
    margin: 0 0px 0 0;
    /* keep small gap to icon */
    white-space: normal;
}

/* Keep icon fixed size and preserve aspect ratio without distortion */
.card-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
}

/* For image icons use contain so the whole image fits inside the circle without stretching */
.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* fill the circular frame, cropping if necessary */
    border-radius: 50%;
    display: block;
}

/* For inline SVG icons ensure they scale and use currentColor */
.card-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    color: white;
    /* stroke/fill uses currentColor */
}

.card-icon i {
    color: white;
    font-size: 22px;
}

/* Imagen usada como icono dentro de .card-icon */
.card-icon-img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

@media (max-width: 1400px) {
    .idiomas-row {
        gap: 12px;
    }

    .idiomas-card {
        width: 214px;
        height: 340px;
    }
}

@media (max-width: 1200px) {
    .idiomas-row {
        flex-wrap: wrap;
        justify-content: center;
    }

    .idiomas-card {
        width: 45vw;
        max-width: 260px;
        min-width: 160px;
    }
}

@media (max-width: 900px) {
    .idiomas-row {
        flex-wrap: wrap;
        gap: 16px;
    }

    .idiomas-card {
        width: 44vw;
        max-width: 220px;
        min-width: 140px;
    }
}

@media (max-width: 600px) {
    .idiomas-row {
        display: none !important;
    }

    #idiomasCarousel {
        display: block !important;
    }

    .idiomas-card {
        width: 90vw;
        max-width: 320px;
        min-width: 160px;
        height: 420px;
        margin: 0 auto;
    }
}

#idiomasCarousel {
    display: none;
}
