/* =============================================================
 * assets/css/productos.css
 * Estilos del catálogo público y vista detallada.
 * ============================================================= */

/* === Catálogo: grid de productos === */
.producto-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    overflow: hidden;
}
.producto-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.10) !important;
    text-decoration: none;
    color: inherit;
}

.producto-imagen-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--ws-gris-claro);
    overflow: hidden;
    border-top-left-radius: var(--bs-card-inner-border-radius);
    border-top-right-radius: var(--bs-card-inner-border-radius);
}
.producto-imagen-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}
.producto-card:hover .producto-imagen-wrapper img {
    transform: scale(1.05);
}

.categoria-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255,255,255,.95);
    color: var(--ws-gris);
    font-size: .75rem;
    font-weight: 600;
    padding: .25rem .5rem;
    border-radius: 999px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.producto-titulo {
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: .25rem;
}

.producto-card .precio {
    font-size: 1.15rem;
    color: var(--ws-gris);
    font-weight: 700;
}

/* === Galería del detalle === */
.galeria-mini {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s ease;
}
.galeria-mini:hover {
    border-color: var(--ws-naranja);
}
.galeria-mini.active {
    border-color: var(--ws-azul);
}

/* Wrapper de cada miniatura (para overlay +N) */
.galeria-mini-wrap {
    position: relative;
    line-height: 0;
}
.galeria-mini-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}
.galeria-mini-overlay:hover,
.galeria-mini-overlay:focus-visible {
    background: rgba(0, 0, 0, 0.7);
    outline: none;
}

/* Imagen principal (cursor zoom-in al hacer hover) */
.galeria-principal {
    transition: opacity 0.15s ease;
}
.galeria-principal:hover {
    opacity: 0.95;
}

/* Modal galería: imagen grande dentro del carousel */
.galeria-modal-img {
    max-height: 75vh;
    width: 100%;
    object-fit: contain;
    background: var(--ws-fondo);
    margin: 0 auto;
}

/* Flechas del carousel: badge oscuro circular siempre visible */
#galeriaCarousel .carousel-control-prev,
#galeriaCarousel .carousel-control-next {
    width: 48px;
    height: 48px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    opacity: 1;
    transition: background 0.18s ease;
}
#galeriaCarousel .carousel-control-prev:hover,
#galeriaCarousel .carousel-control-next:hover,
#galeriaCarousel .carousel-control-prev:focus,
#galeriaCarousel .carousel-control-next:focus {
    background: rgba(0, 0, 0, 0.75);
    opacity: 1;
}
#galeriaCarousel .carousel-control-prev { left: 12px; }
#galeriaCarousel .carousel-control-next { right: 12px; }
#galeriaCarousel .carousel-control-prev-icon,
#galeriaCarousel .carousel-control-next-icon {
    width: 1.4rem;
    height: 1.4rem;
}

/* Badge de estado en la página de detalle */
.badge {
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* === Reseñas === */
.resena-estrellas {
    color: var(--ws-warning);
    font-size: 1rem;
    letter-spacing: 1px;
}
.resena-estrellas .text-muted {
    color: var(--ws-gris-claro) !important;
}

.rating {
    color: var(--ws-gris);
}
.rating .resena-estrellas {
    font-size: .9rem;
}

/* === Variante mini de producto-card (sección final de recomendaciones) === */
.producto-card.producto-card-mini .producto-imagen-wrapper {
    aspect-ratio: 4 / 3;
    max-height: 110px;
}
.producto-card.producto-card-mini .card-body {
    padding: .5rem;
}
.producto-card.producto-card-mini .producto-titulo {
    font-size: .8rem;
    line-height: 1.25;
    height: 2.5em;
    -webkit-line-clamp: 2;
}
.producto-card.producto-card-mini .precio {
    font-size: .9rem;
}
