/* ===== FUENTES PERSONALIZADAS ===== */
@font-face {
    font-family: 'Roboto-Bold';
    src: url('/font/Roboto/Roboto-Bold.ttf') format('truetype'),
        url('/font/Roboto/Roboto-BoldItalic.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Roboto-Medium';
    src: url('/font/Roboto/Roboto-Medium.ttf') format('truetype'),
        url('/font/Roboto/Roboto-MediumItalic.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Roboto-Regular';
    src: url('/font/Roboto/Roboto-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Roboto-Light';
    src: url('/font/Roboto/Roboto-Light.ttf') format('truetype'),
        url('/font/Roboto/Roboto-LightItalic.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Aalto-Bold';
    src: url('/font/Aalto/AaltoSansPro-Bold.ttf') format('truetype'),
         url('/font/Aalto/AaltoSansPro-BoldIt.ttf') format('truetype');
    font-weight: normal; 
    font-style: normal; 
}

@font-face {
    font-family: 'Aalto-Medium';
    src: url('/font/Aalto/AaltoSansPro-Medium.ttf') format('truetype'),
         url('/font/Aalto/AaltoSansPro-MediumIt.ttf') format('truetype');
    font-weight: normal; 
    font-style: normal; 
}

@font-face {
    font-family: 'Aalto-Regular';
    src: url('/font/Aalto/AaltoSansPro-Regular.ttf') format('truetype'),
         url('/font/Aalto/AaltoSansPro-RegularIt.ttf') format('truetype');
    font-weight: normal; 
    font-style: normal; 
}

@font-face {
    font-family: 'Aalto-light';
    src: url('/font/Aalto/AaltoSansPro-Light.ttf') format('truetype'),
         url('/font/Aalto/AaltoSansPro-LightIt.ttf') format('truetype');
    font-weight: normal; 
    font-style: normal; 
}

/* ===== VARIABLES DE COLORES ===== */
:root {
  --gray-txt: #323639;
  --red-one: #E11E00;
  --red-two: #940a00;
  --red-three: #BF0909;
  --gray-nav: #D3D3D3;
  --gray-header: #F6F9FC;
  --gray-two: #EDF0F4;
  --gray-three: #DEE3EA;
  --gray-four: #A3A3A3;
  --gray-five: #C5CDDA;
  --yellow: #FFD147;
  --pie-pagina: #E9EAEA;
  --footer: #474747;
  --green: #3C9646;
}

/* ===== RESET Y ESTILOS BASE ===== */
* {
    padding: 0;
    margin: 0;
    text-decoration: none;
    font-family: 'Roboto-Regular', sans-serif;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, var(--gray-header) 0%, var(--gray-two) 50%, var(--gray-three) 100%);
    min-height: 100vh;
    padding: 15px;
}

/* ===== CLASES DE FUENTES ===== */
.ff-medium, .ff-m {
    font-family: 'Roboto-Medium' !important;
}

.ff-bold, .ff-b {
    font-family: 'Roboto-Bold' !important;
}

.ff-regular, .ff-r {
    font-family: 'Roboto-Regular' !important;
}

.ff-a-r {
    font-family: 'Aalto-Regular' !important;
}

.ff-a-m {
    font-family: 'Aalto-Medium' !important;
}

.ff-a-b {
    font-family: 'Aalto-Bold' !important;
}

/* ===== ESTILOS DE GALERÍA ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid var(--gray-three);
}

/* Contenedor de galería */
.gallery-container {
    padding: 20px;
}

/* Área de visualización de imagen */
.image-display {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .image-display {
        gap: 25px;
    }
}

@media (min-width: 992px) {
    .image-display {
        flex-direction: row;
        height: 400px;
        gap: 30px;
        margin-bottom: 40px;
    }
}

/* Contenedor de imagen principal */
.image-wrapper {
    position: relative;
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
    border: 1px solid var(--gray-three);
    cursor: pointer;
    height: 350px;
    width: 100%;
}

@media (min-width: 768px) {
    .image-wrapper {
        height: 400px;
    }
}

@media (min-width: 992px) {
    .image-wrapper {
        height: 100%;
    }
}

.image-wrapper:hover {
    transform: translateY(-5px);
}

/* Contenedor interno para la imagen */
.image-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.image-wrapper:hover img {
    transform: scale(1.03);
}

/* Efecto de zoom para pantalla completa */
.image-wrapper.zooming {
    animation: zoomInOut 0.8s ease-out forwards;
}

@keyframes zoomInOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Overlay de imagen */
.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 20px 15px 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-wrapper:hover .image-overlay {
    opacity: 1;
}

.overlay-content h2 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Aalto-Medium', sans-serif;
    color: white !important;
}

.overlay-content h2 .icon {
    stroke: white;
    fill: none;
    width: 20px;
    height: 20px;
}

.overlay-content p {
    font-size: 0.9rem;
    opacity: 0.9;
    font-family: 'Roboto-Light', sans-serif;
    margin-bottom: 12px;
    color: white;
    line-height: 1.4;
}

.fullscreen-hint {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    opacity: 0.8;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 8px;
    color: white;
}

@media (min-width: 768px) {
    .overlay-content h2 {
        font-size: 1.1rem;
    }
    
    .overlay-content p {
        font-size: 0.95rem;
    }
    
    .fullscreen-hint {
        display: flex;
    }
}

/* Estilos de iconos SVG */
.icon {
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    transition: stroke 0.3s ease;
}

/* Información de la imagen */
.image-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: var(--gray-header);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--gray-three);
    height: 350px;
    width: 100%;
}

