/* =========================================
   1. VARIABLES
   ========================================= */
   :root {
    --color-primary: #8e8e93;
    --color-secondary: #3a3a3a;
    --color-background: #f5f5f7;
    --color-text: #1d1d1f;
    --color-white: #ffffff;
    --color-border: #d2d2d7;
    --color-hover: #e5e5ea;
    --color-shadow: rgba(0, 0, 0, 0.1);
    --border-radius: 10px;
    --transition-standard: all 0.3s ease;
}

/* =========================================
   2. BASE ELEMENTS
   ========================================= */
body {
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: 'Poppins', sans-serif;
}

a {
    color: var(--color-secondary) !important;
    text-decoration: none;
    transition: var(--transition-standard);
}

a:hover {
    color: var(--color-text);
}

h2 {
    text-align: center;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 0 !important;
    box-shadow: none !important;
}

button {
    background-color: var(--color-primary);
    border: none;
    transition: var(--transition-standard);
}

button:hover {
    background-color: var(--color-hover);
}

/* =========================================
   3. LAYOUT COMPONENTS
   ========================================= */
/* Header */
header {
    background-color: var(--color-white);
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

/* Navigation */
nav {
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
}

.navbar-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.nav-item {
    margin: 0 10px;
}

.nav-link {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
    text-transform: uppercase;
    padding: 10px 15px;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--color-primary);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* Main section */
.py-5 {
    max-width: 100% !important;
    margin: 0 auto;
    display: block;
    text-align: center;
    padding-bottom: 1rem !important;
}

/* Section */
section {
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 20px;
    box-shadow: 0 2px 4px var(--color-shadow);
}

/* Footer */
footer {
    background-color: var(--color-background);
    color: var(--color-text);
    border-top: 1px solid var(--color-border);
    padding: 20px 0;
    text-align: center;
}

/* =========================================
   4. CARDS AND CONTAINERS
   ========================================= */
/* Card styles */
.card {
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px var(--color-shadow);
    transition: var(--transition-standard);
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card-img-top {
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.card-text {
    font-size: 14px;
    color: var(--color-secondary);
    margin-bottom: 15px;
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Caso card specific */
.caso-card {
    overflow: hidden;
    margin-bottom: 20px;
}

.caso-card .btn {
    margin-top: auto;
}

/* Course card specific */
.course-card:hover {
    transform: translateY(-5px);
}

/* Content wrapper */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin: 40px 0;
}

/* Images column */
.images-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.image-container {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.image-container img {
    width: 100%;
    display: block;
    transition: transform 0.3s ease;
}

.image-container:hover img {
    transform: scale(1.03);
}

/* Text column */
.text-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Estancias clinicas */
.estancias-clinicas {
    display: flex;
    align-items: center;
    background: var(--color-white);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    padding: 3rem;
    gap: 2rem;
}

.estancias-clinicas .texto {
    flex: 1;
    max-width: 60%;
}

.estancias-clinicas h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 1rem;
}

.estancias-clinicas p {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.estancias-clinicas .precios {
    font-weight: 600;
    color: #000;
    margin-top: 1.5rem;
}

.estancias-clinicas .imagen img {
    width: 100%;
    max-width: 450px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* =========================================
   5. MODALS
   ========================================= */
/* General modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: var(--transition-standard);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    border-bottom: none;
    padding: 0;
    position: relative;
}

.modal-header img {
    width: 100%;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.modal-title {
    font-size: 20px;
    font-weight: bold;
}

.modal-body {
    font-size: 16px;
    color: var(--color-text);
}

.modal-footer {
    border-top: none;
}

/* Close button */
.close, .btn-close, .close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--color-text);
    opacity: 0.5;
    transition: all 0.2s ease;
    cursor: pointer;
}

.close:hover, .btn-close:hover, .close-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
}

.caso-modal .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.7);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Caso modal specific */
.caso-modal .caso-detalle {
    line-height: 1.6;
}

.caso-modal video {
    border-radius: 5px;
    margin-top: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 100%;
}

/* =========================================
   6. IMAGE HANDLING
   ========================================= */
/* General fluid images */
img.img-fluid {

    height: auto;
}

/* Image zooming */
.image-zoom-container {
    overflow: hidden;
    position: relative;
}

.image-zoom-container img, 
.course-image-container img {
    transition: transform 0.5s ease;
}

.image-zoom-container:hover img, 
.course-image-container:hover img {
    transform: scale(1.05);
}

.course-image-container {
    overflow: hidden;
    max-height: 500px;
    position: relative;
}

/* Image zoom icon */
.image-zoom-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-standard);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.image-zoom-icon i {
    font-size: 20px;
    color: #333;
}

