* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #8f6fab;
    --primary-dark: #6b4388;
    --primary-light: #e8d9f2;
    --secondary: #4a4a4a;
    --text-gray: #666;
    --bg-light: #f5f5f5;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--secondary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
.header {
    background: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.5s ease;
}

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

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

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    width: 281px;
    height: 90px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-text {
    display: none;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 80px;
}

nav li {
    position: relative;
}

nav li:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 40px;
    background: #ddd;
}

nav a {
    text-decoration: none;
    color: #8f6fab;
    font-size: 15px;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #8f6fab;
    transition: width 0.3s ease;
}

nav a:hover {
    color: #8f6fab;
}

nav a:hover::after {
    width: 100%;
}

/* Menú hamburguesa móvil */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--primary);
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

.mobile-menu-backdrop.active {
    display: block;
}

nav.mobile-active {
    transform: translateX(0) !important;
}


/* Hero */
.hero {
    position: relative;
    height: 500px;
    overflow: hidden;
    background: var(--bg-light);
    max-width: 1200px;
    margin: 0 auto;
}

.hero-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-slide.active {
    opacity: 1;
    z-index: 1;
}

.hero-slide .slide-link {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay para noticias destacadas */
.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: white;
    z-index: 2;
    pointer-events: none;
}

.hero-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.hero-excerpt {
    font-size: 16px;
    opacity: 0.95;
    line-height: 1.5;
    max-width: 800px;
}

/* Flechas navegación - estilo Opción 3 */
.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    transition: all 0.3s;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
}

.hero-slider:hover .hero-arrow {
    opacity: 1;
    pointer-events: auto;
}

.hero-arrow:hover {
    background: rgba(0,0,0,0.5);
    transform: translateY(-50%) scale(1.15);
}

.hero-arrow.prev {
    left: 20px;
}

.hero-arrow.next {
    right: 20px;
}

/* Indicadores dots */
.hero-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.hero-dot:hover {
    background: rgba(255,255,255,0.8);
}

.hero-dot.active {
    background: white;
}

/* Progress bar */
.hero-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255,255,255,0.3);
    z-index: 10;
}

.hero-progress {
    height: 100%;
    background: white;
    width: 0%;
    transition: width 0.1s linear;
}


/* Services */
.services {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0;
}

.services h2 {
    color: var(--text-gray);
    font-size: 26px;
    margin-bottom: 40px;
    font-weight: 500;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 250px);
    gap: 40px;
    justify-content: center;
    padding: 0 40px;
}

.service-card {
    background: var(--primary-light);
    border-radius: 25px;
    padding: 40px 25px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    width: 250px;
    height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.3));
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.service-card:hover::before {
    transform: translateX(100%);
}

.service-card:hover {
    transform: translateY(-10px);
}

.service-icon {
    width: 72px;
    height: 72px;
    background: transparent;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.service-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.15) rotate(10deg);
}

.service-card:hover .service-icon img {
    filter: none;
}

.service-card h3 {
    color: var(--primary-dark);
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.3;
}

.service-card p {
    color: var(--text-gray);
    font-size: 14px;
    line-height: 1.4;
}

/* Institucional */
.institucional {
    background: var(--primary-light);
    padding: 40px;
}

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

.institucional h2 {
    color: var(--primary-dark);
    font-size: 26px;
    margin-bottom: 30px;
    font-weight: 500;
}

.tab-content {
    background: white;
    border-radius: 15px;
    animation: fadeIn 0.5s ease;
    min-height: 350px;
    position: relative;
}

.tabs {
    display: flex;
    gap: 40px;
    padding: 25px 40px 0 40px;
    flex-wrap: wrap;
    position: relative;
}

.tab {
    padding: 0 0 15px 0;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-gray);
    transition: color 0.3s ease;
    position: relative;
    border-bottom: 2px solid transparent;
}

.tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.tab span {
    position: relative;
    z-index: 2;
}

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

.tab.active {
    color: var(--primary);
}

.tab.active::after {
    width: 100%;
}

.tab-text-content {
    padding: 40px;
    border-top: 1px solid #f0f0f0;
}

.tab-text-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-gray);
}

/* Noticias */
.noticias {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0;
}

.noticias h2 {
    color: var(--text-gray);
    font-size: 26px;
    margin-bottom: 40px;
    font-weight: 400;
}

.noticias-grid {
    display: grid;
    grid-template-columns: 540px 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 40px 40px;
    padding: 0 40px;
}

.noticia-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: block;
}

.noticia-card:first-child {
    grid-row: 1 / 3;
    width: 540px;
    height: 580px;
    position: relative;
}

.noticia-card:hover {
    transform: translateY(-8px);
}

.noticia-image {
    width: 100%;
    height: 250px;
    background: var(--bg-light);
    overflow: hidden;
    position: relative;
}

