.card {
    perspective: 1000px;
}

.card-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card:hover .card-inner {
    transform: rotateY(180deg);
    background-color: #C3A38B;
}

.card-front,
.card-back {
    width: 100%;
    height: 100%;
    position: relative;
    backface-visibility: hidden;
}

.card-front {
    z-index: 2;
}

.card-back {
    z-index: 1; /* Ensure back face appears behind front face */
    transform: rotateY(180deg);
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center; /* Align vertically */
}

.card-body {
    padding: 1.25rem;
}

.image-container {
    position: relative;
    text-align: center;
}

.image-container p {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

.card-title {
    font-size: 25px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    max-height: 60px; /* Establece la altura máxima para dos líneas */
    overflow: hidden; /* Oculta cualquier exceso de texto */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limita a dos líneas */
    -webkit-box-orient: vertical;
}


/* Map section styles */
.map-section {
    margin-bottom: 3rem;
}

.coahuila-map-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 80%; /* Maintain aspect ratio */
    height: 0;
    overflow: hidden;
}

.coahuila-map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Region styles */
.map-region {
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-region path {
    transition: all 0.3s ease;
}

.map-region:hover {
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.3));
}

.map-region:hover path {
    stroke-width: 4px;
    stroke: #1E2452;
}

/* Popup styles (same as before) */
.region-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    max-width: 500px;
    width: 90%;
}

.popup-content {
    position: relative;
}

.close-popup {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #1E2452;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    cursor: pointer;
}

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .coahuila-map-container {
        padding-bottom: 120%; /* Taller aspect ratio for mobile */
    }
    
    .coahuila-map {
        transform: scale(1.2);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.animate-slide-left {
    animation: slideInLeft 1s ease forwards;
}

.animate-slide-right {
    animation: slideInRight 1s ease forwards;
}






@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fade {
    animation: fadeIn 3s ease forwards;
}