/**
 * InkaBox Express — sistema visual (PASO 1)
 * Tokens + primitivas. El header (PASO 2) también vive aquí
 * para no pelear con estilos heredados de landing.css.
 */

:root {
    --ib-orange: #f39200;
    --ib-orange-dark: #d67e00;
    --ib-orange-soft: #fff6e8;
    --ib-navy: #325aa6;
    --ib-navy-dark: #0a3161;
    --ib-navy-soft: #eef2f9;
    --ib-text: #1a202c;
    --ib-text-muted: #5c6570;
    --ib-text-faint: #8b949e;
    --ib-bg: #ffffff;
    --ib-bg-soft: #f7f8fa;
    --ib-line: #e6e9ee;
    --ib-danger: #c53030;
    --ib-danger-soft: #fff5f5;
    --ib-success: #2f855a;
    --ib-success-soft: #f0fff4;
    --ib-warning: #c05621;
    --ib-warning-soft: #fffaf0;
    --ib-info: #325aa6;
    --ib-info-soft: #eef2f9;

    --ib-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ib-h1: clamp(2rem, 4.2vw, 3.25rem);
    --ib-h2: clamp(1.5rem, 2.6vw, 2.125rem);
    --ib-lead: clamp(1.05rem, 1.4vw, 1.25rem);
    --ib-body: 1rem;
    --ib-small: 0.875rem;

    --ib-radius-sm: 8px;
    --ib-radius: 12px;
    --ib-radius-lg: 16px;
    --ib-shadow: 0 1px 2px rgba(10, 49, 97, 0.06);
    --ib-shadow-md: 0 8px 24px rgba(10, 49, 97, 0.08);
    --ib-container: 1120px;
    --ib-container-wide: 1280px;
    --ib-space-section: clamp(4rem, 8vw, 6.5rem);
    --ib-nav-height: 64px;
    --ib-nav-bp: 960px;
    --ib-ease: 180ms ease;

    --primary: #f39200;
    --primary-dark: #d67e00;
    --secondary: #325aa6;
    --accent: #f39200;
    --orange: #f39200;
    --orange-dark: #d67e00;
    --blue: #325aa6;
    --blue-dark: #0a3161;
    --text-dark: #1a202c;
    --text-light: #5c6570;
    --bg-light: #f7f8fa;
    --white: #ffffff;
    --shadow: 0 1px 2px rgba(10, 49, 97, 0.06);
    --shadow-lg: 0 8px 24px rgba(10, 49, 97, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 16px;
    --transition: color 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

/* -------------------------------------------------------------------------- */
/* Tipografía                                                                  */
/* -------------------------------------------------------------------------- */

.ib-h1,
h1.ib-h1 {
    font-family: var(--ib-font);
    font-size: var(--ib-h1);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.12;
    color: var(--ib-navy-dark);
    margin: 0 0 0.75rem;
}

.ib-h2,
h2.ib-h2 {
    font-family: var(--ib-font);
    font-size: var(--ib-h2);
    font-weight: 650;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--ib-navy-dark);
    margin: 0 0 0.5rem;
}

.ib-lead,
.ib-subtitle {
    font-size: var(--ib-lead);
    font-weight: 400;
    line-height: 1.5;
    color: var(--ib-text-muted);
    margin: 0 0 1.5rem;
}

.ib-body {
    font-size: var(--ib-body);
    line-height: 1.6;
    color: var(--ib-text);
}

.ib-kicker {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ib-orange);
    margin-bottom: 0.75rem;
}

.ib-link {
    color: var(--ib-navy);
    font-weight: 550;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color var(--ib-ease), border-color var(--ib-ease);
}

.ib-link:hover {
    color: var(--ib-orange);
    border-bottom-color: var(--ib-orange);
}

/* -------------------------------------------------------------------------- */
/* Layout                                                                      */
/* -------------------------------------------------------------------------- */

