/* =============================================================================
   HABLAME · APP STYLES
   Estilos globales: reset, tipografia, layout, componentes y utilidades.
   Importa tokens.css y se aplica encima de Bootstrap 5.
   ============================================================================= */

@import url('./tokens.css');

/* ---------------- Reset / Base ---------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    color: var(--ink);
    background-color: var(--surface);
    overflow-x: hidden;
}

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

/* Selection */
::selection {
    background: var(--hb-blue);
    color: #fff;
}

/* Scrollbar (webkit) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: var(--slate-100);
}
::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: var(--radius-pill);
    border: 3px solid var(--slate-100);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

/* ---------------- Tipografia ---------------- */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--hb-blue-900);
    margin: 0 0 var(--space-4);
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.25rem, 4.5vw + 1rem, var(--fs-6xl)); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.875rem, 3vw + 0.75rem, var(--fs-4xl)); }
h3 { font-size: clamp(1.5rem, 1.5vw + 0.75rem, var(--fs-3xl)); }
h4 { font-size: var(--fs-2xl); }
h5 { font-size: var(--fs-xl); }
h6 { font-size: var(--fs-lg); }

p {
    margin: 0 0 var(--space-4);
    color: var(--slate-700);
    line-height: var(--lh-relaxed);
}

.lead {
    font-size: var(--fs-lg);
    line-height: var(--lh-relaxed);
    color: var(--slate-700);
}

a {
    color: var(--hb-blue);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--hb-blue-700); }

code, kbd, pre, samp {
    font-family: var(--font-mono);
    font-size: 0.92em;
}

.eyebrow {
    display: inline-block;
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--hb-blue);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: var(--space-3);
}

/* Texto destacado en hero / titulares */
.text-gradient {
    background: var(--gradient-cta);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ---------------- Layout ---------------- */

.container-hb {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--space-6);
}

@media (min-width: 768px) {
    .container-hb { padding-inline: var(--space-8); }
}

.section {
    padding-block: clamp(var(--space-16), 8vw, var(--space-24));
}

.section-sm { padding-block: clamp(var(--space-12), 6vw, var(--space-16)); }

.section-dark {
    background-color: var(--midnight);
    color: #fff;
}
.section-dark h1, .section-dark h2, .section-dark h3,
.section-dark h4, .section-dark h5, .section-dark h6 {
    color: #fff;
}
.section-dark p, .section-dark .lead {
    color: rgba(255, 255, 255, 0.75);
}

.section-soft { background: var(--gradient-soft); }
.section-muted { background-color: var(--bg); }

/* ---------------- Botones ---------------- */

.btn-hb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    line-height: 1;
    border: 1.5px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
    text-decoration: none;
    white-space: nowrap;
}

.btn-hb:focus-visible {
    outline: 2px solid var(--hb-blue);
    outline-offset: 3px;
}

/* Variantes */
.btn-hb-primary {
    background: var(--hb-blue);
    color: #fff;
    box-shadow: var(--shadow-blue);
}
.btn-hb-primary:hover {
    background: var(--hb-blue-600);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-blue-lg);
}

.btn-hb-gradient {
    background: var(--gradient-cta);
    color: #fff;
    box-shadow: var(--shadow-blue);
}
.btn-hb-gradient:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-blue-lg);
}

.btn-hb-outline {
    background: transparent;
    color: var(--hb-blue);
    border-color: var(--hb-blue);
}
.btn-hb-outline:hover {
    background: var(--hb-blue);
    color: #fff;
}

.btn-hb-ghost {
    background: transparent;
    color: var(--ink);
}
.btn-hb-ghost:hover {
    background: var(--slate-100);
    color: var(--ink);
}

.btn-hb-light {
    background: #fff;
    color: var(--hb-blue-900);
}
.btn-hb-light:hover {
    background: var(--slate-100);
    transform: translateY(-2px);
}

/* Tamanos */
.btn-hb-sm { padding: 0.5rem 1rem; font-size: var(--fs-sm); }
.btn-hb-lg { padding: 1rem 2rem; font-size: var(--fs-md); }

/* ---------------- Cards ---------------- */

.card-hb {
    background: var(--surface);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: all var(--duration) var(--ease-out);
}

