/* ===== CUSTOM STYLES ===== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #5E584C;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #100C0C;
}

/* Selection */
::selection {
    background: #5E584C;
    color: #fff;
}

/* ===== NAVBAR ===== */
#navbar {
    background: transparent;
    transition: all 0.3s ease;
}
#navbar.scrolled {
    background: rgba(16, 12, 12, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}
#navbar.scrolled .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(34, 197, 94, 0);
    }
}

.animate-fade-up {
    animation: fadeUp 0.8s ease-out forwards;
}

.animate-fade-up-delay {
    animation: fadeUp 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

/* Scroll-triggered animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.scroll-animate:nth-child(2) { transition-delay: 0.1s; }
.scroll-animate:nth-child(3) { transition-delay: 0.2s; }
.scroll-animate:nth-child(4) { transition-delay: 0.15s; }
.scroll-animate:nth-child(5) { transition-delay: 0.2s; }
.scroll-animate:nth-child(6) { transition-delay: 0.25s; }

/* ===== CTA WHATSAPP PULSE ===== */
.cta-whatsapp {
    position: relative;
}
.cta-whatsapp::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), transparent);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.cta-whatsapp:hover::after {
    opacity: 1;
}

/* ===== FLOATING WHATSAPP ===== */
#whatsapp-float {
    animation: pulseGlow 2s infinite;
}
#whatsapp-float.hidden-float {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* ===== AREA CARDS ===== */
.area-card {
    position: relative;
    overflow: hidden;
}
.area-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: #5E584C;
    transition: height 0.3s ease;
    border-radius: 0 0 4px 0;
}
.area-card:hover::before {
    height: 100%;
}

/* ===== FORM ===== */
#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
    box-shadow: 0 0 0 3px rgba(94, 88, 76, 0.1);
}

#contact-form button[type="submit"] {
    position: relative;
    overflow: hidden;
}
#contact-form button[type="submit"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}
#contact-form button[type="submit"]:hover::after {
    width: 300px;
    height: 300px;
}

/* Form feedback */
#form-feedback.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
#form-feedback.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ===== PHONE INPUT MASK ===== */
input[type="tel"] {
    font-variant-numeric: tabular-nums;
}

/* ===== COUNTER ANIMATION ===== */
.counter {
    display: inline-block;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    #whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
    #whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
    #whatsapp-float > span:first-of-type {
        display: none;
    }
}

@media (max-width: 640px) {
    .area-card {
        padding: 1.25rem;
    }
}

/* ===== REVIEWS SECTION ===== */
.reviews-track {
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    -ms-overflow-style: none;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
}
.reviews-track:active {
    cursor: grabbing;
}
.reviews-track::-webkit-scrollbar {
    display: none;
}

.review-card {
    width: 300px;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .review-card {
        width: calc(100vw - 96px);
        max-width: 300px;
    }
}

/* ===== PRINT ===== */
@media print {
    #navbar,
    #whatsapp-float,
    .cta-whatsapp {
        display: none !important;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .animate-fade-up,
    .animate-fade-up-delay,
    .scroll-animate {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    #whatsapp-float {
        animation: none !important;
    }
    .animate-ping {
        animation: none !important;
    }
    .animate-bounce {
        animation: none !important;
    }
}