/* ============================================================
   Ruta: /public_html/css/styles.css
   Grupo Comercial Aries | Hoja de Estilos v1.0.3
   Físicas 3D, Floating Notch, Scroll Unroll, Dark Mode Integral
   y Capa de Refinamiento Estético (solo CSS, sin tocar HTML).
   Nota: los selectores [class~="..."] sustituyen a los escapes
   de Tailwind para que este archivo no contenga barras invertidas.
   ============================================================ */

/* ==========================================
   0. VARIABLES DE DISEÑO
   ========================================== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --nav-bg: rgba(255, 255, 255, 0.90);
    --notch-bg: rgba(241, 245, 249, 0.85);

    --aries-main: #0056D2;
    --aries-dark: #0044A5;
    --aries-light: #EFF6FF;
    --aries-glow: rgba(0, 86, 210, 0.18);
    --navy: #0F172A;
    --grad-brand: linear-gradient(135deg, #0A64E8 0%, #0056D2 45%, #0044A5 100%);
    --grad-line: linear-gradient(90deg, #0056D2 0%, #3B82F6 60%, #93C5FD 100%);
    --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lift: 0 2px 4px rgba(15, 23, 42, 0.04), 0 18px 40px -12px rgba(0, 86, 210, 0.28);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --nav-offset: 96px;
}

html.dark {
    --bg-primary: #0B1120;
    --bg-secondary: #0F172A;
    --bg-tertiary: #1E293B;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --card-bg: #1E293B;
    --card-border: #334155;
    --nav-bg: rgba(11, 17, 32, 0.92);
    --notch-bg: rgba(30, 41, 59, 0.90);

    --aries-glow: rgba(59, 130, 246, 0.22);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.30), 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 40px -12px rgba(37, 99, 235, 0.35);
}

/* ==========================================
   1. BASE, TIPOGRAFÍA Y BLINDAJE
   ========================================== */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-user-select: none;
    user-select: none;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.35s ease, color 0.35s ease;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
}

/* Los campos de formulario deben permitir escritura y selección (corrige bloqueo en iOS Safari) */
input,
textarea,
select {
    -webkit-user-select: text;
    user-select: text;
}

img {
    -webkit-user-drag: none;
}

h1,
h2,
h3 {
    text-wrap: balance;
    letter-spacing: -0.02em;
}

p {
    text-wrap: pretty;
}

/* Compensación del encabezado fijo al navegar por anclas */
header[id],
section[id] {
    scroll-margin-top: var(--nav-offset);
}

/* Anillo de foco accesible solo para teclado */
:focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid rgba(0, 86, 210, 0.55);
    outline-offset: 3px;
    border-radius: 10px;
}

html.dark :focus-visible {
    outline-color: rgba(147, 197, 253, 0.7);
}

/* Barra de desplazamiento global */
html {
    scrollbar-width: thin;
    scrollbar-color: #94A3B8 transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 9999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056D2;
    background-clip: content-box;
}

html.dark ::-webkit-scrollbar-thumb {
    background: #334155;
    background-clip: content-box;
}

@media print {
    body { display: none !important; }
}

/* ==========================================
   2. DARK MODE INTEGRAL Y 3D THEME FLIP
   ========================================== */
.perspective-wrapper {
    perspective: 2200px;
    overflow-x: hidden;
}

#theme-flip-card {
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform;
    transition: transform 0.65s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.3s ease;
}

.flipping-3d {
    transform: rotateY(180deg) scale(0.96);
    opacity: 0.25;
}