@media (min-width: 768px) {
    .image-info {
        height: 400px;
        padding: 25px;
    }
}

@media (min-width: 992px) {
    .image-info {
        height: 100%;
    }
}

.info-text h3 {
    font-family: 'Aalto-Bold', sans-serif;
    font-size: 1.2rem;
    color: var(--gray-txt);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--red-one);
}

@media (min-width: 768px) {
    .info-text h3 {
        font-size: 1.2rem;
    }
}

@media (min-width: 992px) {
    .info-text h3 {
        font-size: 20px;
    }
}

.info-text p {
    color: var(--gray-txt);
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-family: 'Roboto-Regular', sans-serif;
    overflow-y: auto;
    max-height: 200px;
    padding-right: 5px;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .info-text p {
        max-height: 250px;
        font-size: 1rem;
    }
}

/* Scrollbar personalizada para el texto */
.info-text p::-webkit-scrollbar {
    width: 6px;
}

.info-text p::-webkit-scrollbar-track {
    background: var(--gray-three);
    border-radius: 3px;
}

.info-text p::-webkit-scrollbar-thumb {
    background: var(--red-one);
    border-radius: 3px;
}

/* Contador de imágenes */
.image-counter {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--gray-three);
}

.counter-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gray-txt);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Roboto-Bold', sans-serif;
}

@media (min-width: 768px) {
    .counter-text {
        font-size: 1.2rem;
    }
}

.counter-text span:first-child {
    color: var(--red-one);
    font-size: 1.3rem;
}

@media (min-width: 768px) {
    .counter-text span:first-child {
        font-size: 1.4rem;
    }
}

.counter-bar {
    height: 6px;
    background-color: var(--gray-three);
    border-radius: 3px;
    overflow: hidden;
}

.counter-bar .progress {
    height: 100%;
    width: 25%; /* 1/4 para 4 imágenes */
    background: linear-gradient(to right, var(--red-one), var(--red-two));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Controles de galería - ESTRUCTURA MEJORADA */
.gallery-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
}

/* Botones de navegación - EN MÓVIL: SOLO SVG CIRCULAR (SIN TEXTO) */
.control-btn {
    background: white;
    color: var(--red-one);
    border: 2px solid var(--red-one);
    border-radius: 50%; /* Circular en móvil */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-family: 'Roboto-Medium', sans-serif;
    flex-shrink: 0;
    
    /* Tamaño base para móvil - SOLO SVG */
    width: 50px;
    height: 50px;
    padding: 0;
    font-size: 0; /* Ocultar texto en móvil */
    position: relative;
}

.control-btn .icon {
    stroke: var(--red-one);
    transition: stroke 0.3s ease;
    width: 24px;
    height: 24px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.control-btn:hover {
    background: var(--red-one);
    color: white;
    box-shadow: 0 8px 20px rgba(225, 30, 0, 0.3);
}

.control-btn:hover .icon {
    stroke: white;
}

.control-btn:active {
    transform: translateY(-1px);
}

/* En tablet y desktop: mostrar texto y cambiar a rectangular */
@media (min-width: 768px) {
    .control-btn {
        width: auto;
        height: auto;
        border-radius: 30px; /* Rectangular en tablet/desktop */
        padding: 12px 20px;
        min-width: 120px;
        font-size: 1rem; /* Mostrar texto en tablet/desktop */
        gap: 8px;
    }
    
    .control-btn .icon {
        width: 18px;
        height: 18px;
        position: static;
        transform: none;
    }
    
    /* Espaciado entre icono y texto */
    .prev-btn {
        flex-direction: row;
    }
    
    .next-btn {
        flex-direction: row-reverse; /* Para que el SVG quede a la derecha */
    }
}

/* Miniaturas - CENTRADO ENTRE BOTONES */
.thumbnails {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    flex-grow: 1;
    max-width: calc(100% - 120px); /* Espacio para botones circulares */
}

@media (min-width: 768px) {
    .thumbnails {
        gap: 12px;
        max-width: calc(100% - 280px); /* Más espacio para botones con texto */
    }
}

.thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .thumbnail {
        width: 60px;
        height: 60px;
    }
}

@media (min-width: 992px) {
    .thumbnail {
        width: 70px;
        height: 70px;
    }
}

.thumbnail:hover {
    opacity: 0.9;
    transform: translateY(-3px);
}