.image-zoom-icon:hover {
    background-color: #fff;
    transform: scale(1.1);
}

/* =========================================
   7. BUTTONS AND INTERACTIVE ELEMENTS
   ========================================= */
.btn-custom {
    background-color: var(--color-secondary);
    color: var(--color-white);
    border: none;
    transition: var(--transition-standard);
}

.btn-custom:hover {
    background-color: var(--color-hover);
}

/* =========================================
   8. FORMS
   ========================================= */
   .wpcf7-form {
    background-color: var(--color-white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 12px var(--color-shadow);
    border: 1px solid var(--color-border);
    max-width: 600px;
    margin: 0 auto;
}

.wpcf7-form label {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
    display: block;
    font-size: 14px;
}

.wpcf7-form-control {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--color-background);
    color: var(--color-text);
}

.wpcf7-form-control::placeholder {
    color: var(--color-secondary);
    font-size: 14px;
}

.wpcf7-form-control:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(142, 142, 147, 0.1);
}

.wpcf7-form-control.wpcf7-submit {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    padding: 14px;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wpcf7-form-control.wpcf7-submit:hover {
    background-color: var(--color-hover);
    transform: translateY(-2px);
}

.wpcf7-form-control.wpcf7-submit:active {
    background-color: var(--color-secondary);
    transform: translateY(0);
}

.wpcf7-form .wpcf7-spinner {
    display: none;
}

.wpcf7-form .wpcf7-response-output {
    font-size: 14px;
    font-weight: 600;
    padding: 12px;
    border-radius: 8px;
    margin: 20px 0 0;
    text-align: center;
}

.wpcf7-form .wpcf7-response-output.wpcf7-mail-sent-ok {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.wpcf7-form .wpcf7-response-output.wpcf7-validation-errors,
.wpcf7-form .wpcf7-response-output.wpcf7-mail-sent-ng {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.wpcf7-form textarea {
    resize: vertical;
    min-height: 150px;
}

.wpcf7-form-control.wpcf7-email,
.wpcf7-form-control.wpcf7-tel {
    max-width: 100%;
}

.wpcf7-form .wpcf7-not-valid {
    border-color: #c62828;
}

.wpcf7-form .wpcf7-not-valid:focus {
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}

.wpcf7-form .wpcf7-not-valid-tip {
    font-size: 12px;
    color: #c62828;
    margin-top: 4px;
    display: block;
}


.text-primary {
    --bs-text-opacity: 1;
    color: #23787d !important;
}

img.modal-content.Cursos {
    width: 25% !important;
}

@media screen and (max-width: 768px) {
    img.modal-content.Cursos {
        width: 100% !important;
    }
}

@media (min-width: 769px) {
img.img-fluid.Casos {
    min-width: 416px;
    min-height: 369px !important;
    max-height: 369px !important;
}
}

    /* Por defecto, mostrar versión desktop y ocultar móvil */
    .banner-desktop {
        display: block;
    }
    .banner-mobile {
        display: none;
    }
    
    /* En pantallas más pequeñas (móviles), invertir la visibilidad */
    @media (max-width: 768px) {
        .banner-desktop {
            display: none;
        }
        .banner-mobile {
            display: block;
        }
        
img.img-fluid.Casos {
    width: 100% !important;
    height: auto I !important;
}

.modal-content {
    width: 100%;
}
    }


    .modal-backdrop {
    --bs-backdrop-zindex: 1000;
    --bs-backdrop-bg: #000;
    --bs-backdrop-opacity: 0.5;
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--bs-backdrop-zindex);
    width: 100vw;
    height: 100vh;
    background-color: var(--bs-backdrop-bg);
}