:root {
    --columna-texto: #ffffff;
    --columna-texto-sec: #d0d0d0;
    --columna-fondo: #282e39;
    --columna-activo: #e10600;
    /* Brand Red */
    --columna-oro: #e4a101;
    /* Brand Gold */
    --columna-linea: #444;
    --columna-marco: #3a414e;
    --columna-sombra: rgba(0, 0, 0, 0.4);
}

/* === Galería en una sola columna === */
.galeria {
    display: grid;
    grid-template-columns: 1fr;
    gap: 35px;
    padding: 60px 10%;
    transition: all 0.4s ease;
    background-color: #181d22;
    /* Matches body background */
}

/* === Casilla horizontal === */
.casilla {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    /* Make children same height */
    gap: 0;
    /* Removing gap to let elements touch */
    width: 100%;
    height: 200px;
    background-color: var(--columna-fondo);
    border-radius: 12px;
    border: 1px solid var(--columna-marco);
    box-shadow: 0 10px 30px var(--columna-sombra);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.casilla:hover {
    border-color: #fe7a20;
    transform: translateY(-5px);
}

/* ==================== IMÁGENES ==================== */
.imagen {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 10px;
    position: relative;
    width: 30%;
}

.fondo {
    filter: blur(8px) brightness(0.7);
    height: 100%;
    left: 0;
    object-fit: cover;
    position: absolute;
    top: 0;
    transform: scale(1.1);
    width: 100%;
    z-index: 0;
}

.foto {
    left: 50%;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

/* ==================== SÍMBOLOS FOTO ==================== */
.simbolos_foto {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    position: relative;
    width: 100%;
    z-index: 2;
}

/* ==================== LOGO ==================== */
.img_logo {
    align-items: center;
    display: flex;
    height: 50px;
    justify-content: center;
    position: relative;
    width: 50px;
}

.img_logo::before {
    background: #fe7a20;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    content: '';
    inset: 0;
    position: absolute;
    z-index: -2;
}

.img_logo::after {
    background: var(--blanco);
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    content: '';
    inset: 3px;
    position: absolute;
    z-index: -1;
}

.img_logo img {
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    height: calc(80% - 6px);
    object-fit: contain;
    width: calc(80% - 6px);
    z-index: 1;
}

/* ==================== BOTÓN GALERÍA ==================== */
.simbolos_foto .btn_galeria {
    align-items: center;
    background: #1565d2;
    border: 2px solid #fe7a20;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: var(--blanco);
    cursor: pointer;
    display: flex;
    height: 50px;
    justify-content: center;
    padding: 0;
    position: relative;
    transition: all 0.3s ease;
    width: 50px;
}

.simbolos_foto .btn_galeria:hover {
    background: #dd173a;
}

.simbolos_foto .btn_galeria i {
    align-items: center;
    color: inherit;
    display: flex;
    font-size: 1.2rem;
    justify-content: center;
}

/* ==================== VENTANA MODAL GALERÍA ==================== */
.modal {
    align-items: center;
    backdrop-filter: blur(10px);
    background-color: rgba(10, 14, 23, 0.95);
    display: none;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    left: 0;
    opacity: 0;
    overflow: auto;
    position: fixed;
    top: 0;
    transition: opacity 0.3s ease;
    width: 100%;
    z-index: 1000;
}

.modal.mostrar {
    display: flex;
    opacity: 1;
}

.modal_contenido {
    border: 3px solid #fe7a20;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: block;
    margin: 20px auto;
    max-height: 75vh;
    max-width: 85%;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.mostrar .modal_contenido {
    transform: scale(1);
}

.modal_cerrar {
    color: #fff;
    cursor: pointer;
    font-size: 40px;
    font-weight: bold;
    position: absolute;
    right: 40px;
    top: 30px;
    transition: all 0.2s ease;
    user-select: none;
}

.modal_cerrar:hover {
    color: #fe7a20;
    transform: scale(1.2);
}

#modal_caption {
    color: #ccc;
    display: block;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 1px;
    margin: 10px auto;
    max-width: 700px;
    text-align: center;
    text-transform: uppercase;
    width: 80%;
}

/* ================ ESTADO (Vendido, etc.) ================ */
.estado {
    align-self: flex-start;
    background: #dd173a;
    clip-path: polygon(10% 0, 100% 0%, 90% 100%, 0% 100%);
    color: var(--blanco);
    font-size: 0.8em;
    font-weight: bold;
    padding: 10px 30px;
    position: relative;
    z-index: 2;
}

/* ==================== ETIQUETA ESQUINA ==================== */
.etiqueta_superior {
    align-items: flex-start;
    background-color: red;
    clip-path: polygon(0 0, 100% 0%, 70% 100%, 0% 100%);
    display: flex;
    justify-content: flex-start;
    left: 0;
    padding: 10px;
    position: absolute;
    top: 0;
    width: 50%;
    z-index: 10;
}

.etiqueta_inferior {
    align-items: flex-end;
    background-color: red;
    bottom: 0;
    clip-path: polygon(100% 0, 0% 100%, 100% 100%);
    display: flex;
    height: 20%;
    justify-content: flex-end;
    padding: 10px;
    position: absolute;
    right: 0;
    width: 20%;
    z-index: 10;
}

/* ==================== CONTENIDO ==================== */
.caja_texto {
    color: white;
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 15px 20px;
}

.caja_texto h5 {
    font-size: 1.2em;
    margin: 5px 0;
    text-align: center;
    text-transform: uppercase;
}

.caja_texto hr {
    border: none;
    border-top: 1px solid var(--linea);
    margin: 8px 0;
}

.contenido {
    display: flex;
    flex-wrap: wrap;
    font-size: 0.8em;
    font-weight: 600;
    gap: 8px;
    justify-content: center;
}

.contenido span:not(.separador) {
    font-size: .95em;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
    display: inline-block;
}

.separador {
    display: none;
}

.caja_texto hr {
    border: none;
    border-top: 1px solid white;
}

.contenido_precio {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
}

/* === Precio y oferta === */
.precio {
    font-size: 1.2em;
    font-weight: bold;
}

.oferta {
    background: var(--oferta);
    border-radius: 4px;
    color: var(--blanco);
    padding: 8px 14px;
}

/* ==================== BOTÓN ==================== */
.btn_informacion {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    padding: 15px 0;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    transition: .3s;
    width: 10%;
}

/* Keep icon orientation unchanged */
.btn_informacion .texto_rotado {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.casilla:hover .btn_informacion,
.casilla:active .btn_informacion,
.casilla:focus-within .btn_informacion {
    background: #242e5a;
    color: white;
}

/* ==========================================================================
   ADAPTACIÓN A DISPOSITIVOS MÓVILES (MANTENIENDO CASILLA HORIZONTAL)
   ========================================================================== */

@media (max-width: 1024px) {
    .galeria {
        padding: 40px 5%;
        gap: 25px;
    }

    .casilla {
        height: 180px;
    }

    .imagen {
        width: 35%;
    }

    .img_logo {
        width: 45px;
        height: 45px;
    }

    .simbolos_foto .btn_galeria {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .caja_texto {
        padding: 12px 15px;
        min-width: 0;
    }

    .caja_texto h5 {
        font-size: 1.1em;
    }

    .btn_informacion {
        flex: 0 0 55px;
        font-size: 1em;
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 10px 0;
    }

    /* Cancelar la rotación del icono para que siga apuntando a la derecha */
    .btn_informacion i {
        transform: rotate(180deg);
    }
}

@media (max-width: 768px) {
    .galeria {
        padding: 25px 15px;
        gap: 20px;
    }

    .casilla {
        height: 160px;
    }

    .imagen {
        width: 40%;
    }

    .img_logo {
        width: 38px;
        height: 38px;
    }

    .simbolos_foto .btn_galeria {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .simbolos_foto {
        margin-top: 10px;
    }

    .estado {
        font-size: 0.75em;
        padding: 6px 15px;
    }

    .caja_texto {
        padding: 10px 12px;
        min-width: 0;
    }

    .caja_texto h5 {
        font-size: 1em;
        margin: 3px 0;
    }

    .caja_texto hr {
        margin: 5px 0;
    }

    .contenido {
        font-size: 0.75em;
        gap: 5px;
        justify-content: center;
    }

    .contenido span:not(.separador) {
        padding: 3px 8px;
    }

    .contenido_precio {
        padding-top: 5px;
    }

    .precio {
        font-size: 1em;
    }

    .oferta {
        padding: 4px 8px;
        font-size: 0.75em;
    }

    .btn_informacion {
        flex: 0 0 46px;
        font-size: 0.9em;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .galeria {
        padding: 15px 10px;
        gap: 15px;
    }

    .casilla {
        height: 145px;
    }

    .imagen {
        width: 42%;
    }

    .img_logo {
        width: 32px;
        height: 32px;
    }

    .simbolos_foto .btn_galeria {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .estado {
        font-size: 0.65em;
        padding: 4px 10px;
    }

    .caja_texto {
        padding: 8px 10px;
    }

    .caja_texto h5 {
        font-size: 0.85em;
    }

    .caja_texto hr {
        margin: 3px 0;
    }

    .contenido {
        font-size: 0.7em;
        gap: 4px;
    }

    .contenido span:not(.separador) {
        padding: 2px 6px;
    }

    .contenido_precio {
        padding-top: 3px;
    }

    .precio {
        font-size: 0.9em;
    }

    .oferta {
        padding: 3px 6px;
        font-size: 0.7em;
    }

    .btn_informacion {
        flex: 0 0 38px;
        font-size: 0.75em;
        gap: 5px;
        padding: 5px 0;
    }
}

@media (max-width: 360px) {
    .casilla {
        height: 135px;
    }

    .imagen {
        width: 42%;
        padding: 6px;
    }

    .img_logo {
        width: 28px;
        height: 28px;
    }

    .simbolos_foto .btn_galeria {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .caja_texto {
        padding: 6px;
    }

    .caja_texto h5 {
        font-size: 0.78em;
    }

    .contenido {
        font-size: 0.65em;
        gap: 3px;
    }

    .contenido span:not(.separador) {
        padding: 1px 4px;
    }

    .precio {
        font-size: 0.8em;
    }

    .btn_informacion {
        flex: 0 0 32px;
        font-size: 0.68em;
        gap: 3px;
    }
}