/* ============================================
   ESTILOS DE PRODUCTOS - WebOcasión
   ============================================ */

/* GRID DE PRODUCTOS */
.productos-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 
    gap: 1.5rem; 
}

.producto-card { 
    background: white; 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    transition: transform 0.2s, box-shadow 0.2s;
}

.producto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.producto-card img { 
    width: 100%; 
    height: 200px; 
    object-fit: cover; 
}

.producto-info { 
    padding: 1rem; 
}

.producto-info h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.precio { 
    font-size: 1.3rem; 
    color: #e74c3c; 
    font-weight: bold; 
}

.grado {
    color: #27ae60;
    font-size: 0.9rem;
}

.categoria {
    color: #3498db;
    font-size: 0.9rem;
}

/* CATEGORÍAS */
.categorias-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
    gap: 1rem; 
    margin: 2rem 0; 
}

.categoria-card { 
    text-align: center; 
    padding: 1.5rem; 
    background: white; 
    border-radius: 8px; 
    text-decoration: none; 
    color: #333; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    transition: background 0.2s, color 0.2s;
}

.categoria-card:hover { 
    background: #3498db; 
    color: white; 
}

/* ============================================
   GALERÍA DE FOTOS
   ============================================ */

.volver {
    display: inline-block;
    margin-bottom: 1rem;
    color: #3498db;
    text-decoration: none;
}

.detalle-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* GALERÍA */
.galeria {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.galeria-principal {
    position: relative;
    width: 100%;
    height: 400px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.foto-slide {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.foto-slide.activa {
    display: flex;
}

.foto-grande {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
}

/* FLECHAS */
.flecha {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    transition: background 0.2s;
}

.flecha:hover {
    background: rgba(0,0,0,0.8);
}

.flecha-prev {
    left: 10px;
}

.flecha-next {
    right: 10px;
}

/* INDICADORES */
.indicadores {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.indicador {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.2s;
}

.indicador.activo {
    background: white;
}

/* MINIATURAS */
.miniaturas {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.miniatura {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.miniatura.activa {
    border-color: #3498db;
}

.miniatura img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* INFO PRODUCTO */
.info-producto {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.info-producto .precio {
    font-size: 2.5rem;
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

.info-bloque p {
    margin-bottom: 0.5rem;
    color: #555;
}

.info-bloque .grado {
    color: #27ae60;
    font-weight: bold;
}

.descripcion {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.descripcion h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.btn-contactar {
    display: block;
    text-align: center;
    padding: 1rem;
    background: #27ae60;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 1.5rem;
    transition: background 0.2s;
}

.btn-contactar:hover {
    background: #219150;
}

.titulo-relacionados {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

/* LIGHTBOX */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.lightbox.activo {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-cerrar {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10000;
}

.lightbox-flecha {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 2rem;
    cursor: pointer;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    transition: background 0.2s;
}

.lightbox-flecha:hover {
    background: rgba(255,255,255,0.4);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-contador {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .detalle-container {
        grid-template-columns: 1fr;
    }
    
    .galeria-principal {
        height: 300px;
    }
    
    .info-producto .precio {
        font-size: 2rem;
    }
    
    .flecha {
        width: 40px;
        height: 40px;
        padding: 0.5rem;
        font-size: 1.2rem;
    }
}
