/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

/* Animación de entrada de página */
body {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Animaciones de entrada para elementos */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Variables de colores */
:root {
    --azul-oscuro: #003D6E;
    --azul-medio: #0066A6;
    --verde: #00A651;
    --gris-claro: #f5f5f5;
    --blanco: #ffffff;
}

/* Header */
header {
    background-color: var(--azul-oscuro);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    height: 101px;
    background-color: var(--blanco);
    padding: 10px;
    border-radius: 5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.logo:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

nav {
    display: flex;
    gap: 10px;
}

.nav-item {
    position: relative;
}

nav a {
    text-decoration: none;
    color: var(--blanco);
    padding: 12px 25px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    display: block;
}

nav a:hover,
nav a.active {
    background-color: var(--azul-medio);
}

/* Dropdown Menu - Mejorado para mejor UX */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--azul-oscuro);
    min-width: 240px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.3);
    z-index: 1000;
    top: calc(100% - 2px); /* Conectado al botón padre */
    left: 0;
    margin-top: 0;
    border-radius: 0 0 10px 10px;
    padding-top: 5px; /* Área extra para facilitar hover */
}

.dropdown-content a {
    color: var(--blanco);
    padding: 15px 20px; /* Más padding para área de clic más grande */
    text-decoration: none;
    display: block;
    background-color: var(--azul-oscuro);
    border-radius: 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.dropdown-content a:first-child {
    padding-top: 12px;
}

.dropdown-content a:last-child {
    border-bottom: none;
    border-radius: 0 0 10px 10px;
    padding-bottom: 15px;
}

.dropdown-content a:hover {
    background-color: var(--azul-medio);
    padding-left: 25px; /* Efecto visual al hover */
}

/* Área extendida para mantener el menú abierto */
.dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 5px;
    display: none;
}

.dropdown:hover::before,
.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown > a::after {
    content: ' ▼';
    font-size: 9px;
    margin-left: 3px;
}

.header-line {
    height: 4px;
    background-color: var(--verde);
    width: 100%;
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--blanco);
    min-height: calc(100vh - 200px);
}

/* Banner Principal */
.banner-principal {
    width: 100%;
    position: relative;
    overflow: hidden;
    animation: scaleIn 0.8s ease-out;
}

.banner-principal img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.banner-principal:hover img {
    transform: scale(1.02);
}

/* Sección de contenido */
.content-section {
    padding: 40px 20px;
    animation: slideUp 0.8s ease-out;
}

/* Títulos */
h1 {
    color: var(--azul-oscuro);
    font-size: 36px;
    text-align: center;
    margin-bottom: 10px;
    font-weight: bold;
    animation: slideInLeft 0.8s ease-out;
    position: relative;
}

h2 {
    color: var(--azul-oscuro);
    font-size: 28px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    animation: slideUp 0.9s ease-out;
}

h3 {
    color: var(--azul-oscuro);
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: bold;
    transition: color 0.3s ease;
}

h3:hover {
    color: var(--verde);
}

.subtitle {
    text-align: center;
    color: var(--azul-oscuro);
    font-size: 18px;
    margin-bottom: 30px;
    animation: slideUp 1s ease-out;
}

/* Línea verde decorativa */
.green-line {
    height: 3px;
    background-color: var(--verde);
    width: 300px;
    margin: 0 auto 40px;
    animation: expandWidth 1s ease-out;
    position: relative;
}

@keyframes expandWidth {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 300px;
        opacity: 1;
    }
}

.green-line::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--verde), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Grid de servicios */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 40px 0;
}

.service-card {
    text-align: center;
    background-color: var(--blanco);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: scaleIn 0.6s ease-out backwards;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 166, 81, 0.1), transparent);
    transition: left 0.5s ease;
}

.service-card:hover::before {
    left: 100%;
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 61, 110, 0.2);
}

