/* ============================================================
   PÍDELOYA — ESTILOS BASE
   Variables, reset, tipografía, layout, header, footer
   ============================================================ */

/* ---------- VARIABLES DE COLOR ---------- */
:root {
    /* Primarios */
    --orange-50:  #FFF7ED;
    --orange-100: #FFEDD5;
    --orange-200: #FED7AA;
    --orange-400: #FB923C;
    --orange-500: #F97316;   /* Naranja principal */
    --orange-600: #EA580C;
    --orange-700: #C2410C;

    /* Secundarios */
    --gray-50:  #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Semánticos */
    --green-500: #10B981;
    --green-600: #059669;
    --blue-500:  #3B82F6;
    --blue-600:  #2563EB;
    --purple-500:#8B5CF6;
    --red-500:   #EF4444;
    --yellow-500:#F59E0B;
    --whatsapp:  #25D366;

    /* Texto */
    --text-primary:   #1F2937;
    --text-secondary: #4B5563;
    --text-muted:     #6B7280;
    --text-light:     #9CA3AF;

    /* Superficies */
    --bg-body:    #FFFFFF;
    --bg-soft:    #F9FAFB;
    --bg-card:    #FFFFFF;
    --bg-dark:    #1F2937;

    /* Bordes */
    --border-light: #E5E7EB;
    --border-medium:#D1D5DB;

    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
    --shadow-orange: 0 8px 24px rgba(249,115,22,0.3);

    /* Radios */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Espaciado */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;

    /* Tipografía */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Outfit', 'Inter', sans-serif;

    /* Transiciones */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;

    /* Layout */
    --container-max: 1200px;
    --container-narrow: 800px;
    --header-height: 72px;
}

/* ---------- RESET ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---------- CONTENEDORES ---------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-narrow {
    max-width: var(--container-narrow);
}

/* ---------- SECCIONES ---------- */
.section {
    padding: var(--space-4xl) 0;
}

.section-que-es    { background: var(--bg-soft); }
.section-finanzas  { background: var(--bg-body); }
.section-inventario{ background: var(--bg-soft); }
.section-facturacion{ background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%); }
.section-anuncios  { background: var(--bg-body); }
.section-planes    { background: var(--bg-soft); }
.section-faq       { background: var(--bg-body); }
.section-cta-final { background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%); }

.section-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto var(--space-3xl);
}

.section-badge {
    display: inline-block;
    background: var(--orange-100);
    color: var(--orange-700);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-md);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    color: var(--text-muted);
    line-height: 1.6;
}

/* ---------- HEADER ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    transition: box-shadow var(--transition-base);
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--text-primary);
    flex-shrink: 0;
}

.logo-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.logo-accent { color: var(--orange-500); }

.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex: 1;
    justify-content: center;
}

.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--orange-50);
    color: var(--orange-600);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.25rem;
    background: var(--gray-100);
    transition: all var(--transition-fast);
}

.menu-toggle:hover { background: var(--gray-200); }

/* ---------- FOOTER ---------- */
.site-footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: var(--space-3xl) 0 var(--space-lg);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.footer-col .logo {
    color: white;
    margin-bottom: var(--space-md);
}

.footer-tagline {
    font-size: 0.9rem;
    color: var(--gray-400);
    line-height: 1.6;
    max-width: 320px;
}

.footer-col h4 {
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.footer-col ul { display: flex; flex-direction: column; gap: var(--space-sm); }

.footer-col ul li {
    font-size: 0.88rem;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-col ul a {
    color: var(--gray-400);
    transition: color var(--transition-fast);
}

.footer-col ul a:hover { color: var(--orange-400); }

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    font-size: 0.85rem;
    color: var(--gray-500);
}

.footer-made { display: flex; align-items: center; gap: 6px; }

/* ---------- BOTONES FLOTANTES ---------- */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: var(--whatsapp);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 8px 24px rgba(37,211,102,0.4);
    z-index: 999;
    transition: all var(--transition-base);
    animation: pulse-whatsapp 2.5s infinite;
}

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

@keyframes pulse-whatsapp {
    0%, 100% { box-shadow: 0 8px 24px rgba(37,211,102,0.4); }
    50%      { box-shadow: 0 8px 24px rgba(37,211,102,0.4), 0 0 0 12px rgba(37,211,102,0.1); }
}

.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 96px;
    width: 48px;
    height: 48px;
    background: var(--gray-800);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: var(--shadow-md);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
}

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

.back-to-top:hover { background: var(--orange-500); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 992px) {
    .main-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: var(--space-md);
        border-bottom: 1px solid var(--border-light);
        box-shadow: var(--shadow-lg);
        gap: var(--space-xs);
    }

    .main-nav.open { display: flex; }

    .nav-link {
        width: 100%;
        padding: 12px 16px;
    }

    .menu-toggle { display: flex; align-items: center; justify-content: center; }

    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    :root {
        --space-3xl: 48px;
        --space-4xl: 64px;
    }

    .container { padding: 0 var(--space-md); }

    .header-inner { padding: 0 var(--space-md); }

    .logo { font-size: 1.15rem; }
    .logo-icon { font-size: 1.5rem; }

    .footer-grid { grid-template-columns: 1fr; }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .whatsapp-float {
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
        bottom: 16px;
        right: 16px;
    }

    .back-to-top {
        width: 42px;
        height: 42px;
        bottom: 16px;
        right: 80px;
    }
}

/* ---------- ACCESIBILIDAD ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

:focus-visible {
    outline: 3px solid var(--orange-500);
    outline-offset: 2px;
    border-radius: 4px;
}