/* Cobertura total de Modo Oscuro en todas las secciones */
html.dark body,
html.dark main,
html.dark section.bg-white {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

html.dark header#inicio {
    background: linear-gradient(to bottom, #0B1120, #0F172A) !important;
}

html.dark section.bg-gray-50 {
    background-color: var(--bg-secondary) !important;
    border-color: var(--card-border) !important;
}

html.dark .bg-white {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

html.dark .bg-gray-50 {
    background-color: #0F172A !important;
    color: var(--text-primary) !important;
}

html.dark .bg-gray-100 {
    background-color: #334155 !important;
    color: #F8FAFC !important;
}

html.dark .from-white {
    --tw-gradient-from: #1E293B !important;
    --tw-gradient-to: #0F172A !important;
}

html.dark .bg-aries-light {
    background-color: rgba(59, 130, 246, 0.16) !important;
}

html.dark [class~="bg-aries-light/30"],
html.dark [class~="bg-aries-light/20"] {
    background-color: rgba(59, 130, 246, 0.07) !important;
}

html.dark .text-corporate-navy {
    color: #F8FAFC !important;
}

html.dark .text-gray-500,
html.dark .text-gray-600,
html.dark .text-gray-700 {
    color: var(--text-secondary) !important;
}

html.dark .text-aries-main {
    color: #60A5FA !important;
}

html.dark .border-gray-50,
html.dark .border-gray-100,
html.dark .border-gray-200,
html.dark .border-blue-200 {
    border-color: var(--card-border) !important;
}

/* Variantes hover de Tailwind que en oscuro destellarían en blanco */
html.dark [class~="hover:bg-white"]:hover,
html.dark [class~="hover:bg-gray-50"]:hover,
html.dark [class~="hover:bg-gray-200"]:hover,
html.dark [class~="hover:bg-aries-light/10"]:hover,
html.dark [class~="hover:bg-aries-light/30"]:hover {
    background-color: var(--bg-tertiary) !important;
}

html.dark [class~="hover:bg-red-50"]:hover {
    background-color: rgba(220, 38, 38, 0.12) !important;
}

html.dark input,
html.dark select {
    background-color: #0B1120 !important;
    color: #F8FAFC !important;
    border-color: #334155 !important;
}

html.dark input::placeholder {
    color: #64748B !important;
}

html.dark select option {
    background-color: #0F172A;
    color: #F8FAFC;
}

/* ==========================================
   3. DESKTOP: FLOATING NOTCH (Canica Esmerilada)
   ========================================== */
.desktop-notch-bar {
    position: relative;
    background: var(--notch-bg);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    padding: 6px;
    border-radius: 9999px;
    border: 1px solid rgba(0, 86, 210, 0.22);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 20px -4px rgba(0, 86, 210, 0.12);
    display: flex;
    align-items: center;
    gap: 2px;
}

html.dark .desktop-notch-bar {
    border-color: rgba(96, 165, 250, 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 24px -6px rgba(0, 0, 0, 0.5);
}

#frosted-marble {
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 0;
    width: 110px;
    background: linear-gradient(135deg, rgba(0, 86, 210, 0.18), rgba(0, 86, 210, 0.32));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 86, 210, 0.45);
    box-shadow: 0 4px 12px rgba(0, 86, 210, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    border-radius: 9999px;
    z-index: 0;
    pointer-events: none;
    transition: transform 0.45s var(--ease-spring), width 0.35s var(--ease-spring);
}

html.dark #frosted-marble {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(37, 99, 235, 0.45));
    border-color: rgba(96, 165, 250, 0.6);
}

.notch-hop {
    animation: marbleHop 0.35s var(--ease-spring);
}

@keyframes marbleHop {
    0% { transform: var(--marble-x, translateX(0)) scale(1); }
    45% { transform: var(--marble-x, translateX(0)) translateY(-5px) scaleX(0.92) scaleY(1.08); }
    100% { transform: var(--marble-x, translateX(0)) scale(1); }
}

.nav-link {
    position: relative;
    z-index: 1;
    padding: 9px 18px;
    border-radius: 9999px;
    transition: color 0.25s ease, transform 0.2s ease, letter-spacing 0.25s ease;
    white-space: nowrap;
    cursor: pointer;
}

.nav-link:hover {
    color: #0056D2 !important;
}

html.dark .nav-link:hover {
    color: #93C5FD !important;
}

.nav-link-active {
    color: #0056D2 !important;
    font-weight: 800;
}

html.dark .nav-link-active {
    color: #93C5FD !important;
}

/* ==========================================
   4. BARRA SUPERIOR Y MOBILE: SCROLL UNROLL (Pergamino)
   ========================================== */
#main-navbar {
    background: var(--nav-bg);
    backdrop-filter: blur(12px) saturate(170%);
    -webkit-backdrop-filter: blur(12px) saturate(170%);
    transition: transform 0.38s var(--ease-out), box-shadow 0.3s ease, background-color 0.3s ease;
}

/* Hilo de marca bajo la barra */
#main-navbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--grad-line);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

/* Al desplazarse (logo reducido) la barra gana profundidad y el hilo azul aparece */
#main-navbar:has(.logo-shrunk) {
    box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.25) !important;
}

#main-navbar:has(.logo-shrunk)::after {
    opacity: 1;
}

html.dark #main-navbar {
    border-color: rgba(51, 65, 85, 0.6) !important;
}

.navbar-hidden {
    transform: translateY(-105%);
}

#mobile-menu {
    transform-origin: top center;
    transform: perspective(900px) rotateX(-85deg) scaleY(0);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}