.thumbnail.active {
    opacity: 1;
    border-color: var(--red-one);
    transform: scale(1.05);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    max-width: 500px;
    width: 100%;
    position: relative;
    animation: modalFade 0.3s ease-out;
    border: 1px solid var(--gray-three);
    max-height: 90vh;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .modal-content {
        padding: 40px;
        max-width: 600px;
    }
}

@keyframes modalFade {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--gray-txt);
    transition: color 0.3s ease;
    line-height: 1;
    z-index: 10;
}

@media (min-width: 768px) {
    .close-modal {
        top: 20px;
        right: 25px;
        font-size: 2rem;
    }
}

.close-modal:hover {
    color: var(--red-one);
}

.modal-content h2 {
    font-family: 'Aalto-Bold', sans-serif;
    color: var(--gray-txt);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
}

@media (min-width: 768px) {
    .modal-content h2 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
}

.modal-content h2 .icon {
    stroke: var(--gray-txt);
    width: 24px;
    height: 24px;
}

.modal-content p {
    margin-bottom: 15px;
    color: var(--gray-txt);
    font-family: 'Roboto-Regular', sans-serif;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .modal-content p {
        margin-bottom: 20px;
    }
}

/* Estilos para pantalla completa */
:fullscreen .image-overlay h2,
:-webkit-full-screen .image-overlay h2,
:-moz-full-screen .image-overlay h2 {
    color: white !important;
}

:fullscreen .image-overlay h2 .icon,
:-webkit-full-screen .image-overlay h2 .icon,
:-moz-full-screen .image-overlay h2 .icon {
    stroke: white;
}

:fullscreen .image-overlay p,
:-webkit-full-screen .image-overlay p,
:-moz-full-screen .image-overlay p {
    color: white;
}

/* Responsive adicional optimizado */
@media (max-width: 767px) {
    /* EN MÓVIL: ASEGURAR QUE SOLO SE VEAN LOS SVG */
    .control-btn {
        /* Forzar que sea solo círculo con SVG */
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        font-size: 0 !important;
    }
    
    /* Asegurar que el SVG sea visible y centrado */
    .control-btn .icon {
        width: 24px !important;
        height: 24px !important;
        display: block !important;
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
    }
    
    /* Eliminar cualquier espacio que pueda quedar del texto */
    .control-btn {
        gap: 0 !important;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .gallery-container {
        padding: 15px;
    }
    
    .image-wrapper, .image-info {
        height: 320px;
    }
    
    .control-btn {
        width: 45px !important;
        height: 45px !important;
        min-width: 45px !important;
        min-height: 45px !important;
    }
    
    .control-btn .icon {
        width: 22px !important;
        height: 22px !important;
    }
    
    .thumbnails {
        gap: 6px;
        max-width: calc(100% - 100px); 
    }
    
    .thumbnail {
        width: 45px;
        height: 45px;
    }
    
    .info-text h3 {
        font-size: 1.3rem;
    }
    
    .overlay-content h2 {
        font-size: 1.1rem;
    }
    
    .overlay-content p {
        font-size: 0.85rem;
    }
    
    .counter-text {
        font-size: 1.1rem;
    }
    
    .counter-text span:first-child {
        font-size: 1.3rem;
    }
}

@media (max-width: 360px) {
    .image-wrapper, .image-info {
        height: 280px;
    }
    
    .control-btn {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
    }
    
    .control-btn .icon {
        width: 20px !important;
        height: 20px !important;
    }
    
    .thumbnail {
        width: 40px;
        height: 40px;
    }
    
    .thumbnails {
        gap: 5px;
        max-width: calc(100% - 90px);
    }
    
    .info-text h3 {
        font-size: 1.2rem;
    }
}

/* Mejora para orientación landscape en móviles */
@media (max-height: 600px) and (orientation: landscape) {
    .image-display {
        flex-direction: row;
        height: 400px;
        gap: 15px;
    }
    
    .image-wrapper, .image-info {
        height: 100%;
    }
    
    .info-text p {
        max-height: 120px;
    }
    
    .thumbnails {
        gap: 6px;
    }
    
    .thumbnail {
        width: 40px;
        height: 40px;
    }
    
    .gallery-controls {
        margin-top: 15px;
    }
}

/* Ajustes para pantallas muy pequeñas (menos de 320px) */
@media (max-width: 320px) {
    .control-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }
    
    .control-btn .icon {
        width: 18px !important;
        height: 18px !important;
    }
    
    .thumbnail {
        width: 35px;
        height: 35px;
    }
    
    .thumbnails {
        gap: 4px;
        max-width: calc(100% - 80px);
    }
}

/* Estilos para botones deshabilitados */
.control-btn:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    color: var(--gray-four) !important;
    border-color: var(--gray-four) !important;
}

.control-btn:disabled .icon {
    stroke: var(--gray-four) !important;
}

.control-btn:disabled:hover {
    background: white !important;
    box-shadow: none !important;
}