.ib-container {
    width: 100%;
    max-width: var(--ib-container);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.ib-container--wide {
    max-width: var(--ib-container-wide);
}

.ib-section {
    padding: var(--ib-space-section) 0;
}

.ib-section--soft {
    background: var(--ib-bg-soft);
}

/* -------------------------------------------------------------------------- */
/* Botones                                                                     */
/* -------------------------------------------------------------------------- */

.ib-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.7rem 1.25rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--ib-font);
    font-size: 0.9rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    color: var(--ib-navy-dark);
    box-shadow: none;
    white-space: nowrap;
    transition: background var(--ib-ease), color var(--ib-ease), border-color var(--ib-ease), box-shadow var(--ib-ease), transform var(--ib-ease);
}

.ib-btn:hover {
    transform: none;
}

.ib-btn-primary {
    background: var(--ib-orange);
    color: #fff;
    border-color: var(--ib-orange);
}

.ib-btn-primary:hover,
.ib-btn-primary:focus-visible {
    background: var(--ib-orange-dark);
    border-color: var(--ib-orange-dark);
    color: #fff;
}

.ib-btn-secondary {
    background: #fff;
    color: var(--ib-navy-dark);
    border-color: var(--ib-navy);
}

.ib-btn-secondary:hover,
.ib-btn-secondary:focus-visible {
    background: var(--ib-navy-soft);
    color: var(--ib-navy-dark);
}

.ib-btn-ghost {
    background: transparent;
    color: var(--ib-navy);
    border-color: transparent;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.ib-btn-ghost:hover {
    color: var(--ib-navy-dark);
    background: var(--ib-navy-soft);
}

.ib-btn-lg {
    min-height: 52px;
    padding: 0.9rem 1.6rem;
    font-size: 0.95rem;
}

.ib-btn-block {
    width: 100%;
}

.ib-btn:focus-visible {
    outline: 3px solid var(--ib-orange);
    outline-offset: 2px;
}

/* -------------------------------------------------------------------------- */
/* Inputs / cards / badges / alerts / icons                                    */
/* -------------------------------------------------------------------------- */

.ib-input,
.ib-select,
.ib-textarea {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--ib-line);
    border-radius: var(--ib-radius);
    background: #fff;
    color: var(--ib-text);
    font-family: var(--ib-font);
    font-size: 1rem;
    line-height: 1.4;
    transition: border-color var(--ib-ease), box-shadow var(--ib-ease);
}

.ib-textarea {
    min-height: 120px;
    resize: vertical;
}

.ib-input:focus,
.ib-select:focus,
.ib-textarea:focus {
    outline: none;
    border-color: var(--ib-navy);
    box-shadow: 0 0 0 3px rgba(50, 90, 166, 0.15);
}

.ib-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 650;
    color: var(--ib-navy-dark);
    margin-bottom: 0.4rem;
}

.ib-card {
    background: #fff;
    border: 1px solid var(--ib-line);
    border-radius: var(--ib-radius-lg);
    box-shadow: var(--ib-shadow);
    padding: 1.5rem;
}

.ib-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--ib-orange-soft);
    color: var(--ib-orange-dark);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ib-badge--navy {
    background: var(--ib-navy-soft);
    color: var(--ib-navy-dark);
}

.ib-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    background: var(--ib-navy-soft);
    color: var(--ib-navy);
    font-size: 1.05rem;
}

.ib-alert {
    display: flex;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: var(--ib-radius);
    border: 1px solid var(--ib-line);
    background: var(--ib-bg-soft);
    color: var(--ib-text);
    font-size: 0.95rem;
    line-height: 1.45;
}

.ib-alert--info {
    background: var(--ib-info-soft);
    border-color: #d5def0;
    color: var(--ib-navy-dark);
}

.ib-alert--success {
    background: var(--ib-success-soft);
    border-color: #c6f6d5;
    color: var(--ib-success);
}

.ib-alert--warning {
    background: var(--ib-warning-soft);
    border-color: #feebc8;
    color: var(--ib-warning);
}

.ib-alert--danger {
    background: var(--ib-danger-soft);
    border-color: #fed7d7;
    color: var(--ib-danger);
}

/* -------------------------------------------------------------------------- */
/* Header                                                                      */
/* -------------------------------------------------------------------------- */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--ib-line);
    box-shadow: none;
    min-height: var(--ib-nav-height);
    backdrop-filter: blur(10px);
}