#mobile-menu.unrolled {
    transform: perspective(900px) rotateX(0deg) scaleY(1);
    opacity: 1;
    pointer-events: auto;
}

#mobile-menu > a:not(.bg-aries-main) {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease, padding-left 0.25s var(--ease-out);
}

#mobile-menu > a:not(.bg-aries-main):active,
#mobile-menu > a:not(.bg-aries-main):hover {
    color: #0056D2;
    padding-left: 0.5rem;
}

html.dark #mobile-menu > a:not(.bg-aries-main):hover {
    color: #93C5FD;
}

/* ==========================================
   5. LOGOTIPO EQUILIBRADO Y PROPORCIONADO
   ========================================== */
#brand-logo {
    height: 68px;
    max-height: 68px;
    width: auto;
    max-width: 210px;
    object-fit: contain;
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1), max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

@media (max-width: 768px) {
    #brand-logo {
        height: 52px;
        max-height: 52px;
        max-width: 165px;
    }
}

.logo-shrunk {
    height: 46px !important;
    max-height: 46px !important;
}

html.dark #brand-logo {
    filter: drop-shadow(0 0 10px rgba(147, 197, 253, 0.18));
}

/* ==========================================
   6. BOTONES DE MARCA (Gradiente, Brillo y Presión)
   ========================================== */
button.bg-aries-main,
a.bg-aries-main,
button.bg-blue-600 {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background-image: var(--grad-brand);
    box-shadow: 0 10px 24px -10px rgba(0, 86, 210, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease, filter 0.25s ease;
}

button.bg-green-500 {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background-image: linear-gradient(135deg, #34D399 0%, #22C55E 45%, #16A34A 100%);
    box-shadow: 0 10px 24px -10px rgba(22, 163, 74, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease, filter 0.25s ease;
}

/* Destello diagonal al pasar el cursor */
button.bg-aries-main::after,
a.bg-aries-main::after,
button.bg-blue-600::after,
button.bg-green-500::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 45%;
    background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.28) 50%, transparent 100%);
    transform: skewX(-18deg);
    pointer-events: none;
    transition: left 0.7s var(--ease-out);
    z-index: -1;
}

@media (hover: hover) {
    button.bg-aries-main:hover,
    a.bg-aries-main:hover,
    button.bg-blue-600:hover,
    button.bg-green-500:hover {
        transform: translateY(-2px);
        filter: brightness(1.06) saturate(1.05);
        box-shadow: 0 16px 32px -12px rgba(0, 86, 210, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    }

    button.bg-green-500:hover {
        box-shadow: 0 16px 32px -12px rgba(22, 163, 74, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    }

    button.bg-aries-main:hover::after,
    a.bg-aries-main:hover::after,
    button.bg-blue-600:hover::after,
    button.bg-green-500:hover::after {
        left: 120%;
    }
}

button.bg-aries-main:active,
a.bg-aries-main:active,
button.bg-blue-600:active,
button.bg-green-500:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 0.08s;
}

button:disabled {
    cursor: wait;
}

/* Botones de tema (Luna / Sol) */
button[onclick="toggleDarkMode()"] {
    transition: transform 0.3s var(--ease-spring), background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

button[onclick="toggleDarkMode()"]:hover {
    box-shadow: 0 0 0 4px var(--aries-glow);
}

.theme-toggle-icon {
    display: inline-block;
    transition: transform 0.5s var(--ease-spring);
}

button[onclick="toggleDarkMode()"]:hover .theme-toggle-icon {
    transform: rotate(-20deg) scale(1.08);
}

/* ==========================================
   7. HERO (Inicio)
   ========================================== */
header#inicio {
    overflow: hidden;
    isolation: isolate;
}

/* Halo de luz de marca detrás del contenido */
header#inicio::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 720px;
    height: 720px;
    top: -320px;
    right: -180px;
    background: radial-gradient(circle, rgba(0, 86, 210, 0.14) 0%, rgba(0, 86, 210, 0) 65%);
    pointer-events: none;
}

header#inicio::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 520px;
    height: 520px;
    bottom: -300px;
    left: -200px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.10) 0%, rgba(59, 130, 246, 0) 65%);
    pointer-events: none;
}

html.dark header#inicio::before {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.22) 0%, rgba(59, 130, 246, 0) 65%);
}

