/* =========================================================
   MEJORAS V4 · ACCESIBILIDAD, CATÁLOGO Y CONTROL DE VENTAS
   ========================================================= */

:root {
    scroll-behavior: smooth;
}

.main-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 5px 25px rgba(20, 38, 80, 0.12);
}

.curso-card,
.obra-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.curso-card:hover,
.obra-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(28, 48, 90, 0.18);
}

.catalog-note {
    text-align: center;
    color: #61708b;
    margin: 0 auto 25px;
    max-width: 670px;
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
    outline: 3px solid #d7a62a;
    outline-offset: 3px;
}

.btn-comprar-obra:disabled {
    background: #64748b !important;
    cursor: not-allowed;
}

/* Distintivos de estado de cada obra */
.obra-img-wrapper {
    position: relative;
}

.obra-sello {
    position: absolute;
    top: 12px;
    right: 0;
    z-index: 1;
    padding: 9px 14px 9px 17px;
    background: #112a46;
    color: #ffffff;
    font-weight: 900;
    letter-spacing: 0.12em;
    font-size: 0.83rem;
    border-radius: 8px 0 0 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.sello-reservada {
    background: #a36a10;
}

.sello-exhibicion {
    background: #4d4c79;
}

.obra-vendida .obra-img {
    filter: grayscale(0.24) brightness(0.84);
}

.obra-vendida {
    border-color: rgba(219, 232, 246, 0.5);
}

.obra-vendida h4 {
    color: #f4f7ff;
}

.compra-no-disponible {
    display: inline-block;
    margin-top: 5px;
    padding: 9px 15px;
    border-radius: 8px;
    background: #273c55;
    color: #f3f6fb;
    font-size: 0.86rem;
    font-weight: 800;
}

.obra-reservada .compra-no-disponible {
    background: #755216;
}

.obra-card .btn-comprar-obra {
    display: inline-block;
    padding: 9px 15px;
    border-radius: 8px;
    background: #237444;
    color: #ffffff;
    text-decoration: none;
}

.obra-card .btn-comprar-obra:hover {
    background: #1b5e36;
}

/* Barra de estado y filtros */
.gallery-status-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 22px;
    width: 100%;
    max-width: 850px;
    padding: 12px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    color: #183a5a;
    box-shadow: 0 4px 14px rgba(16, 43, 71, 0.09);
}

.gallery-count {
    font-weight: 700;
    font-size: 0.94rem;
}

.gallery-status-bar label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.89rem;
    font-weight: 600;
}

.gallery-status-bar select {
    padding: 8px;
    border: 1px solid #c9d8e6;
    border-radius: 8px;
    background: #ffffff;
    color: #123554;
    font: inherit;
}

.gallery-empty {
    grid-column: 1 / -1;
    padding: 20px;
    border-radius: 14px;
    background: #ffffff;
    color: #1e3d5d;
    text-align: center;
}

/* El pie de página fluye después del contenido y no tapa las obras. */
body {
    padding-bottom: 0;
}

.main-footer {
    position: static;
    z-index: auto;
}

@media (max-width: 600px) {
    .obra-sello {
        padding: 7px 10px;
        font-size: 0.72rem;
    }

    .gallery-status-bar {
        padding: 10px;
    }

    .gallery-count {
        font-size: 0.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
