@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
}

model-viewer { display: block; }

/* Cursor de huella solo donde existe mouse; no afecta pantallas táctiles. */

/* En móvil el encabezado fluye con la página y nunca cubre el producto. */
#shared-header { min-height: 0; }

/* En pantallas grandes queda siempre disponible, sin invadir el contenido. */
@media (min-width: 768px) {
    #shared-header { min-height: 5.25rem; }
    .site-header { position: fixed; top: 0; right: 0; left: 0; }
}

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.product-card {
    transition: all 0.3s ease;
}

/* Las tarjetas entran suavemente al recorrer el catálogo. */
.product-card-reveal {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    transition: opacity 0.5s ease var(--reveal-delay, 0ms), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms), box-shadow 0.3s ease;
}

.product-card-reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.product-skeleton {
    overflow: hidden;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
}

.product-skeleton-image,
.product-skeleton-content span {
    background: linear-gradient(100deg, #f1f1f1 25%, #fafafa 45%, #f1f1f1 65%);
    background-size: 200% 100%;
    animation: catalog-shimmer 1.35s ease-in-out infinite;
}

.product-skeleton-image { height: 16rem; }
.product-skeleton-content { padding: 1rem; display: grid; gap: 0.75rem; }
.product-skeleton-content span { height: 0.85rem; border-radius: 999px; }
.product-skeleton-content span:nth-child(2) { width: 62%; }
.product-skeleton-content span:nth-child(3) { width: 38%; height: 1.35rem; }

@keyframes catalog-shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .product-card-reveal { opacity: 1; transform: none; transition: none; }
    .product-skeleton-image,
    .product-skeleton-content span { animation: none; }
}

.original-price {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 1rem;
}

.discount-price {
    color: #dc2626;
    font-weight: bold;
}

.header-actions a,
.header-actions button {
    min-width: 42px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-dialog {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
/* Las fotos de producto siempre se muestran completas; el fondo llena el espacio sobrante. */
.product-card .relative > img,
.product-image-frame > img {
    object-fit: contain;
    background: #fff;
}

.product-image-thumbnails {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    padding: .125rem;
    scrollbar-width: thin;
}

.product-image-thumbnail {
    flex: 0 0 6.5rem;
    height: 6.5rem;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: .5rem;
    background: #fff;
    cursor: pointer;
}

.product-image-thumbnail.is-active {
    border-color: #ec4899;
}

.product-image-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-gallery-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, .94);
    color: #1f2937;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
    opacity: 0;
    transform: translateY(-50%);
    transition: opacity .2s ease, background .2s ease;
}

.product-image-frame:hover .product-gallery-arrow,
.product-gallery-arrow:focus-visible {
    opacity: 1;
}

.product-gallery-arrow:hover { background: #fff; }
.product-gallery-prev { left: .75rem; }
.product-gallery-next { right: .75rem; }

@media (max-width: 767px) {
    .header-main-row {
        flex-wrap: wrap;
        gap: 8px 14px;
    }

    .header-logo-link img {
        height: 3.25rem;
    }

    .header-actions {
        gap: 8px;
        margin-left: auto;
    }

    .header-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
        padding-bottom: 4px;
    }

    .header-actions a,
    .header-actions button {
        min-width: 46px;
        min-height: 46px;
    }

    .auth-dialog {
        max-height: 94vh;
    }

    .auth-dialog > div {
        min-height: auto;
    }

    .auth-dialog .p-8 {
        padding: 1.25rem;
    }

    .product-image-frame {
        height: min(72vw, 24rem);
    }

    /* El gesto táctil no activa el zoom ni recorta accidentalmente la foto. */
    .product-image-frame #product-main-image {
        transform: none !important;
    }

    .product-gallery-arrow {
        opacity: 1;
        width: 2.5rem;
        height: 2.5rem;
    }

    .product-image-thumbnail {
        flex-basis: 5rem;
        height: 5rem;
    }
}