/* Palabra "Hogar." con degradado de marca */
header#inicio h1 .text-aries-main {
    background-image: linear-gradient(120deg, #0056D2 10%, #3B82F6 60%, #0044A5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

html.dark header#inicio h1 .text-aries-main {
    background-image: linear-gradient(120deg, #60A5FA 10%, #93C5FD 55%, #3B82F6 100%);
}

/* Entrada escalonada sincronizada con la salida del Skeleton */
header#inicio .space-y-6 > * {
    animation: fadeUp 0.8s var(--ease-out) both;
}

header#inicio .space-y-6 > *:nth-child(1) { animation-delay: 0.35s; }
header#inicio .space-y-6 > *:nth-child(2) { animation-delay: 0.48s; }
header#inicio .space-y-6 > *:nth-child(3) { animation-delay: 0.60s; }

#hero-slider {
    animation: fadeScale 1s var(--ease-out) 0.45s both;
    box-shadow: 0 30px 60px -20px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(0, 86, 210, 0.10) !important;
}

/* Marco de luz sobre el carrusel */
#hero-slider::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), inset 0 -60px 80px -40px rgba(15, 23, 42, 0.18);
    pointer-events: none;
    z-index: 2;
}

/* Acercamiento lento (efecto Ken Burns) en la imagen visible */
#hero-slider [data-slide] img {
    transform: scale(1.0);
    transition: transform 6s ease-out;
}

#hero-slider [data-slide].opacity-100 img {
    transform: scale(1.06);
}

html.dark #hero-slider {
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(96, 165, 250, 0.18) !important;
}

/* ==========================================
   8. ENCABEZADOS DE SECCIÓN Y FONDOS
   ========================================== */
/* Barra decorativa bajo los títulos con degradado */
section h2 + div.bg-aries-main,
section .text-center > div.bg-aries-main {
    background-image: var(--grad-line);
    border-radius: 9999px;
}

/* Trama de puntos sutil en Sucursales */
#sucursales {
    background-image: radial-gradient(rgba(0, 86, 210, 0.08) 1px, transparent 1px);
    background-size: 22px 22px;
}

html.dark #sucursales {
    background-image: radial-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px);
}

/* Encabezado de cada sucursal con degradado navy → azul */
#sucursales .bg-corporate-navy {
    background-image: linear-gradient(135deg, #0F172A 0%, #13264D 55%, #0044A5 100%);
    position: relative;
}

#sucursales .bg-corporate-navy::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--grad-line);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.45s var(--ease-out);
}

#sucursales .card-hover:hover .bg-corporate-navy::after {
    transform: scaleX(1);
}

/* Footer con halo superior */
footer.bg-corporate-navy {
    position: relative;
    background-image: radial-gradient(ellipse 60% 120% at 50% -20%, rgba(0, 86, 210, 0.35) 0%, rgba(15, 23, 42, 0) 70%);
}

footer.bg-corporate-navy::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.6), transparent);
}

footer a,
footer button {
    transition: color 0.2s ease, text-underline-offset 0.25s ease;
}

footer a:hover,
footer button:hover {
    text-underline-offset: 5px;
}

/* ==========================================
   9. TARJETAS, FORMULARIOS Y PESTAÑAS
   ========================================== */
.card-hover {
    transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease, border-color 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lift) !important;
    border-color: #0056D2;
}

html.dark .card-hover:hover {
    border-color: #3B82F6 !important;
}

/* Ícono de cada tarjeta del Centro de Soluciones */
#servicios .card-hover > div:first-child {
    transition: transform 0.45s var(--ease-spring);
}

#servicios .card-hover:hover > div:first-child {
    transform: translateY(-3px) rotate(-6deg) scale(1.05);
}

#servicios .card-hover > div.bg-aries-main:first-child {
    background-image: var(--grad-brand);
}

/* Campos de formulario */
#servicios input[type="text"],
#servicios select {
    min-height: 46px;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

#servicios input[type="text"]:hover,
#servicios select:hover {
    border-color: #93C5FD;
}

#servicios input[type="text"]:focus,
#servicios select:focus {
    border-color: #0056D2 !important;
    box-shadow: 0 0 0 4px rgba(0, 86, 210, 0.14);
}

html.dark #servicios input[type="text"]:focus,
html.dark #servicios select:focus {
    border-color: #3B82F6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.22);
}

#servicios input[type="checkbox"] {
    cursor: pointer;
}

/* Pestañas (Nosotros y Políticas) */
.tab-active {
    background-color: #0056D2 !important;
    background-image: var(--grad-brand);
    color: white !important;
    border-color: #0056D2 !important;
    box-shadow: 0 8px 20px -8px rgba(0, 86, 210, 0.6);
}

