/* ===================================
   Distribuidora San José - Estilos custom
   Complementan Tailwind CSS v4 CDN
   =================================== */

/* Offset para navbar fija */
html {
    scroll-padding-top: 5rem;
}

/* ----------
   ANIMACIONES
   ---------- */
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-down {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
    animation: fade-in-up 0.7s ease-out both;
}

.animate-fade-in-down {
    animation: fade-in-down 0.6s ease-out both;
}

.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-400 { animation-delay: 0.4s; }
.animation-delay-600 { animation-delay: 0.6s; }

/* ----------
   NAVBAR
   ---------- */
#navbar.scrolled {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border-color: transparent;
}

/* ----------
   SCROLL REVEAL - Service Cards
   ---------- */
.service-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out,
                box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ----------
   SECCIONES: reveal general
   ---------- */
.section-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ----------
   FORMULARIO
   ---------- */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* ----------
   WHATSAPP FLOTANTE
   ---------- */
.whatsapp-float {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 40;
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(37, 211, 102, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 32px rgba(37, 211, 102, 0.5);
}

/* ----------
   SELECT: placeholder styling (Firefox)
   ---------- */
@-moz-document url-prefix() {
    select:invalid { color: #94a3b8; }
    select:valid   { color: #1e293b; }
}

/* ----------
   VIDEO HERO
   ---------- */
#hero video {
    z-index: 0;
}

#hero .relative.z-10 {
    z-index: 10;
}

/* Fallback: si el video no carga, el fondo blanco del section actúa */
@supports not (object-fit: cover) {
    #hero video { display: none; }
}

/* ----------
   COUPON CARDS - staggered entrance
   ---------- */
.coupon-card {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    animation: coupon-enter 0.5s ease-out forwards;
}

@keyframes coupon-enter {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.coupon-card.is-used {
    opacity: 0;
    animation: coupon-enter-used 0.5s ease-out forwards;
}

@keyframes coupon-enter-used {
    to {
        opacity: 0.6;
        transform: translateY(0) scale(1);
    }
}

.coupon-card.is-used:hover {
    opacity: 0.75;
}

/* ----------
   BOUNCE SLOW (emoji bounce)
   ---------- */
.animate-bounce-slow {
    animation: bounce-slow 2s ease-in-out infinite;
}

@keyframes bounce-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ----------
   COUPON MINI CARDS (dashboard home)
   ---------- */
.coupon-mini {
    opacity: 0;
    transform: translateY(12px);
    animation: coupon-mini-enter 0.4s ease-out forwards;
}

@keyframes coupon-mini-enter {
    to { opacity: 1; transform: translateY(0); }
}

/* ----------
   STAT CARDS - hover lift
   ---------- */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--tw-gradient-from, #dc2626), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover::after {
    opacity: 1;
}

/* ----------
   PRINT
   ---------- */
@media print {
    #navbar,
    .whatsapp-float,
    .cotizar-btn,
    #confetti-canvas { display: none !important; }
}