.service-card img {
    width: 100%;
    max-width: 300px;
    height: 200px;
    object-fit: cover;
    margin-bottom: 15px;
    border-radius: 8px;
    transition: transform 0.4s ease, filter 0.4s ease;
    overflow: hidden;
}

.service-card:hover img {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.service-card h3 {
    color: var(--azul-oscuro);
    font-size: 18px;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: bold;
}

.service-card p {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.service-card:hover p {
    color: #333;
}

.btn-green {
    display: inline-block;
    background-color: var(--verde);
    color: var(--blanco);
    padding: 10px 30px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    font-size: 14px;
    position: relative;
    padding-right: 40px;
    transition: all 0.4s ease;
    overflow: hidden;
    z-index: 1;
}

.btn-green::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.btn-green:hover::before {
    left: 100%;
}

.btn-green:after {
    content: '→';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

.btn-green:hover {
    background-color: #008f44;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 166, 81, 0.4);
}

.btn-green:hover:after {
    transform: translateY(-50%) translateX(5px);
}

/* Urgencias especial */
.service-card.urgencias img {
    background-color: #cc0000;
    padding: 20px;
}

/* Footer */
footer {
    background-color: var(--azul-oscuro);
    color: var(--blanco);
    padding: 30px 0 20px;
    margin-top: 50px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-info {
    flex: 1;
}

.footer-info p {
    margin-bottom: 5px;
    font-size: 14px;
    line-height: 1.8;
}

.footer-social {
    display: flex;
    gap: 15px;
    align-items: center;
}

.footer-social a {
    color: var(--blanco);
    font-size: 24px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: inline-block;
}

.footer-social a:hover {
    transform: translateY(-5px) scale(1.2);
    color: var(--verde);
    filter: drop-shadow(0 5px 10px rgba(0, 166, 81, 0.5));
}

.footer-credit {
    text-align: right;
    font-size: 12px;
    margin-top: 10px;
}

/* Página Nosotros */
.nosotros-image {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    display: block;
}

.nosotros-content {
    max-width: 900px;
    margin: 0 auto;
}

.nosotros-section {
    margin-bottom: 40px;
}

.nosotros-section h3 {
    color: var(--verde);
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.nosotros-section p,
.nosotros-section ul {
    text-align: justify;
    color: #555;
    font-size: 14px;
    line-height: 1.8;
}

.nosotros-section ul {
    list-style: none;
    padding-left: 0;
}

.nosotros-section ul li:before {
    content: '• ';
    color: var(--verde);
    font-weight: bold;
    margin-right: 5px;
}

.valores-derechos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.valores-derechos h3 {
    color: var(--azul-oscuro);
    font-size: 18px;
    margin-bottom: 15px;
}

.valores-derechos ul {
    text-align: left;
}

/* Página Servicios */
.servicios-intro {
    max-width: 900px;
    margin: 0 auto 40px;
    text-align: justify;
    color: #555;
    font-size: 14px;
    line-height: 1.8;
}

.servicio-item {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    align-items: flex-start;
}

.servicio-item img {
    width: 300px;
    height: 200px;
    object-fit: cover;
    flex-shrink: 0;
}

.servicio-item-content h3 {
    color: var(--azul-oscuro);
    font-size: 20px;
    margin-bottom: 15px;
}

.servicio-item-content p {
    color: #555;
    font-size: 14px;
    line-height: 1.8;
    text-align: justify;
}

/* Página Especialidades */
.especialidades-intro {
    text-align: center;
    margin-bottom: 40px;
}

.especialidades-intro h2 {
    font-size: 22px;
}

.especialidades-content {
    display: flex;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.especialidades-list {
    flex: 1;
}

.especialidad-group {
    margin-bottom: 25px;
}

.especialidad-group h3 {
    color: var(--azul-oscuro);
    font-size: 16px;
    margin-bottom: 10px;
}

.especialidad-group ul {
    list-style: none;
    padding-left: 0;
}

.especialidad-group ul li {
    color: #555;
    font-size: 14px;
    padding: 3px 0;
}

.especialidad-group ul li:before {
    content: '• ';
    color: var(--verde);
    font-weight: bold;
    margin-right: 5px;
}

.especialidades-image {
    flex-shrink: 0;
}

.especialidades-image img {
    width: 400px;
    height: auto;
}

/* Lista simple de especialidades */
.especialidades-simple-list {
    list-style: none;
    padding-left: 0;
    columns: 1;
}

.especialidades-simple-list li {
    color: #555;
    font-size: 15px;
    padding: 5px 0;
    line-height: 1.8;
}

.especialidades-simple-list li:before {
    content: '• ';
    color: var(--azul-oscuro);
    font-weight: bold;
    margin-right: 8px;
}

/* Página Contacto */
.contacto-container {
    max-width: 1000px;
    margin: 0 auto;
}

.contacto-intro {
    margin-bottom: 30px;
}

.contacto-intro h2 {
    text-align: left;
    font-size: 28px;
    margin-bottom: 15px;
}

.contacto-intro p {
    color: #555;
    font-size: 14px;
    line-height: 1.8;
}

.contacto-emails {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 20px 0;
}

.contacto-emails a {
    color: var(--azul-medio);
    text-decoration: none;
    font-size: 14px;
}

.contacto-emails a:hover {
    text-decoration: underline;
}

.contacto-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.contacto-image img {
    width: 100%;
    height: auto;
}

.contacto-form {
    background-color: var(--blanco);
}

.form-group {
    margin-bottom: 15px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    background-color: #e8f4ff;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #999;
}

.btn-submit {
    background-color: #555;
    color: var(--blanco);
    padding: 10px 30px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    float: right;
}

.btn-submit:hover {
    background-color: #333;
}

.contacto-map {
    margin-top: 40px;
    width: 100%;
}

.contacto-map iframe {
    width: 100%;
    height: 400px;
    border: none;
}

/* Galería de instalaciones */
.instalaciones-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 40px;
}

.instalaciones-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    animation: scaleIn 0.6s ease-out backwards;
}

.instalaciones-grid img:nth-child(1) { animation-delay: 0.1s; }
.instalaciones-grid img:nth-child(2) { animation-delay: 0.15s; }
.instalaciones-grid img:nth-child(3) { animation-delay: 0.2s; }
.instalaciones-grid img:nth-child(4) { animation-delay: 0.25s; }
.instalaciones-grid img:nth-child(5) { animation-delay: 0.3s; }
.instalaciones-grid img:nth-child(6) { animation-delay: 0.35s; }
.instalaciones-grid img:nth-child(7) { animation-delay: 0.4s; }
.instalaciones-grid img:nth-child(8) { animation-delay: 0.45s; }
.instalaciones-grid img:nth-child(9) { animation-delay: 0.5s; }
.instalaciones-grid img:nth-child(10) { animation-delay: 0.55s; }
.instalaciones-grid img:nth-child(11) { animation-delay: 0.6s; }
.instalaciones-grid img:nth-child(12) { animation-delay: 0.65s; }

.instalaciones-grid img:hover {
    transform: scale(1.05) rotate(1deg);
    box-shadow: 0 10px 30px rgba(0, 61, 110, 0.3);
    z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a {
        font-size: 12px;
        padding: 10px 15px;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .valores-derechos {
        grid-template-columns: 1fr;
    }

    .servicio-item {
        flex-direction: column;
    }

    .servicio-item img {
        width: 100%;
    }

    .especialidades-content {
        flex-direction: column;
    }

    .especialidades-image img {
        width: 100%;
    }

    .contacto-content {
        grid-template-columns: 1fr;
    }

    .instalaciones-grid {
        grid-template-columns: 1fr;
    }

    .footer-container {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .footer-credit {
        text-align: center;
    }
}
