/* =========================================
   VARIABLES & CONFIGURACIÓN
   ========================================= */
:root {
    --primary: #1B4623;
    --primary-hover: #245A2C;
    --accent: #FFD730;
    --accent-hover: #EBC52A;
    --success: #10B981;
    --error: #EF4444;
    --surface: #FFFFFF;
    --text-main: #0B1220;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --radius: 14px;
    --shadow-card: 0 20px 40px rgba(2, 6, 23, 0.10);
    --shadow-soft: 0 6px 14px rgba(2, 6, 23, 0.08);
    --font-header: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    --fc-green-900: #1B4623;
    --fc-green-800: #245A2C;
    --fc-green-700: #2E6C37;
    --fc-olive-600: #798031;
    --fc-gold-500:  #FFD730;
    --fc-gold-600:  #EBC52A;
    --fc-cream-50:  #FFEEBB;
    --fc-ink:       #0B1220;
    --fc-slate-700: #334155;
    --fc-slate-500: #64748B;
    --fc-slate-200: #E2E8F0;
    --fc-slate-100: #F1F5F9;
    --fc-white:     #FFFFFF;
    --fc-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --fc-dur-1: 140ms;
    --fc-dur-2: 220ms;
}

/* =========================================
   BASE
   ========================================= */
html { scroll-behavior: smooth; }
body { 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
    font-family: var(--font-body);
}

/* Theme First Cash */
.theme-firstcash {
    --primary: var(--fc-green-900);
    --primary-hover: var(--fc-green-800);
    --accent: var(--fc-gold-500);
    --accent-hover: var(--fc-gold-600);
    --surface: var(--fc-surface);
    --text-main: var(--fc-ink);
    --text-muted: var(--fc-slate-500);
    --border: var(--fc-slate-200);
    --shadow-card: var(--fc-shadow-lg);
    --shadow-soft: var(--fc-shadow-sm);
}

/* =========================================
   UTILITIES
   ========================================= */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================
   COMPONENTS
   ========================================= */
.glass-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-card);
}

/* =========================================
   FONDOS DE SECCIÓN — SISTEMA VISUAL
   Cada sección tiene fondo propio para dar
   profundidad y ritmo visual al scroll.
   Las imágenes usan rutas en img/bg-*.webp
   que puedes reemplazar con fotos reales.
   ========================================= */

/* ── 1. HERO ─────────────────────────────
   Fondo: imagen de auto/dinero con overlay
   degradado verde→oscuro para legibilidad.
   NOTA: NO usar background-attachment:fixed
   porque falla en iOS Safari.
   ──────────────────────────────────────── */
.hero-bg {
    position: relative;
    background-color: #0B1220; /* fallback sólido */
    background-image:
        linear-gradient(
            135deg,
            rgba(27, 70, 35, 0.92) 0%,
            rgba(11, 18, 32, 0.88) 50%,
            rgba(27, 70, 35, 0.85) 100%
        ),
        url('img/bg-hero.webp');
    background-size: cover;
    background-position: center 40%;
    background-repeat: no-repeat;
}

/* Decorative blurs sobre el hero — se mantienen */
.hero-bg .hero-blob-tr,
.hero-bg .hero-blob-bl {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 1;
}

.hero-bg .hero-blob-tr {
    top: -80px;
    right: -80px;
    width: 384px;
    height: 384px;
    background: rgba(255, 215, 48, 0.12);
}

.hero-bg .hero-blob-bl {
    bottom: -80px;
    left: -80px;
    width: 320px;
    height: 320px;
    background: rgba(27, 70, 35, 0.15);
}

/* ── 2. CÓMO FUNCIONA ────────────────────
   Fondo: blanco con patrón sutil de cruces
   en verde corporativo a muy baja opacidad.
   ──────────────────────────────────────── */
