/* --- CONFIGURACIÓN GENERAL --- */
:root {
    --primary-color: #dc5712;
    --secondary-color: #b21f1f;
    --accent-color: #fdbb2d;
    --text-dark: #333;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    scroll-behavior: smooth;
}

a {
    text-decoration: none !important; /* Quita el subrayado */
    color: inherit; /* Hereda el color del texto del padre (negro/oscuro) */
}

/* Evita específicamente el color morado de "visitado" */
a:visited {
    color: inherit;
}

/* --- HEADER Y NAVEGACIÓN --- */
header {
    height: 80px;
    background: var(--white);
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-wrapper img {
    height: 150px;
    width: auto;
    transform: scale(1.2);
}

.site-title {
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

.nav-item {
    position: relative;
    cursor: pointer;
    font-weight: 500;
    padding: 10px 0;
}

.nav-item svg {
    width: 16px;
    vertical-align: middle;
}

.nav-item a {
    color: var(--text-dark); /* O black si no usas variables */
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 180px;
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    border-radius: 4px;
    overflow: visible;
}

.dropdown-menu a {
    position: relative; /* Necesario para posicionar la info mini */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.nav-item:hover .dropdown-menu {
    display: flex;
}

.business-info-preview {
    display: none;
    position: absolute;
    top: 0;
    right: 100%; /* Sale hacia la izquierda */
    width: 250px;
    background: var(--white);
    box-shadow: var(--shadow);
    border-radius: 8px;
    padding: 15px;
    z-index: 1001;
    border: 1px solid #eee;
    pointer-events: none; /* Evita parpadeos */
}

/* Mostrar al hacer hover */
.dropdown-menu a:hover .business-info-preview {
    display: flex !important;
    gap: 12px;
    opacity: 1;
    align-items: center;
    visibility: visible;
}

/* Estilo de la mini imagen/logo */
.mini-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
    background: #f9f9f9;
}

/* Estilo del texto informativo */
.info-content {
    text-align: left;
}

.info-content span {
    display: block;
    font-size: 0.75rem;
    color: #666;
    line-height: 1.2;
}

.info-content strong {
    display: block;
    color: var(--primary-color);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

/* --- CARRUSEL --- */
.carousel {
    position: relative;
    height: 500px;
    background: #000;
    overflow: hidden;
}

.carousel-slide img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    opacity: 0.7;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.3);
    border: none;
    color: white;
    padding: 15px;
    cursor: pointer;
    font-size: 20px;
}

.prev { left: 20px; }
.next { right: 20px; }

.carousel-slide {
    display: none;
    transition: opacity 0.8s ease-in-out;
    
}

.carousel-slide.active {
    display: block;
    animation: fadeIn 0.8s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- DIRECTORIO INTERNO --- */
.section-title {
    display: block !important;
    text-align: center !important;
    width: 100%;
    margin: 60px auto 40px auto;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark);
    text-transform: none;
    letter-spacing: -0.5px;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* Contenedor principal */
.directory-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Grupo por cada piso */
.floor-group {
    margin-bottom: 20px;
    width: 100%;
    border-bottom: 1px solid #eee;
    overflow: hidden;
}

/* Título de cada nivel (Botón del acordeón) */
.floor-title {
    font-size: 1.4rem;
    color: var(--text-dark);
    font-weight: 700;
    margin: 0;
    padding: 20px 15px;
    border-left: 5px solid var(--primary-color); 
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    background: var(--white);
    transition: background 0.3s ease;
    user-select: none;  
    pointer-events: auto;
}

.floor-title:hover {
    background: #fdfdfd;
}

/* Estilo para el icono de la flecha */
.floor-title i {
    transition: transform 0.4s ease;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-left: 10px;
    pointer-events: none; 
}

/* Oculto por defecto */
.floor-group .offices-grid {
    display: none !important;
}

/* Estado abierto */
.floor-group.active .offices-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px 15px;
    margin-top: 10px;
}

/* Estilo del icono */
.floor-title i {
    transition: none;
}

/* --- TARJETA DE OFICINA --- */
.office-card {
    display: flex;
    gap: 15px; /* separación entre imagen y texto */
    padding: 15px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    align-items: center;
    transition: transform 0.2s ease;
}

.office-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.office-image {
    width: 40%;
    height: 100%;
}

.office-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.office-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.office-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.office-info p {
    margin: 0;
    font-size: 13px;
    color: #555;
}

.office-info p:last-of-type {
    margin-top: 4px;
    color: #333;
}

.btn-details {
    background: var(--primary-color) !important;
    color: white !important;
    border: none;
    padding: 8px 16px; 
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600; 
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px; 
    margin-top: 10px; 
    transition: all 0.2s ease;
}

/* --- RESPONSIVIDAD --- */
@media (max-width: 1200px) {
    .floor-group.active .offices-grid { 
        grid-template-columns: repeat(3, 1fr) !important; 
    }
}

@media (max-width: 900px) {
    .floor-group.active .offices-grid { 
        grid-template-columns: repeat(2, 1fr) !important; 
    }
}

@media (max-width: 600px) {
    .floor-group.active .offices-grid { 
        grid-template-columns: 1fr !important;
    }
    .floor-title {
        font-size: 1.1rem;
    }
}

/* --- FORMULARIOS --- */
.form-container, .contact-card-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

input, select, textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 5px;
}

