/* VARIABLES & TOKENS */
:root {
    /* Colors based on Alegreya & "Los Hospitales" aesthetic */
    --primary-color: #2F3E46; /* Deep blueish-grey for solid headers */
    --secondary-color: #E46054; /* Highlight text color pulled from original */
    --accent-color: #CAD2C5; /* Soft light sage for backgrounds */
    --background-color: #F8F9FA;
    --text-color: #313131;
    --white: #FFFFFF;
    
    /* Typography */
    --font-serif: 'DM Serif Display', serif;
    --font-sans: 'Alegreya', serif; /* Alegreya was heavily used in the body and headers */
    --font-base: 'Noto Serif', serif;
    
    /* Effects */
    --transition-fast: 0.2s ease-in-out;
    --transition-medium: 0.4s ease-in-out;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* RESET & BASE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-base);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

/* TOP BAR (SOCIAL & LOGO) */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-soft);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 40px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.contact-social a {
    margin-right: 15px;
    font-weight: 500;
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.contact-social a:hover {
    color: var(--secondary-color);
    transform: translateY(-1px);
}

.logo-img {
    height: 60px;
    transition: transform var(--transition-medium);
}
.logo-img:hover {
    transform: scale(1.05);
}

.address {
    text-align: right;
    color: #666;
    font-style: italic;
}

/* NAVIGATION */
.main-nav {
    display: flex;
    justify-content: center;
    padding: 15px 0;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.main-nav a {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 5px;
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--secondary-color);
    transition: width var(--transition-medium);
}

.main-nav a:hover::after, .main-nav a.active::after {
    width: 100%;
}

/* NOTICE SECTION */
.notice-section {
    background: linear-gradient(135deg, white, var(--accent-color));
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid var(--secondary-color);
}

.highlight-text {
    font-family: var(--font-sans);
    color: var(--secondary-color);
    font-size: 1.2rem;
    letter-spacing: 1px;
}

/* HERO SECTION */
.hero-section {
    padding: 60px 20px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 40px;
    line-height: 1.2;
    animation: fadeInDown 1s ease-out;
}

.image-container {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
    margin: 20px auto;
    transition: transform var(--transition-medium);
}

.image-container:hover {
    transform: translateY(-5px);
}

.full-width-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

/* ABOUT SECTION */
.about-section {
    padding: 80px 20px;
    background-color: var(--white);
    position: relative;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.text-center { text-align: center; }
.text-right { text-align: right; }

.section-subtitle {
    font-size: 1.5rem;
    color: #4E657A;
    font-family: var(--font-sans);
}

.divider {
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
    border: none;
    margin: 15px auto 30px;
    border-radius: 2px;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 30px;
}

.about-text p {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 20px;
    text-align: justify;
}

/* FOOTER */
.main-footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 20px 20px;
}

.footer-top {
    text-align: center;
    margin-bottom: 30px;
}

.footer-img {
    max-width: 100%;
    opacity: 0.9;
    border-radius: 8px;
    transition: opacity var(--transition-fast);
}

.footer-img:hover {
    opacity: 1;
}

.footer-text {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 20px;
}

.footer-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.9rem;
}

.subvenciones-banner {
    padding: 40px 20px;
    background-color: #fdfdfd;
    border-top: 1px solid #eee;
    text-align: center;
}

.subvenciones-banner img {
    max-width: 800px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.footer-bottom p {
    color: #ccc;
    margin-bottom: 5px;
}

.btn {
    display: inline-block;
    padding: 10px 25px;
    background: linear-gradient(135deg, #4E657A, #2F3E46);
    color: white;
    border-radius: 8px;
    font-weight: bold;
    font-family: var(--font-sans);
    letter-spacing: 0.5px;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), #c25046);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

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

/* ANIMATIONS */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* COOKIE BANNER */
.cookie-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.1);
    z-index: 10000;
    padding: 25px 40px;
    transition: bottom 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border-top: 3px solid var(--secondary-color);
}

.cookie-banner.show {
    bottom: 0;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.cookie-text {
    flex: 1;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.5;
}

.cookie-buttons {
    display: flex;
    gap: 15px;
    white-space: nowrap;
}

.btn-cookie-info {
    background: #f0f0f0;
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* LEGAL CHECKBOXES */
.legal-checkbox-container {
    margin: 20px 0;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-row input {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.legal-grid-mini {
    margin-top: 15px;
    font-size: 0.8rem;
    color: #666;
    border-top: 1px dashed #ddd;
    padding-top: 15px;
}

@media (max-width: 900px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 0;
    }
    
    .cookie-banner {
        padding: 25px 20px;
    }

    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }
}

/* Estilo base para el botón (oculto en escritorio) */
.menu-toggle {
    display: none;
    z-index: 1001;
}

/* RESPONSIVE DESIGN */
@media (max-width: 900px) {
    .top-bar {
        position: relative; /* Necesario para posicionar el botón */
        flex-direction: column;
        padding: 15px 20px;
        gap: 10px;
        text-align: center;
    }
    
    .address {
        text-align: center;
        font-size: 0.8rem;
    }

    .contact-social {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .contact-social a {
        margin-right: 0;
    }

    /* BURGER MENU STYLES */
    .menu-toggle {
        display: block; /* Visible solo en móviles */
        padding: 10px;
        cursor: pointer;
        background: none;
        border: none;
        color: var(--primary-color);
        font-size: 1.8rem;
        position: absolute;
        right: 15px;
        top: 20px; /* Ajustado para quedar alineado */
    }

    .main-nav {
        display: none;
        width: 100%;
        background: white;
        padding: 0;
        border-top: 1px solid #eee;
    }

    .main-nav.active {
        display: block;
        animation: slideDown 0.3s ease-out;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 10px 0;
    }

    .main-nav li {
        width: 100%;
        border-bottom: 1px solid #f5f5f5;
        text-align: center;
    }

    .main-nav a {
        display: block;
        padding: 12px 20px;
        width: 100%;
        font-size: 1.2rem;
    }

    .main-nav a::after {
        display: none;
    }

    /* TYPOGRAPHY ADJUSTMENTS */
    .hero-title {
        font-size: 1.8rem;
        padding: 0 10px;
        margin-top: 20px;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .about-text p {
        font-size: 1rem;
        text-align: left;
    }

    /* FOOTER ADJUSTMENTS */
    .footer-bottom {
        grid-template-columns: 1fr;
        text-align: center !important;
        gap: 30px;
    }

    .footer-links {
        order: -1;
    }
}

/* Pantallas muy pequeñas */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .logo-img {
        height: 45px;
    }
    
    .menu-toggle {
        top: 15px;
    }
}

@keyframes slideDown {
    to { opacity: 1; transform: translateY(0); }
}

/* Lang Selector */
.lang-selector {
    display: flex;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: bold;
    align-items: center;
}

.lang-selector a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.lang-selector a.active {
    color: var(--secondary-color);
    text-decoration: underline;
}

.lang-selector a:hover {
    color: var(--secondary-color);
}

@media (max-width: 900px) {
    .lang-selector {
        justify-content: center;
        margin-bottom: 10px;
    }
}