.bg-como-funciona {
    background-color: #ffffff;
    background-image:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231b4623' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ── 3. POR QUÉ ELEGIRNOS ────────────────
   Fondo: imagen desaturada con overlay
   claro para mantener legibilidad y dar
   sensación de confianza/profesionalismo.
   ──────────────────────────────────────── */
.bg-value-prop {
    position: relative;
    background-color: #F8FAFC;
    background-image:
        linear-gradient(
            180deg,
            rgba(248, 250, 252, 0.95) 0%,
            rgba(241, 245, 249, 0.92) 100%
        ),
        url('img/bg-value.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ── 4. SUCURSALES ───────────────────────
   Fondo: textura de mapa/ciudad con overlay
   blanco. Da contexto geográfico sutil.
   ──────────────────────────────────────── */
.bg-sucursales {
    position: relative;
    background-color: #ffffff;
    background-image:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.96) 0%,
            rgba(255, 255, 255, 0.93) 100%
        ),
        url('img/bg-sucursales.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ── 5. BLOG / CONSEJOS ──────────────────
   Fondo: degradado suave con patrón de
   puntos en dorado a opacidad mínima.
   ──────────────────────────────────────── */
.bg-blog {
    background-color: #FAFBFC;
    background-image:
        radial-gradient(
            circle at 20% 80%,
            rgba(255, 215, 48, 0.06) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 80% 20%,
            rgba(27, 70, 35, 0.05) 0%,
            transparent 50%
        ),
        url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23FFD730' fill-opacity='0.07'%3E%3Ccircle cx='3' cy='3' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
}

/* ── 6. FAQ ──────────────────────────────
   Fondo: blanco con líneas diagonales muy
   sutiles para diferenciar de secciones
   adyacentes sin competir con el contenido.
   ──────────────────────────────────────── */
.bg-faq {
    background-color: #ffffff;
    background-image:
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%231b4623' fill-opacity='0.02'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
}

/* ── 7. FOOTER ───────────────────────────
   Fondo: imagen oscura de ciudad/oficina
   con overlay para mantener el texto
   legible sobre fondo casi negro.
   ──────────────────────────────────────── */
.bg-footer {
    background-color: #0F172A;
    background-image:
        linear-gradient(
            180deg,
            rgba(15, 23, 42, 0.97) 0%,
            rgba(15, 23, 42, 0.95) 100%
        ),
        url('img/bg-footer.webp');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
}

/* =========================================
   FOOTER LOGO
   ========================================= */
.footer-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    filter: brightness(1) invert(0); /* Invierte a blanco si el logo es oscuro */
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.footer-logo:hover {
    opacity: 1;
}

/* Si tu logo YA es blanco o tiene fondo
   transparente con texto claro, quita el
   filtro con esta clase alternativa: */
.footer-logo--no-invert {
    filter: none;
}

/* =========================================
   FORM ELEMENTS
   ========================================= */
.form-group { margin-bottom: 0.5rem; }
.input-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.form-select, .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-main);
    background-color: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s ease-in-out;
    appearance: none;
}

.form-select:hover, .form-input:hover {
    border-color: #CBD5E1;
    background-color: #fff;
}

.form-select:focus, .form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 70, 35, 0.14);
    background-color: #fff;
}

.form-select:disabled {
    background-color: #E2E8F0;
    color: #94A3B8;
    cursor: not-allowed;
}

/* Validation states */
.form-select.input-success, .form-input.input-success {
    border-color: var(--success);
    background-color: #F0FDF4;
}

.form-select.input-error, .form-input.input-error {
    border-color: var(--error);
    background-color: #FEF2F2;
}

.select-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

/* =========================================
   RADIO PILLS
   ========================================= */
.radio-pill {
    cursor: pointer;
    position: relative;
}

