/* =======================================================
   1. ESTILOS BASE Y HEADER 
   ======================================================= */
:root {
    --primary-art: #34C759;
    --primary-art-dark: #28a745;
}

.art-header {
    text-align: center;
    padding: 60px 20px 20px;
    position: relative;
    z-index: 2;
}

.art-header h1 {
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.art-header p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 30px;
    line-height: 1.6;
}

.art-header i.header-icon {
    font-size: 4rem;
    color: var(--primary-art);
    margin-bottom: 20px;
    display: inline-block;
    filter: drop-shadow(0 10px 15px rgba(52, 199, 89, 0.3));
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

/* Botón superior de regreso a cultura */
.btn-back {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 10;
}

.btn-back:hover {
    background: var(--primary-art);
    color: white;
    border-color: var(--primary-art);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 199, 89, 0.3);
}

/* =======================================================
   2. BOTÓN INICIAR MUSEO Y GRID DE GALERÍA
   ======================================================= */
.contenedor-museo-btn {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

.btn-iniciar-museo {
    background: linear-gradient(135deg, var(--primary-art), #20c997);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(52, 199, 89, 0.4);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.btn-iniciar-museo:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 35px rgba(52, 199, 89, 0.6);
}

.art-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 35px;
    padding: 0 40px 80px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    align-items: start;
}

.art-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: var(--glass-shine), var(--card-shadow);
    position: relative;
    cursor: pointer;
}

[data-theme="dark"] .art-card {
    box-shadow: var(--glass-shine), var(--modal-glow);
}

.art-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-art);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 30px rgba(52, 199, 89, 0.15);
}

.art-image-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
}

[data-theme="dark"] .art-image-container {
    background: #1e293b;
}

.art-image {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.art-card:hover .art-image {
    transform: scale(1.05);
}

.art-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.art-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--primary-art-dark);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .art-badge {
    background: rgba(15, 23, 42, 0.85);
    color: var(--primary-art);
}

.art-title {
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 8px;
    line-height: 1.2;
}

.art-author {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.btn-ver {
    background: rgba(52, 199, 89, 0.1);
    color: var(--primary-art-dark);
    border: 1px solid rgba(52, 199, 89, 0.2);
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: auto;
    pointer-events: none;
}

[data-theme="dark"] .btn-ver {
    color: var(--primary-art);
}

.art-card:hover .btn-ver {
    background: var(--primary-art);
    color: white;
    box-shadow: 0 8px 15px rgba(52, 199, 89, 0.3);
    transform: translateY(-2px);
}

/* =======================================================
   3. MODAL DE GALERÍA VIRTUAL (FULLSCREEN + SLIDESHOW)
   ======================================================= */
.galeria-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.galeria-modal.activo {
    display: flex;
    opacity: 1;
}

/* Controles Superiores Flotantes */
.modal-top-controls {
    position: absolute;
    top: 20px;
    right: 25px;
    display: flex;
    gap: 15px;
    z-index: 120;
}

.btn-modal-control {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.btn-modal-control:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.btn-modal-control.btn-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    transform: rotate(90deg);
}

/* Flechas de Navegación del Museo */
.nav-museo {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 55px;
    height: 55px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 110;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.nav-museo:hover {
    background: var(--primary-art);
    border-color: var(--primary-art);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 20px rgba(52, 199, 89, 0.4);
}

.prev-museo { left: 25px; }
.next-museo { right: 25px; }

/* Contenedor central (Imagen + Botón abajo) */
.modal-content-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 20px 40px;
    box-sizing: border-box;
    z-index: 10;
}

.img-and-btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
    position: relative;
}

.modal-image-center {
    display: inline-block;
    position: relative;
    max-width: 100%;
    max-height: calc(100% - 60px);
    margin-bottom: 20px;
}

.modal-image-center img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 180px);
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: pan-y pinch-zoom; 
}

/* Botón Inferior para ver Descripción */
.btn-ver-desc {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.btn-ver-desc:hover {
    background: var(--primary-art);
    border-color: var(--primary-art);
    transform: translateY(-5px);
}

/* Panel Flotante de Descripción */
.desc-panel {
    position: absolute;
    bottom: 95px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    width: 90%;
    max-width: 800px;
    max-height: 60vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 35px;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 110;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    color: white;
}

.desc-panel.mostrar {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.desc-panel .galeria-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: white;
    line-height: 1.2;
}

.desc-panel .galeria-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
}

.desc-panel .meta-item {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.desc-panel .galeria-desc {
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    white-space: pre-line;
}

/* Responsive */
@media (max-width: 768px) {
    .art-header { padding: 40px 20px 10px; display: flex; flex-direction: column; align-items: center; }
    .art-header h1 { font-size: 2.5rem; }
    .btn-back { position: relative; top: 0; left: 0; margin: 0 auto 20px auto; width: max-content; }
    
    /* Ajuste de Botón Museo */
    .contenedor-museo-btn { margin-bottom: 30px; }
    .btn-iniciar-museo { font-size: 1rem; padding: 12px 30px; }

    .art-grid { padding: 10px 20px 60px; grid-template-columns: 1fr; }

    /* Ajustes Modal Móvil */
    .modal-content-wrapper { padding: 60px 10px 30px; }
    .modal-top-controls { top: 10px; right: 10px; gap: 10px; }
    .btn-modal-control { width: 40px; height: 40px; font-size: 1.1rem; }
    
    .nav-museo { width: 40px; height: 40px; font-size: 1.2rem; }
    .prev-museo { left: 5px; }
    .next-museo { right: 5px; }

    .desc-panel { width: 95%; bottom: 80px; padding: 25px; max-height: 55vh; }
    .desc-panel .galeria-title { font-size: 1.6rem; }
    .btn-ver-desc { font-size: 1rem; padding: 10px 22px; margin-bottom: 10px; }
    
    .modal-image-center { max-height: calc(100% - 50px); }
    .modal-image-center img { max-height: calc(100vh - 160px); }
}

/* =======================================================
   4. ANIMACIONES
   ======================================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}