@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap');

:root {
    /* Marca */
    --color-primary:        #CC3333;
    --color-primary-dark:   #AA2222;
    --color-primary-light:  #E55555;

    /* Fondos y superficies */
    --color-background:     #FFFFFF;
    --color-surface:        #F7F7F7;
    --color-surface-alt:    #EEEEEE;
    --color-divider:        #E0E0E0;

    /* Texto */
    --color-text:           #1A1A1A;
    --color-text-secondary: #666666;
    --color-text-disabled:  #AAAAAA;
    --color-text-on-primary:#FFFFFF;

    /* Border radius */
    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-xl:   16px;
    --radius-full: 100px;

    /* Sombras */
    --shadow-card:     0 2px 8px rgba(0,0,0,0.08);
    --shadow-elevated: 0 4px 16px rgba(0,0,0,0.12);

    /* Espaciado */
    --space-xs:  4px;
    --space-sm:  8px;
    --space-md:  16px;
    --space-lg:  24px;
    --space-xl:  32px;
    --space-xxl: 48px;

    /* Tipografía */
    --font-size-h1:      24px;
    --font-size-h2:      20px;
    --font-size-h3:      16px;
    --font-size-body:    14px;
    --font-size-small:   12px;
    --font-size-caption: 11px;
    --font-size-button:  15px;

    --font-weight-light:    300;
    --font-weight-regular:  400;
    --font-weight-semibold: 600;
    --font-weight-bold:     700;

    --line-height-tight:  1.2;
    --line-height-normal: 1.4;
    --line-height-loose:  1.5;

    /* Legado — mantener para no romper clases existentes */
    --rojo-personalizado: #CC3333;
    --gris-personalizado: #E0E0E0;
    --focus-ring: 0 0 0 0.2rem rgba(204, 51, 51, 0.35);
}

#pagina{
    display: grid;
    min-height: 100dvh;
    grid-template-rows: auto 1fr auto;
    gap: 1rem;
}

* {
    font-family: 'Open Sans', sans-serif;
    font-weight: var(--font-weight-regular);
}

body {
    color: var(--color-text);
    background-color: var(--color-background);
}

.enlaces{
    text-decoration: none;
    color: black;
}

.estilosNavbar{
    background-color: var(--rojo-personalizado);
    font-size: 20px;
    min-height: 88px;
}

.rojo{
    color: var(--rojo-personalizado);
    font-size: 2rem;
}

.imagen {
    position: relative;
    margin-left: 0;
    width: auto;
    height: 52px;
}

/* Evita salto visual mientras se inyecta el navbar via JS */
#navbar-placeholder {
    min-height: 88px;
}

.bordeDcha{
    border-right: 2px solid white;
}

.contenedorCentral p {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-loose);
}

.contenedorCentral h1 {
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
}

.contenedorCentral h2 {
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
}

.contenedorCentral h3 {
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-normal);
}

.footerContacto h5,
.footerContacto p {
    font-size: var(--font-size-caption);
    font-weight: var(--font-weight-light);
    line-height: var(--line-height-normal);
}

.img{
    background-color: white;
    max-width: 150px;
    max-height: 100px;
}

.img2{
    width: 50%;
}

.img3{
    width: 60%;
}

.pdf{
    color: black;
    text-decoration: none;
    margin-top: 20px;
}

.legal-links {
    font-size: 0.95rem;
    margin-top: 0.35rem;
}

.legal-links a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-links a:hover {
    opacity: 0.9;
}

.legal-links a:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: 0.25rem;
}

  @media (width <= 1024px) {
   
    #footer .img{
        max-width: 100px;
        max-height: 50px
    }

    #footer{
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    #logosFooter{
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .img3{
        width: 90%;
    }
}

@media (width <= 725px) {

    .contenedorCentral p {
        font-size: var(--font-size-body);
    }

    .contenedorCentral h1 {
        font-size: var(--font-size-h2);
    }

    .bordeDcha{
        border-right: none;
    }

    .imagen {
        position: absolute; 
        top: 5px;
        width: 35%;
    }

    #navbar-placeholder {
        min-height: 72px;
    }

    .footer{
        width: 95%;
        padding: 15px;
    }

    .img3{
        width: 100%;
    }
  }

/* Cards de sedes y servicios */
p.d-flex {
    position: relative;
    margin: 20px;
    cursor: pointer;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-md);
    background-color: var(--color-background);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

p.d-flex:hover {
    box-shadow: var(--shadow-elevated);
}

p.d-flex:hover img {
    transform: scale(1.05);
}

.contenedorCentral a:hover img {
    transform: scale(1.05);
}

/* Ventana emergente (tooltip/modal) */
.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70vw;
    max-width: 800px;
    padding: 20px;
    background-color: rgba(0, 0, 0, 1);
    color: #fff;
    text-align: center;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elevated);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    height: auto;
    max-height: 90vh;
    overflow-y: auto;
}

/* Mostrar la ventana emergente al hacer hover o clic */
.d-flex p.active .popup {
    visibility: visible;
    opacity: 1;
}

.close-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    cursor: pointer;
}

.fondoRojo{
    background-color: var(--color-primary);
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-text-on-primary);
    text-decoration: none;
    font-size: var(--font-size-button);
    font-weight: var(--font-weight-semibold);
    transition: all 0.3s ease;
}

.fondoRojo:hover{
    transform: scale(1.05);
}

/* Acordeones details/summary */
details {
    border: 1px solid var(--color-divider);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    background-color: var(--color-surface);
}

details + details {
    margin-top: var(--space-sm);
}

details[open] {
    background-color: var(--color-surface);
    border-color: var(--color-primary);
}

summary {
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    user-select: none;
}

summary::before {
    content: '▶';
    font-size: 10px;
    color: var(--color-primary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-right: var(--space-sm);
}

details[open] summary::before {
    transform: rotate(90deg);
}

summary::-webkit-details-marker {
    display: none;
}

details p,
details ul,
details a {
    margin-top: var(--space-md);
}

/* Estados de foco visibles para navegacion con teclado */
.nav-link:focus-visible,
.fondoRojo:focus-visible,
.pdf:focus-visible,
.navbar-toggler:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: 0.35rem;
}

