/* ==========================================================================
   ESTILOS CATÁLOGO PÚBLICO VIRTUAL - VAGIBIOM
   ========================================================================== */

.body-publico {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-comercial {
    background: linear-gradient(135deg, #0d6efd, #0046b8);
}

.navbar-brand-static {
    font-weight: 700;
    font-size: 1.5rem;
    text-transform: uppercase;
    color: #ffffff;
    cursor: default;
    user-select: none;
}

/* 📸 Contenedor relativo para el botón flotante en la tarjeta */
.contenedor-prenda-premium {
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* 🔘 Botón flotante "Ver" */
.btn-ver-foto-flotante {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 30;
    width: 36px;
    height: 36px;
    min-width: 36px;
    max-width: 36px;
    min-height: 36px;
    max-height: 36px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    background-color: rgba(255, 255, 255, 0.92);
    color: #4a154b;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-ver-foto-flotante:hover, 
.btn-ver-foto-flotante:active {
    background-color: #ffffff;
    color: #E15B8E;
    transform: scale(1.1);
}

.modal-preview-img {
    max-height: 85vh;
    object-fit: contain;
    width: auto;
    max-width: 100%;
}

.modal-backdrop-dark {
    background-color: rgba(0, 0, 0, 0.85) !important;
}

/* --- Efecto Tarjeta de Doble Cara (3D Flip Card) --- */
.card-flip {
    perspective: 1000px;
}
.card-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease-in-out;
    transform-style: preserve-3d;
}
.card-flip:hover .card-flip-inner {
    transform: rotateY(180deg);
}
.card-flip-front,
.card-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
}
.card-flip-front {
    z-index: 2;
}
.card-flip-back {
    transform: rotateY(180deg);
    z-index: 1;
}

/* ==========================================================================
   CSS GRID DINÁMICO Y RESPONSIVE DE PRODUCTOS Y COMPONENTES
   ========================================================================== */

* {
    box-sizing: border-box;
}

/* 1. Cuadrícula de Productos Adaptativa (.products-grid y .galeria-grid-responsive) */
.products-grid,
.galeria-grid-responsive {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    width: 100%;
    max-width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
}

@media (min-width: 576px) {
    .products-grid,
    .galeria-grid-responsive {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (min-width: 768px) {
    .products-grid,
    .galeria-grid-responsive {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        padding: 0;
    }
}

/* 2. Tarjetas e Imágenes Responsive */
.card,
.product-card,
.tarjeta-publica {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.tarjeta-publica .contenedor-img-responsive,
.card .contenedor-img-responsive,
.product-card .contenedor-img-responsive {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
}

.tarjeta-publica img,
.card img,
.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

/* 3. Offcanvas / Drawer Carrito Responsive (Bottom-sheet en móviles) */
@media (max-width: 767px) {
    #carritoModal .fixed.inset-y-0.right-0 {
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        bottom: 0 !important;
        height: 88vh !important;
        padding-left: 0 !important;
    }
    #carritoModal .w-screen.max-w-md {
        max-width: 100vw !important;
        border-top-left-radius: 1.25rem;
        border-top-right-radius: 1.25rem;
    }
}