.card-hb:hover {
    border-color: var(--hb-blue-200);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.card-hb-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--hb-blue-50);
    color: var(--hb-blue);
    font-size: 1.75rem;
    margin-bottom: var(--space-4);
    transition: all var(--duration) var(--ease-out);
}

.card-hb:hover .card-hb-icon {
    background: var(--hb-blue);
    color: #fff;
    transform: scale(1.05);
}

.card-hb h3,
.card-hb h4 {
    margin-bottom: var(--space-2);
    color: var(--hb-blue-900);
}

/* ---------------- Badges / Chips ---------------- */

.badge-hb {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.375rem 0.75rem;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    border-radius: var(--radius-pill);
    background: var(--hb-blue-50);
    color: var(--hb-blue-700);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge-hb-dark {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ---------------- Metric / Stats ---------------- */

.metric {
    text-align: center;
    padding: var(--space-6);
}

.metric-value {
    font-family: var(--font-display);
    font-size: clamp(var(--fs-3xl), 4vw, var(--fs-5xl));
    font-weight: var(--fw-bold);
    line-height: 1;
    color: var(--hb-blue);
    margin-bottom: var(--space-2);
    letter-spacing: -0.02em;
}

.section-dark .metric-value {
    background: var(--gradient-cta);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-label {
    font-size: var(--fs-sm);
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: var(--fw-medium);
}

.section-dark .metric-label {
    color: rgba(255, 255, 255, 0.6);
}

/* ---------------- Utilidades ---------------- */

.divider {
    height: 1px;
    background: var(--slate-200);
    border: 0;
    margin-block: var(--space-8);
}

.shadow-blue { box-shadow: var(--shadow-blue); }
.shadow-blue-lg { box-shadow: var(--shadow-blue-lg); }

/* Animacion sutil de fade-in al cargar (sin AOS) */
.fade-up {
    opacity: 0;
    transform: translateY(16px);
    animation: fadeUp 0.7s var(--ease-out) forwards;
}
.fade-up-delay-1 { animation-delay: 0.1s; }
.fade-up-delay-2 { animation-delay: 0.2s; }
.fade-up-delay-3 { animation-delay: 0.3s; }
.fade-up-delay-4 { animation-delay: 0.4s; }

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Focus accesible global */
:focus-visible {
    outline: 2px solid var(--hb-blue);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ============== CTA Hero (compartido entre paginas) ==============
   Boton CTA grande para banners principales (home, servicios, mayoristas, etc.).
   Usa estructura interna .btn-hero-cta__label + .btn-hero-cta__arrow.
   Animacion: sombra que respira (3.6s) + hover con lift + scale + halo cyan.
*/
.btn-hero-cta {
    padding: 1.15rem 2.6rem !important;
    font-size: var(--fs-md);
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 0 !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.28s ease,
                filter 0.28s ease;
    animation: btn-breathing 3.6s ease-in-out infinite;
}
@keyframes btn-breathing {
    0%, 100% {
        box-shadow: 0 8px 22px rgba(0, 30, 60, 0.32),
                    0 2px 6px rgba(0, 30, 60, 0.18);
    }
    50% {
        box-shadow: 0 14px 32px rgba(0, 30, 60, 0.48),
                    0 4px 12px rgba(0, 30, 60, 0.24);
    }
}
.btn-hero-cta__label,
.btn-hero-cta__arrow {
    position: relative;
    z-index: 2;
}
.btn-hero-cta__arrow {
    display: inline-flex;
    align-items: center;
    margin-left: 0.65rem;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-hero-cta:hover {
    transform: translateY(-3px) scale(1.025);
    animation-play-state: paused;
    box-shadow: 0 18px 40px rgba(0, 30, 60, 0.55),
                0 0 0 4px rgba(0, 212, 255, 0.22) !important;
    filter: brightness(1.06);
}
.btn-hero-cta:hover .btn-hero-cta__arrow {
    transform: translateX(5px);
}
.btn-hero-cta:active {
    transform: translateY(-1px) scale(1.01);
}
@media (prefers-reduced-motion: reduce) {
    .btn-hero-cta { animation: none !important; }
}
