/* ==========================================================================
   ESTILOS EXCLUSIVOS DEL CATÁLOGO: VITRINAS HORIZONTALES CON SCROLL
   ========================================================================== */

.catalog-epoch-block {
    margin-bottom: 45px;
    width: 100%;
}

.epoch-header {
    border-bottom: 1px solid var(--line-museum);
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.epoch-title {
    font-family: 'Playfair Display', serif;
    color: var(--gold-premium);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.3rem;
    margin: 0;
}

.catalog-scroll-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-premium) #000;
    -webkit-overflow-scrolling: touch;
}

/* 🎯 El scroll horizontal y Flexbox SOLO se aplican si el body tiene la clase catalog-page */
.catalog-page .mosaic-grid {
    display: flex !important;
    flex-direction: row !important;
    gap: 16px !important;
    width: max-content !important;
    margin-top: 15px;
}

.catalog-page .museum-card {
    width: 180px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none;
    background-color: #050505;
    border: 1px solid var(--line-museum);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
    text-align: left;
}

/* ==========================================================================
   GRILLA DE INICIO / HOME (Mosaico Normal Vertical Sano - AISLADO)
   ========================================================================== */

/* Forzamos a que si NO es catalog-page, la grilla sea un mosaico estricto */
body:not(.catalog-page) .mosaic-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 20px !important;
    margin-top: 35px !important;
    width: 100% !important;
}

body:not(.catalog-page) .museum-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    background-color: #050505;
    border: 1px solid var(--line-museum);
    border-radius: 4px;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
    text-align: left;
}

.museum-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold-premium);
}

/* Contenedor estricto de imagen cuadrado (1:1) para evitar estiramientos */
.card-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden;
    background-color: #000;
    position: relative;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    display: block;
}

.card-overlay {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-title {
    font-family: 'Playfair Display', serif;
    color: var(--text-pure);
    font-size: 0.95rem;
    line-height: 1.3;
    margin: 0 0 4px 0;
}

.card-origin {
    font-size: 0.65rem;
    color: var(--gold-premium);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-status {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.card-price {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text-pure);
    margin-top: 4px;
    border-top: 1px solid #141416;
    padding-top: 6px;
}


/* ==========================================================================
   DISEÑO DE ARTÍCULO INDIVIDUAL (SANEADO CON TU MAQUETA ACTUAL)
   ========================================================================== */

.museum-single-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 50px;
    margin-top: 30px;
    align-items: start;
}

.museum-gallery-column {
    width: 100%;
}

.museum-meta-column {
    width: 100%;
}

.piece-origin {
    font-size: 0.8rem;
    color: var(--gold-premium);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 10px;
}

.piece-title {
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: var(--text-pure);
}

.piece-meta-box {
    background-color: #050505;
    border: 1px solid var(--line-museum);
    padding: 24px;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.piece-meta-box p {
    margin: 10px 0;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed #141416;
    padding-bottom: 6px;
}

.piece-meta-box p:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.piece-meta-box strong {
    color: var(--text-pure);
    font-weight: 500;
}

.piece-price {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--gold-premium) !important;
    margin-top: 15px !important;
    border-top: 1px solid var(--line-museum);
    padding-top: 14px;
}

.piece-description {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1rem;
    font-weight: 300;
    margin-bottom: 35px;
}

.action-btn {
    display: block;
    text-align: center;
    background-color: transparent;
    color: var(--gold-premium);
    border: 1px solid var(--gold-premium);
    padding: 14px;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 2px;
}

.action-btn:hover {
    background-color: var(--gold-premium);
    color: #000000;
}

/* ==========================================================================
   VISOR INTERNO Y MINIATURAS (REPARADO CON REDIMENSIÓN NATIVA)
   ========================================================================== */

.gallery-frame {
    background-color: #050505;
    border: 1px solid #1a1a1a;
    padding: 14px;
    position: relative;
}

.gallery-main-display {
    width: 100%;
    height: 58vh;
    min-height: 320px;
    max-height: 720px;
    background: radial-gradient(circle at center, #111111 0%, #050505 100%);
    border: 1px solid #202020;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.main-piece-image {
    max-width: 92%;
    max-height: 92%;
    object-fit: contain;
}

.gallery-thumbnails {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px 4px 10px 4px;
    scrollbar-width: none;
}

.gallery-thumbnails::-webkit-scrollbar {
    display: none;
}

.thumb-wrapper {
    flex: 0 0 auto;
    width: 65px !important;
    height: 65px !important;
    background-color: #0b0b0c;
    border: 1px solid var(--line-museum);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    box-sizing: border-box;
}

.thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    padding: 4px;
    box-sizing: border-box;
    background-color: #000000;
}

.thumb-wrapper:hover {
    border-color: var(--gold-premium);
}

.thumb-active {
    border-color: var(--gold-premium) !important;
}

@media (max-width: 768px) {
    .museum-single-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