.noticia-card:first-child .noticia-image {
    height: 100%;
    border-radius: 8px;
}

.noticia-card:first-child .noticia-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 50%, transparent 100%);
    pointer-events: none;
}

.noticia-card:not(:first-child) .noticia-image {
    height: 160px;
}

.noticia-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.noticia-card:hover .noticia-image img {
    transform: scale(1.1);
}

.noticia-content {
    padding: 20px;
}

.noticia-card:first-child .noticia-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: transparent;
    z-index: 1;
}

.noticia-card:first-child .noticia-content h3 {
    color: white;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.noticia-card:first-child .noticia-content p {
    color: rgba(255,255,255,0.95);
    font-size: 15px;
    line-height: 1.5;
}

.noticia-card:not(:first-child) .noticia-content {
    padding: 15px;
    height: calc(100% - 160px);
    max-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.noticia-content h3 {
    color: var(--secondary);
    font-size: 17px;
    margin-bottom: 12px;
    line-height: 1.4;
    font-weight: 600;
}

.noticia-card:not(:first-child) .noticia-content h3 {
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.3;
}

.noticia-content p {
    color: var(--text-gray);
    font-size: 14px;
    line-height: 1.6;
}

.noticia-card:not(:first-child) .noticia-content p {
    font-size: 12px;
    line-height: 1.4;
}

/* Contacto */
.contacto {
    background: var(--primary);
    color: white;
    padding: 40px;
}

.contacto-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: center;
}

.contacto h2 {
    font-size: 26px;
    margin-bottom: 0;
    font-weight: 500;
}

.contacto-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

.contacto-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 0;
}

.contacto-icon {
    font-size: 24px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contacto-icon img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

#contacto-telefono-numero {
    font-size: 30px;
}

.contacto-item strong {
    font-size: 18px;
}

.contacto-links {
    display: none;
}

.mapa {
    width: 540px;
    height: 280px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    justify-self: center;
    margin-right: 40px;
}

.mapa iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Modal Comunicados */
.comunicado-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s;
}

.comunicado-modal.active {
    display: flex;
}

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

.comunicado-modal-content {
    background: black;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.comunicado-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    color: black;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.comunicado-close:hover {
    background: white;
    transform: scale(1.1);
}

.comunicado-item {
    padding: 20px;
}

.comunicado-video {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin-bottom: 0;
}

.comunicado-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

.comunicado-imagen {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 0;
}

.comunicado-titulo {
    display: none;
}

.comunicado-descripcion {
    display: none;
}

/* Responsive - Tablet (1024px y menos) */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 250px);
    }

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

    .noticia-card:first-child {
        grid-row: auto;
        grid-column: 1 / -1;
        width: 100%;
        height: auto;
    }

    .noticia-card:first-child .noticia-image {
        height: 400px;
    }

    .noticia-card:not(:first-child) .noticia-image {
        height: 200px;
    }

    .noticia-card:not(:first-child) .noticia-content {
        height: auto;
        max-height: none;
    }
}

/* Responsive - Mobile (768px y menos) */
@media (max-width: 768px) {
    .header-container {
        padding: 15px 20px;
    }
    
    /* Menú hamburguesa */
    .menu-toggle {
        display: block;
    }
    
    nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: white;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        transform: translateX(100%);
        transition: transform 0.3s;
        z-index: 999;
        padding: 80px 30px 30px;
    }
    
    nav ul {
        flex-direction: column;
        gap: 0;
    }
    
    nav li::after {
        display: none !important;
    }
    
    nav a {
        display: block;
        padding: 15px 0;
        font-size: 16px;
        border-bottom: 1px solid #eee;
    }

    .logo {
        width: 220px;
        height: 70px;
    }

    .hero {
        height: 300px;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .hero-excerpt {
        font-size: 14px;
    }
    
    .hero-overlay {
        padding: 20px;
        height: 50%;
    }
    
    .hero-arrow {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .hero-arrow.prev {
        left: 10px;
    }
    
    .hero-arrow.next {
        right: 10px;
    }
    
    .hero-indicators {
        bottom: 10px;
        gap: 8px;
    }
    
    .hero-dot {
        width: 6px;
        height: 6px;
    }

    /* Servicios 2x2 en móvil */
    .services,
    .noticias,
    .institucional {
        max-width: 100%;
        padding: 40px 20px;
    }
    
    .services h2,
    .noticias h2,
    .institucional h2 {
        font-size: 24px;
        margin-bottom: 30px;
        text-align: center;
        padding: 0 20px;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        max-width: 100%;
        padding: 0;
    }

    .service-card {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 25px 15px;
        height: auto;
        min-height: 200px;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
    }
    
    .service-card h3 {
        font-size: 14px;
    }
    
    .service-card p {
        font-size: 12px;
    }

    .services-grid,
    .noticias-grid {
        padding: 0;
    }

    .tabs {
        gap: 25px;
        padding: 20px 20px 0 20px;
    }

    .tab {
        font-size: 13px;
    }

    .tab-text-content {
        padding: 30px 20px;
    }

    /* Noticias todas iguales en móvil */
    .noticias-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        max-width: 100%;
    }

    .noticia-card:first-child {
        grid-column: 1;
    }

    .noticia-card:first-child .noticia-image {
        height: 200px;
    }
    
    .noticia-card:first-child .overlay {
        display: none;
    }
    
    .noticia-card:first-child .noticia-content {
        display: block;
        padding: 20px;
    }

    .contacto {
        padding: 40px 20px;
    }

    .contacto-container {
        grid-template-columns: 1fr;
        gap: 40px;
        max-width: 100%;
    }

    .contacto h2 {
        font-size: 22px;
        text-align: center;
        margin-bottom: 30px;
    }
    
    .contacto-info {
        padding: 0 10px;
    }

    /* Mapa centrado */
    .mapa {
        width: 100%;
        max-width: 100%;
        height: 280px;
        margin: 0 auto;
    }
    
    .mapa iframe {
        border-radius: 8px;
    }
    
    /* Modal comunicados responsive */
    .comunicado-modal-content {
        max-width: 95%;
        max-height: 85vh;
    }
    
    .comunicado-item {
        padding: 20px;
    }
    
    .comunicado-close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
}


