/* ═══════════════════════════════════════════════════════════════
   Megadominio — Advanced Parallax & Interaction Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Base ────────────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    opacity: 1 !important;
    visibility: visible !important;
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ── Custom Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #111827; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #dc2626, #ea580c);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: #b91c1c; }

/* ── Selection ───────────────────────────────────────────────── */
::selection { background: #dc2626; color: #fff; }
::-moz-selection { background: #dc2626; color: #fff; }

/* ── Focus ───────────────────────────────────────────────────── */
a:focus, button:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

/* ── Navbar ──────────────────────────────────────────────────── */
nav {
    transition: background 0.4s ease, box-shadow 0.4s ease,
                backdrop-filter 0.4s ease;
}
nav.nav-scrolled {
    background: rgba(17, 24, 39, 0.92) !important;
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
}

/* ── GPU Layers ──────────────────────────────────────────────── */
[data-parallax-speed],
[data-parallax-card] {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    transition: transform 0.15s ease-out;
}

/* ── Floating Animation ──────────────────────────────────────── */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-18px); }
}
.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* ── 3D Card Tilt — Shine Overlay ────────────────────────────── */
.group,
[data-tilt] {
    transition: transform 0.35s cubic-bezier(.03,.98,.52,.99);
    transform-style: preserve-3d;
}
.tilt-shine {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    z-index: 2;
    border-radius: inherit;
    transition: opacity 0.3s ease;
}

/* ── Cursor Glow ─────────────────────────────────────────────── */
.cursor-glow {
    position: fixed;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle,
        rgba(220, 38, 38, 0.35) 0%,
        transparent 70%);
    mix-blend-mode: screen;
    transition: width 0.3s ease, height 0.3s ease,
                background 0.3s ease;
}
.cursor-glow.glow-active {
    width: 56px;
    height: 56px;
    background: radial-gradient(circle,
        rgba(220, 38, 38, 0.5) 0%,
        transparent 70%);
}

/* ── Magnetic Buttons ────────────────────────────────────────── */
.magnetic-btn {
    transition: transform 0.25s cubic-bezier(.03,.98,.52,.99),
                box-shadow 0.25s ease;
}
.magnetic-btn:hover {
    box-shadow: 0 8px 30px rgba(220, 38, 38, 0.3);
}

/* ── Particles Canvas ────────────────────────────────────────── */
.particles-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
}

/* ── Gradient Text ───────────────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, #dc2626 0%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Utilities ───────────────────────────────────────────────── */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.transition-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Glow ring on service cards ──────────────────────────────── */
.group:hover {
    box-shadow:
        0 0 0 1px rgba(220, 38, 38, 0.08),
        0 20px 50px -12px rgba(220, 38, 38, 0.12);
}

/* ── Pulsing dot for "Servicio Premium" badge ────────────────── */
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}
.pulse-dot::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc2626;
    margin-right: 8px;
    animation: pulse-dot 2s ease-in-out infinite;
}

/* ── Mobile Sidebar ──────────────────────────────────────────── */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    pointer-events: none;
    transition: background 0.4s ease, backdrop-filter 0.4s ease;
}
.sidebar-overlay.open {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: auto;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 85vw;
    height: 100dvh;
    z-index: 999;
    background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform 0.4s cubic-bezier(.22,1,.36,1);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0);
}
.mobile-sidebar.open {
    transform: translateX(0);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.4);
}

/* Desktop nav links */
.nav-link {
    color: rgba(255,255,255,.8);
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color .2s, background .2s;
}
.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    color: #d1d5db;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease,
                transform 0.2s ease;
}
.sidebar-link:hover,
.sidebar-link:active {
    background: rgba(220, 38, 38, 0.1);
    color: #fff;
    transform: translateX(4px);
}

/* Stagger entrance for sidebar links */
.mobile-sidebar.open .sidebar-link {
    animation: sidebarSlideIn 0.35s ease forwards;
    opacity: 0;
}
.mobile-sidebar.open .sidebar-link:nth-child(1) { animation-delay: 0.06s; }
.mobile-sidebar.open .sidebar-link:nth-child(2) { animation-delay: 0.12s; }
.mobile-sidebar.open .sidebar-link:nth-child(3) { animation-delay: 0.18s; }
.mobile-sidebar.open .sidebar-link:nth-child(4) { animation-delay: 0.24s; }
.mobile-sidebar.open .sidebar-link:nth-child(5) { animation-delay: 0.30s; }
.mobile-sidebar.open .sidebar-link:nth-child(6) { animation-delay: 0.36s; }

@keyframes sidebarSlideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Hide sidebar on desktop */
@media (min-width: 768px) {
    .mobile-sidebar,
    .sidebar-overlay {
        display: none !important;
    }
}

/* ── Mobile / Reduced Motion ─────────────────────────────────── */
@media (max-width: 768px), (prefers-reduced-motion: reduce) {
    [data-parallax-speed],
    [data-parallax-card] {
        transform: none !important;
        will-change: auto;
        transition: none !important;
    }
    .animate-float { animation: none; }
    .cursor-glow { display: none; }
    .particles-canvas { display: none; }
    .tilt-shine { display: none; }
    .magnetic-btn {
        transform: none !important;
    }
    [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
    }
}