.navbar.scrolled {
    box-shadow: var(--ib-shadow);
}

.navbar.hidden {
    transform: translateY(-100%);
}

.navbar .container {
    max-width: var(--ib-container-wide);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: var(--ib-nav-height);
    padding: 0.35rem 0;
}

.navbar .logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: var(--ib-navy-dark);
    text-decoration: none;
}

.navbar .logo:hover {
    transform: none;
}

.navbar .logo img {
    height: 42px;
    max-width: 168px;
    width: auto;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    list-style: none;
    margin: 0;
    margin-left: auto;
    padding: 0;
}

.nav-menu > li > a,
.nav-menu > li > button.dropdown-toggle,
.nav-menu .nav-track-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.7rem;
    color: var(--ib-text);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.nav-menu > li > a:hover,
.nav-menu > li > button.dropdown-toggle:hover,
.nav-menu .nav-track-btn:hover,
.nav-menu a.is-active,
.nav-menu .is-active {
    color: var(--ib-navy-dark);
    background: var(--ib-navy-soft);
}

.dropdown {
    position: relative;
}

.dropdown-toggle i {
    font-size: 0.65rem;
    opacity: 0.7;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    padding: 0.4rem;
    margin: 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--ib-line);
    border-radius: var(--ib-radius);
    box-shadow: var(--ib-shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity var(--ib-ease), transform var(--ib-ease), visibility var(--ib-ease);
    z-index: 1100;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a,
.dropdown-menu .nav-track-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.8rem;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--ib-text);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}