.btn-submit, .btn-send-message {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 15px 30px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
}

/********** Ubicación **********/
.contact-section {
    background: linear-gradient(135deg, #dc5712 0%, #b21f1f 100%); /* Degradado corporativo */
    padding: 80px 5%;
    color: white;
}

.contact-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr; /* El mapa es más ancho */
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start;
}

/* Estilo del Mapa */
.map-placeholder {
    width: 100%;
    height: 450px;
    background: #e0e0e0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    border: 8px solid rgba(255, 255, 255, 0.1);
}

/* Contenedor de Info con Efecto Cristal */
.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-item {
    background: rgba(255, 255, 255, 0.15); /* Fondo blanco traslúcido */
    backdrop-filter: blur(10px); /* Desenfoque de fondo */
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, background 0.3s ease;
}

.info-item:hover {
    transform: translateX(10px);
    background: rgba(255, 255, 255, 0.25);
}

/* Iconos circulares */
.green-icon {
    font-size: 1.5rem;
    background: var(--accent-color); /* Amarillo corporativo para resaltar */
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.info-text h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #fdbb2d; /* Color amarillo para los títulos internos */
}

.info-text p {
    font-size: 0.95rem;
    opacity: 0.95;
    line-height: 1.4;
    margin: 0;
}

/* Ajuste para móviles */
@media (max-width: 900px) {
    .contact-container {
        grid-template-columns: 1fr;
    }
    .map-placeholder {
        height: 300px;
    }
}
/* Quitar estilos por defecto del enlace */
.info-link-wrapper {
    text-decoration: none; /* Elimina el subrayado azul */
    display: block;
    color: inherit;
}

.info-link-wrapper:hover .info-item {
    background: rgba(255, 255, 255, 0.25); /* Efecto hover más claro */
    transform: translateX(10px); /* Desplazamiento sutil */
    border-color: #fdbb2d; /* Brillo amarillo al pasar el mouse */
}

/* Asegurar que el texto dentro del enlace mantenga sus colores */
.info-link-wrapper .info-text p {
    color: white; 
    text-decoration: none !important;
}

.info-link-wrapper .info-text h4 {
    color: #fdbb2d; /* Mantiene el amarillo corporativo */
}

/***** Títulos *****/
.main-title {
    display: block !important;
    text-align: center !important;
    width: 100%;
    margin-bottom: 40px;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark) !important; /* Título en blanco sobre el fondo naranja */
    letter-spacing: -0.5px;
}

/* Línea decorativa igual a la del directorio pero blanca */
.main-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--white); 
    margin: 10px auto 0;
    border-radius: 2px;
}

.features-section .main-title{
    display: block !important;
    text-align: center !important;
    width: 100%;
    margin-bottom: 40px;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark) !important; /* Título en blanco sobre el fondo naranja */
    letter-spacing: -0.5px;
}

.features-section .main-title::after{
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--white); 
    margin: 10px auto 0;
    border-radius: 2px;
}

.appointment-section .main-title{
    display: block !important;
    text-align: center !important;
    width: 100%;
    margin-bottom: 40px;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark) !important; 
    letter-spacing: -0.5px;
}

.appointment-section .main-title::after{
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--white); 
    margin: 10px auto 0;
    border-radius: 2px;
}