[id^="btn-tab-"] {
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

[id^="btn-tab-"]:active {
    transform: scale(0.98);
}

/* Aparición suave del contenido al cambiar de pestaña */
[id^="content-tab-"]:not(.hidden) {
    animation: fadeUp 0.45s var(--ease-out) both;
}

/* Valores: tarjetas con elevación */
#content-tab-valores .grid > div {
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

#content-tab-valores .grid > div:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
    border-color: rgba(0, 86, 210, 0.35) !important;
}

/* Directrices: desplazamiento lateral */
#content-tab-directrices .grid > div {
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease;
}

#content-tab-directrices .grid > div:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-soft);
}

/* Acordeones de Políticas */
[onclick^="toggleAccordion"] {
    transition: background-color 0.2s ease, color 0.2s ease;
}

[onclick^="toggleAccordion"]:has(+ .accordion-content.open) {
    background-color: var(--aries-light) !important;
}

html.dark [onclick^="toggleAccordion"]:has(+ .accordion-content.open) {
    background-color: rgba(59, 130, 246, 0.12) !important;
}

/* ==========================================
   10. SPINNERS, TOAST Y COMPONENTES INTERACTIVOS
   ========================================== */
.btn-spinner {
    display: inline-block;
    width: 1.15rem;
    height: 1.15rem;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.whatsapp-float {
    position: fixed;
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    right: 28px;
    z-index: 100;
    box-shadow: 0 14px 30px -8px rgba(22, 163, 74, 0.65) !important;
}

/* Onda expansiva que invita al contacto */
.whatsapp-float::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
    animation: waRing 2.4s ease-out infinite;
    pointer-events: none;
}

@keyframes waRing {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
    70% { box-shadow: 0 0 0 18px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@media (max-width: 640px) {
    .whatsapp-float {
        right: 18px;
        bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    }
}

.error-field {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22) !important;
    animation: shakeX 0.4s ease;
}

html.dark .error-field {
    background-color: #450a0a !important;
}

@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

#toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 14px 22px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-left: 4px solid #FACC15;
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.45);
    transform: translateX(150%);
    transition: transform 0.45s var(--ease-spring);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

#toast.show {
    transform: translateX(0);
}

@media (max-width: 640px) {
    #toast {
        left: 16px;
        right: 16px;
        top: calc(16px + env(safe-area-inset-top, 0px));
        transform: translateY(-160%);
    }

    #toast.show {
        transform: translateY(0);
    }
}

/* Banner de cookies y modal de redirección */
#cookie-banner {
    animation: slideUp 0.6s var(--ease-out) 0.9s both;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#redireccion-modal:not(.hidden) > div {
    animation: fadeScale 0.35s var(--ease-spring) both;
}

.legal-scroll { scrollbar-width: thin; scrollbar-color: #cbd5e1 #f1f1f1; }
.legal-scroll::-webkit-scrollbar { width: 8px; }
.legal-scroll::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.legal-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

html.dark .legal-scroll { scrollbar-color: #334155 #0F172A; }
html.dark .legal-scroll::-webkit-scrollbar-track { background: #0F172A; }
html.dark .legal-scroll::-webkit-scrollbar-thumb { background: #334155; }

@keyframes pulse-soft {
    0%, 100% { transform: scale(1) rotate(12deg); }
    50% { transform: scale(1.06) rotate(12deg); }
}

.pulse-discount {
    animation: pulse-soft 2s infinite;
    background-image: radial-gradient(circle at 30% 25%, #F87171 0%, #DC2626 55%, #B91C1C 100%);
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.12), 0 14px 30px -8px rgba(220, 38, 38, 0.6) !important;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0, 1, 0, 1);
}

.accordion-content.open {
    max-height: 3500px;
    transition: max-height 0.8s ease-in-out;
}

.rotate-icon { transition: transform 0.3s ease; }
.rotated { transform: rotate(180deg); }

/* ==========================================
   11. ANIMACIONES COMPARTIDAS
   ========================================== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeScale {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}

/* Revelado al desplazarse (solo navegadores compatibles; el resto muestra todo normal) */
@supports (animation-timeline: view()) {
    @keyframes revealUp {
        from { opacity: 0; translate: 0 28px; }
        to { opacity: 1; translate: 0 0; }
    }

    #servicios .card-hover,
    #sucursales .card-hover {
        animation: revealUp linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 28%;
    }
}

/* ==========================================
   12. ACCESIBILIDAD: MOVIMIENTO REDUCIDO
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }

    #hero-slider [data-slide].opacity-100 img {
        transform: none;
    }
}