.dropdown-menu a:hover,
.dropdown-menu .nav-track-btn:hover,
.dropdown-menu a.is-active {
    background: var(--ib-navy-soft);
    color: var(--ib-navy-dark);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.nav-actions .ib-btn-ghost {
    color: var(--ib-navy);
}

.navbar .nav-cta-calc {
    background: var(--ib-orange);
    color: #fff;
    border-color: var(--ib-orange);
    min-height: 40px;
    padding: 0.55rem 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.navbar .nav-cta-calc:hover {
    background: var(--ib-orange-dark);
    color: #fff;
}

.nav-item-login {
    display: none;
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0;
    background: var(--ib-navy-dark);
    border-radius: 2px;
    transition: transform 180ms ease, opacity 180ms ease;
}

.mobile-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 959px) {
    .navbar .logo img {
        height: 36px;
        max-width: 140px;
    }

    .nav-wrapper {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        gap: 0.35rem;
        min-height: 58px;
    }

    .mobile-toggle {
        display: flex;
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        margin-left: -10px;
    }

    .navbar .logo {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
    }

    .nav-actions {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }

    .navbar .nav-cta-calc {
        display: none;
    }

    .nav-actions .nav-cta-login {
        display: inline-flex;
        min-height: 40px;
        padding: 0.5rem 0.95rem;
        font-size: 0.78rem;
        font-weight: 700;
        color: #fff;
        background: var(--ib-orange);
        border: 1px solid var(--ib-orange);
        border-radius: 999px;
        white-space: nowrap;
    }

    .nav-actions .nav-cta-login:hover {
        color: #fff;
        background: var(--ib-orange-dark);
        border-color: var(--ib-orange-dark);
    }

    .nav-item-login {
        display: none;
    }

    /* .navbar tiene backdrop-filter: un hijo position:fixed se ancla al navbar, no al viewport */
    .navbar .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        bottom: auto;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        max-height: 0;
        margin: 0;
        padding: 0 1.1rem;
        overflow: hidden;
        background: #fff;
        border-bottom: 1px solid var(--ib-line);
        box-shadow: var(--ib-shadow-md);
        opacity: 0;
        visibility: hidden;
        z-index: 999;
        transition: max-height 200ms ease, opacity 200ms ease, visibility 200ms ease, padding 200ms ease;
    }

    .nav-menu.active {
        left: 0;
        bottom: auto;
        max-height: min(80dvh, 640px);
        padding: 0.5rem 1.1rem calc(1rem + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        opacity: 1;
        visibility: visible;
    }

    .nav-menu > li > a,
    .nav-menu > li > button.dropdown-toggle {
        width: 100%;
        min-height: 44px;
        padding: 0.8rem 0.2rem;
        border-radius: 0;
        border-bottom: 1px solid var(--ib-line);
        justify-content: space-between;
        font-size: 1rem;
    }

    .dropdown-menu {
        position: static !important;
        min-width: 0;
        margin: 0 0 0.4rem;
        padding: 0 0 0 0.6rem !important;
        border: 0 !important;
        border-left: 2px solid var(--ib-orange) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        display: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    .dropdown:hover .dropdown-menu,
    .dropdown:focus-within .dropdown-menu {
        display: none !important;
    }

    .dropdown.active .dropdown-menu {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .dropdown-menu a,
    .dropdown-menu .nav-track-btn {
        min-height: 44px;
        padding: 0.7rem 0.5rem;
    }
}

@media (min-width: 960px) {
    .mobile-toggle {
        display: none !important;
    }

    .nav-item-login {
        display: none !important;
    }
}

@media (max-width: 430px) {
    .nav-wrapper {
        gap: 0.25rem;
    }

    .navbar .logo img {
        height: 30px;
        max-width: 118px;
    }

    .nav-actions .nav-cta-login {
        min-height: 38px;
        padding: 0.45rem 0.75rem;
        font-size: 0.74rem;
    }
}

@media (max-width: 375px) {
    .navbar .logo img {
        height: 26px;
        max-width: 100px;
    }

    .nav-actions .nav-cta-login {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .navbar,
    .nav-menu,
    .dropdown-menu,
    .ib-btn,
    .mobile-toggle span {
        transition: none;
    }
}

/* -------------------------------------------------------------------------- */
/* Footer                                                                      */
/* -------------------------------------------------------------------------- */

.footer.ib-footer {
    background: var(--ib-navy-dark);
    color: #fff;
    padding: 3.5rem 0 1.75rem;
    font-family: var(--ib-font);
}

.ib-footer .footer-grid {
    gap: 2.25rem 2.5rem;
    margin-bottom: 2rem;
}

.ib-footer .footer-col h4 {
    margin: 0 0 0.85rem;
    font-size: 0.8rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
}

.ib-footer .footer-col p {
    color: rgba(255, 255, 255, 0.72);
    margin: 0 0 1.15rem;
    line-height: 1.5;
}

.ib-footer .footer-col ul li a {
    color: rgba(255, 255, 255, 0.72);
}

.ib-footer .footer-col ul li a:hover,
.ib-footer .footer-col ul li a:focus-visible {
    color: var(--ib-orange);
    padding-left: 0;
}

.ib-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.ib-footer-ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    background: transparent;
}

.ib-footer-ghost:hover,
.ib-footer-ghost:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: #fff;
}

.ib-footer-wa {
    margin: 0 0 1.15rem !important;
}

.ib-footer-wa a {
    color: #fff;
    font-weight: 550;
    text-decoration: none;
}

.ib-footer-wa a:hover,
.ib-footer-wa a:focus-visible {
    color: var(--ib-orange);
}

.ib-footer .footer-logo-fallback {
    display: none;
    font-weight: 700;
    color: #fff;
}

.ib-footer .btn-complaints {
    background: #fff !important;
    color: var(--ib-navy-dark) !important;
    box-shadow: none;
}

.ib-footer .btn-complaints:hover,
.ib-footer .btn-complaints:focus-visible {
    background: var(--ib-orange-soft) !important;
    color: var(--ib-navy-dark) !important;
    transform: none;
}

.ib-footer .footer-bottom {
    color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 900px) {
    .ib-footer .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ib-footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .ib-footer .footer-grid {
        grid-template-columns: 1fr;
    }

    .ib-footer-actions .ib-btn {
        width: 100%;
        min-height: 48px;
    }

    /* Tap targets ≥44px en móvil */
    .ib-footer .footer-col ul li {
        margin-bottom: 0;
    }

    .ib-footer .footer-col ul li a,
    .ib-footer-wa a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }
}