/* Ajuste Icono */
.green-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* --- CARRUSEL DE OFICINAS--- */
.carousel-external-container {
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 40px;
}

.carousel-external-container .offices-viewport {
    overflow: hidden;
    width: 100%;
}

/* 🔒 SOLO se anima si está dentro del carrusel externo */
.carousel-external-container .offices-grid {
    display: flex;
    gap: 25px;
    padding: 20px 0;
    animation: scroll-infinito 80s linear infinite;
    width: max-content;
}

.carousel-external-container .offices-grid:hover,
.carousel-external-container .paused-animation {
    animation-play-state: paused !important;
}

@keyframes scroll-infinito {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 12.5px)); }
}

/* 🔒 SOLO tarjetas del carrusel externo */
.carousel-external-container .office-card {
    min-width: 320px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    flex-shrink: 0;
    overflow: hidden;
}

/* --- ESTILOS DEL POP-UP --- */
/* --- OVERLAY --- */
.modal-overlay {
    display: none; /* se activa con JS */
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;

    justify-content: center;
    align-items: center;
}

/* --- CONTENEDOR --- */
.modal-content {
    background: white;
    width: 90%;
    max-width: 420px;
    border-radius: 24px;
    overflow: hidden; /* 👈 IMPORTANTE (no lo quites) */
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: popupEmerger 0.3s ease-out;
}

/* --- ANIMACIÓN --- */
@keyframes popupEmerger {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* --- BOTÓN CERRAR --- */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: white;
    cursor: pointer;
    z-index: 10;
}

/* --- BANNER / IMAGEN --- */
.modal-banner {
    position: relative;
    height: 160px;
}

.modal-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.modal-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- TEXTO SOBRE IMAGEN --- */
.banner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 800;
    font-size: 1.8rem; 
    text-align: center;
    width: 90%;
    text-shadow: 0 3px 15px rgba(0,0,0,0.9);
    z-index: 2;
}

/* --- CONTENIDO --- */
.modal-body { 
    padding: 25px; 
    text-align: center; 
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: white;
}

/* --- TÍTULO --- */
#modal-titulo {
    font-size: 1.4rem;
    font-weight: 600;
}

/* --- DESCRIPCIÓN --- */
#modal-descripcion {
    color: #555;
    line-height: 1.5;
}

/* --- PRECIO (si lo usas) --- */
.price-highlight {
    font-size: 20px;
    font-weight: bold;
    color: #d35400;
}

/* --- BOTONES --- */
.modal-actions-vertical { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    margin-top: 10px;
}

/* BOTÓN PRINCIPAL */
.btn-green-action {
    background: var(--primary-color); /* 👈 usa tu color */
    color: var(--white);
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
}

/* BOTÓN SECUNDARIO */
.btn-outline-action {
    background: transparent;
    border: 2px solid #eee;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
}

/* --- FOOTER --- */
footer {
    background: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 20px 5%;
    margin-top: 40px;
}

/* --- MEJORAS PARA "¿POR QUÉ ELEGIRNOS?" --- */
.features-section {
    padding: 60px 5%;
    background-color: var(--white);
}

/* Unificamos el título para que sea igual al del directorio */
.features-section .main-title, 
.appointment-section .main-title {
    display: block !important;
    text-align: center !important;
    width: 100%;
    margin-bottom: 10px;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark); /* Color oscuro para que resalte en fondo blanco */
    position: relative;
}

/* Añadimos la línea naranja debajo de los títulos */
.features-section .main-title::after,
.appointment-section .main-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

/* Diseño de las tarjetas de beneficios */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-item {
    background: var(--bg-light);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
    border: 1px solid #eee;
}

.feature-item:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: var(--shadow);
}

.icon-circle {
    font-size: 2.5rem;
    margin-bottom: 20px;
    display: inline-block;
}

.feature-item h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.25rem;
}

/* --- MEJORAS PARA "AGENDAR CITA" --- */
.appointment-section {
    padding: 80px 5%;
    background-color: var(--bg-light);
}

/* Estilo para los labels del formulario */
.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 0.9rem;
}

/* Botón de agendar con el degradado del directorio */
.btn-submit {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color)) !important;
    color: var(--white) !important;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: filter 0.3s;
    box-shadow: 0 4px 15px rgba(178, 31, 31, 0.3);
}

.btn-submit:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}
