/**
 * Estilos Globales y Base
 * Configuración de variables CSS y estilos globales
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563d4;
    --secondary-color: #4a8be8;
    --dark-color: #f5f7fa;
    --surface-color: #ffffff;
    --card-color: #ffffff;
    --light-color: #eef1f6;
    --text-color: #5a6478;
    --text-bright: #0f1729;
    --border-color: #e2e7ee;
    --error-color: #ff3b3b;
    --success-color: #22c55e;
    --warning-color: #f59e0b;

    /* Transiciones */
    --transition-base: all 0.3s ease;

    /* Espaciados */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 30px;
}

html {
    scroll-behavior: smooth;
    background: #f5f7fa;
}

@media (max-width: 480px) {
    html {
        zoom: 0.82;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    html {
        zoom: 0.88;
    }
}

@media (min-width: 1024px) {
    html {
        zoom: 0.75;
    }
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: var(--text-color);
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(58, 123, 213, 0.10), transparent 60%),
        radial-gradient(ellipse 60% 40% at 100% 30%, rgba(93, 164, 232, 0.06), transparent 70%),
        linear-gradient(180deg, #f5f7fa 0%, #eaeef5 100%);
    background-attachment: fixed;
    min-height: 100vh;
    line-height: 1.6;
    padding-top: 68px;
    position: relative;
}

/* Grid de puntos sutil que da textura "premium" — se difumina hacia los bordes */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(58, 123, 213, 0.15) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
    z-index: 0;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at center, black 0%, transparent 90%);
    mask-image: radial-gradient(ellipse 70% 60% at center, black 0%, transparent 90%);
}

/* Capa de ruido SVG muy sutil para textura tipo "papel grano" */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.06;
    mix-blend-mode: multiply;
}

@keyframes animatedGradient {
    0% {
        background-position: 0% 50%;
        filter: brightness(0.85);
    }

    50% {
        background-position: 100% 50%;
        filter: brightness(1.05);
    }

    100% {
        background-position: 0% 50%;
        filter: brightness(0.85);
    }
}

section, footer, .navbar, .whatsapp-btn, .acordeon-section {
    position: relative;
    z-index: 3;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Botones globales */
.btn-primary,
.btn-secondary,
.btn-danger {
    border: none;
    border-radius: var(--radius-full);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: inherit;
    letter-spacing: 0.4px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
    padding: 13px 28px;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(58, 123, 213, 0.4);
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    padding: 10px 20px;
    border: 2px solid var(--primary-color) !important;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 20px rgba(58, 123, 213, 0.35);
}

.btn-danger {
    background-color: var(--error-color);
    color: white;
    padding: 10px 20px;
}

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.1rem;
}

h6 {
    font-size: 1rem;
}

/* Inputs y formularios globales */
input,
textarea,
select {
    font-family: inherit;
    background: var(--card-color);
    color: var(--text-bright);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 15px;
    font-size: 1rem;
    transition: var(--transition-base);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-color);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ── Splash Screen ── */
.splash {
    position: fixed;
    inset: 0;
    background: #f5f7fa;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}

.splash-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-logo {
    font-size: 2.8rem;
    font-weight: 800;
    color: #0f1729;
    letter-spacing: -1px;
    animation: splashPulse 0.9s ease-in-out infinite alternate;
}

.splash-logo span {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.splash-bar {
    width: 160px;
    height: 3px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.splash-bar::after {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    animation: splashLoad 1.4s ease-in-out forwards;
}

@keyframes splashPulse {
    from { opacity: 0.6; }
    to   { opacity: 1; }
}

@keyframes splashLoad {
    from { width: 0%; }
    to   { width: 100%; }
}

/* ── Scroll animations ── */
.fade-in {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Nav link activo ── */
.nav-link.active {
    color: var(--text-bright);
    border-bottom-color: var(--primary-color);
}

/* ── Botón volver arriba ── */
#back-to-top {
    position: fixed;
    bottom: 5.5rem;
    right: 2rem;
    z-index: 999;
    width: 44px;
    height: 44px;
    background: #ffffff;
    border: 1px solid rgba(58, 123, 213, 0.25);
    border-radius: var(--radius-md);
    color: var(--primary-color);
    box-shadow: 0 4px 14px rgba(15, 23, 41, 0.08);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition-base);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

#back-to-top.btt-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(225,29,72,0.4);
}

/* ── Scroll progress bar ── */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 99999;
    transition: width 0.08s linear;
    pointer-events: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ── Precio: glow pulse al terminar el contador ── */
.precio-precio .price-done {
    animation: priceGlow 0.6s ease-out forwards;
}

@keyframes priceGlow {
    0%   { text-shadow: 0 0 0px rgba(225,29,72,0); }
    50%  { text-shadow: 0 0 20px rgba(225,29,72,0.7), 0 0 40px rgba(225,29,72,0.3); }
    100% { text-shadow: 0 0 0px rgba(225,29,72,0); }
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