.radio-pill input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-pill span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.6rem;
    background-color: #F1F5F9;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.radio-pill input:checked + span {
    background-color: rgba(27, 70, 35, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

.radio-pill:hover span {
    background-color: #E2E8F0;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn-primary, .btn-accent, .btn-secondary {
    cursor: pointer;
    border: none;
    text-decoration: none;
    user-select: none;
    will-change: transform;
}

.btn-primary {
    background: var(--primary);
    color: white;
    font-weight: 700;
    padding: 1rem;
    border-radius: var(--radius);
    transition: all 0.2s;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(27, 70, 35, 0.22);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(27, 70, 35, 0.28);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-accent {
    background: var(--accent);
    color: #0B1220;
    font-weight: 700;
    padding: 1rem;
    border-radius: var(--radius);
    transition: all 0.2s;
    display: block;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(255, 215, 48, 0.25);
}

.btn-accent:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-accent:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    border-radius: 9999px;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-secondary:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
}

.btn-whatsapp {
    background-color: #25D366;
    color: white;
    font-weight: 600;
    padding: 0.75rem;
    border-radius: var(--radius);
    transition: opacity 0.2s;
}

.btn-whatsapp:hover {
    opacity: 0.9;
}

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

.slide-up-animation {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bounceShort {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.animate-bounce-short {
    animation: bounceShort 2s infinite;
}

.hidden { display: none !important; }

/* =========================================
   GRID COMPONENTS
   ========================================= */
.branch-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .branch-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .branch-grid { grid-template-columns: repeat(3, 1fr); }
}

.branch-card {
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 6px);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.branch-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.branch-card__media {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, rgba(27,70,35,0.08), rgba(255,215,48,0.12));
}

.branch-card__body {
    padding: 16px;
}

.branch-card__title {
    margin: 0 0 6px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 1rem;
}

.branch-card__meta {
    margin: 0 0 12px;
    color: var(--text-muted);
    line-height: 1.45;
    font-size: 0.875rem;
}

.branch-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .blog-grid { grid-template-columns: repeat(3, 1fr); }
}

.blog-card {
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 6px);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.blog-card__body {
    padding: 16px;
}

.blog-card__title {
    margin: 0 0 6px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 1.05rem;
}

.blog-card__excerpt {
    margin: 0 0 12px;
    color: var(--text-muted);
    line-height: 1.55;
    font-size: 0.875rem;
}

.blog-card__meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================================
   STICKY WHATSAPP
   ========================================= */
.wa-sticky {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wa-sticky__label {
    display: none;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    border-radius: 999px;
    padding: 10px 14px;
    box-shadow: var(--shadow-soft);
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .wa-sticky__label { display: block; }
}

/* =========================================
   DETAILS/SUMMARY
   ========================================= */
details > summary {
    list-style: none;
}

details > summary::-webkit-details-marker {
    display: none;
}

/* =========================================
   ACCESSIBILITY
   ========================================= */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

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

/* =========================================
   MOBILE ADJUSTMENTS
   Reduce espacio hero→cotizador en móvil
   para que el formulario se vea más arriba
   sin necesidad de hacer scroll excesivo.
   ========================================= */
@media (max-width: 640px) {
    .font-header { letter-spacing: -0.01em; }
    #form { padding: 1.25rem; }
    .btn-primary { padding: 0.875rem; }

    /* ── Hero móvil: texto + cotizador más juntos ── */
    .hero-section-mobile {
        padding-top: 5rem;   /* antes 6rem (pt-24) — header 4rem + 1rem respiro */
        padding-bottom: 2rem; /* antes 3rem (pb-12) */
    }

    /* Reduce margen entre texto marketing y cotizador */
    .hero-text-col {
        margin-bottom: 0.75rem; /* antes 1.5rem (mb-6) */
    }

    /* H1 más compacto en móvil */
    .hero-text-col h1 {
        font-size: 1.875rem; /* ~text-3xl en vez de text-4xl */
        margin-bottom: 1rem;
    }

    /* Párrafo descriptivo más compacto */
    .hero-text-col p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 380px) {
    /* Pantallas muy pequeñas (SE, etc) */
    .hero-section-mobile {
        padding-top: 4.5rem;
        padding-bottom: 1.5rem;
    }

    .hero-text-col h1 {
        font-size: 1.625rem;
    }
}