/* Responsive - Mobile pequeño (480px y menos) */
@media (max-width: 480px) {
    .header-container {
        padding: 10px 15px;
    }

    .logo {
        width: 180px;
        height: 60px;
    }

    nav ul {
        gap: 15px;
    }

    nav a {
        font-size: 13px;
        padding: 3px 0;
    }

    .hero {
        height: 250px;
    }

    .services h2,
    .noticias h2,
    .institucional h2 {
        font-size: 22px;
        margin-bottom: 30px;
    }

    .services,
    .noticias {
        padding: 30px 0;
    }

    .institucional {
        padding: 30px 15px;
    }

    .services-grid,
    .noticias-grid {
        padding: 0 15px;
    }

    .service-card {
        padding: 30px 15px;
        height: auto;
        min-height: 220px;
    }

    .service-icon {
        width: 70px;
        height: 70px;
    }

    .service-card h3 {
        font-size: 15px;
    }

    .service-card p {
        font-size: 12px;
    }

    .tabs {
        gap: 20px;
        padding: 15px;
    }

    .tab {
        font-size: 12px;
        padding: 0 0 12px 0;
    }

    .tab-text-content {
        padding: 25px 15px;
    }

    .tab-content p {
        font-size: 14px;
    }

    .noticia-card:first-child .noticia-image {
        height: 200px;
    }

    .noticia-card:not(:first-child) .noticia-image {
        height: 180px;
    }

    .noticia-content h3 {
        font-size: 15px;
    }

    .noticia-card:not(:first-child) .noticia-content h3 {
        font-size: 13px;
    }

    .contacto {
        padding: 30px 15px;
    }

    .contacto h2 {
        font-size: 22px;
        margin-bottom: 30px;
    }

    .contacto-item {
        padding: 15px 0;
        gap: 15px;
    }

    .contacto-icon {
        width: 22px;
        height: 22px;
    }

    .contacto-icon img {
        width: 22px;
        height: 22px;
    }

    #contacto-telefono-numero {
        font-size: 28px;
    }

    .contacto-item strong {
        font-size: 16px;
    }

    .contacto-link {
        padding: 10px 20px;
        font-size: 13px;
    }

    .mapa {
        width: 100%;
        max-width: 540px;
        height: 250px;
    }

    .mapa iframe {
        width: 100%;
        height: 100%;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
.fade-in {
    animation: fadeIn 0.8s ease;
}

/* Estilos para contenido institucional con formato */
.tab-text-content strong {
    font-weight: 700;
    color: #1a1a1a;
}

.tab-text-content em {
    font-style: italic;
}

.tab-text-content u {
    text-decoration: underline;
}

.tab-text-content ol,
.tab-text-content ul {
    margin: 15px 0;
    padding-left: 30px;
}

.tab-text-content ol {
    list-style-type: decimal;
}

.tab-text-content ul {
    list-style-type: disc;
}

.tab-text-content li {
    margin: 8px 0;
    line-height: 1.6;
}

.tab-text-content a {
    color: #8f6fab;
    text-decoration: underline;
}

.tab-text-content a:hover {
    color: #6b4388;
}

.tab-text-content p {
    margin-bottom: 15px;
}

/* Estilos para paneles de tabs - CRÍTICO */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}
