/* === Contenedor de galería === */
.galeria {
    max-width: 100%;
    overflow-x: hidden;
}

.casilla {
    max-width: 320px;
    width: 100%;

}

.galeria {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(260px, max-content));
    justify-content: center;
    padding: 40px 80px;
    transition: all 0.4s ease;
}

/* === Estilos comunes de casilla === */
.casilla {
    background: #282e39;
    border: 3px solid #2f3440;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: .3s ease;
}

.casilla:hover {
    border-color: #fe7a20;
    transform: translateY(-5px);
}

/* ==================== IMÁGENES ==================== */
.imagen {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 240px;
    justify-content: space-between;
    overflow: hidden;
    padding: 10px;
    position: relative;
    width: 100%;
}

.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;
}

/* ================ 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;
}

/* ==================== 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%;
}

/* ==================== ETIQUETA ESQUINA ==================== */
.etiqueta_superior {
    align-items: flex-start;
    background-color: #2f3440;
    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: #2f3440;
    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;
}

.caja_texto hr {
    border: none;
    border-top: 1px solid white;
}

.separador {
    display: none;
}

.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 {
    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: 100%;
}

.casilla:hover .btn_informacion,
.casilla:active .btn_informacion,
.casilla:focus-within .btn_informacion {
    background: #242e5a;
    color: white;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .galeria {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        justify-content: center;
        padding: 40px 30px;
    }

    .imagen {
        height: 50vw;
    }

    .contenido h5 {
        font-size: 1.1em;
    }

    .contenido {
        font-size: 0.75em;
        gap: 5px;
    }

    .contenido span:not(.separador) {
        padding: 3px 8px;
    }

    .precio {
        font-size: 1em;
    }

    .oferta {
        font-size: 1em;
        padding: 6px 10px;
    }
}

@media (max-width: 520px) {
    .galeria {
        grid-template-columns: 1fr;
        justify-items: center;
        padding: 30px 15px;
    }

    .casilla {
        max-width: 320px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .galeria {
        grid-template-columns: 1fr;
        padding: 20px 15px;
    }

    .contenido {
        font-size: 0.7em;
        gap: 4px;
    }

    .contenido span:not(.separador) {
        padding: 2px 6px;
    }

    .precio {
        font-size: 1.7rem;
        margin: 0 auto 1rem auto;
    }

}