/* ═══════════════════════════════════════════════════════════════
   Delegado Electric — Premium agency header
   Logo dimensions: DO NOT MODIFY (locked block below)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Shell & states ─── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    z-index: 1030;
    width: 100%;
    padding: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: linear-gradient(
        180deg,
        rgba(252, 252, 250, 0.94) 0%,
        rgba(248, 249, 252, 0.88) 100%
    );
    backdrop-filter: blur(20px) saturate(1.35);
    -webkit-backdrop-filter: blur(20px) saturate(1.35);
    border-bottom: 1px solid rgba(48, 67, 143, 0.08);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 4px 32px rgba(48, 67, 143, 0.06);
    transition:
        background 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, box-shadow;
}

.site-header.is-scrolled {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.97) 0%,
        rgba(250, 251, 254, 0.95) 100%
    );
    border-bottom-color: rgba(48, 67, 143, 0.1);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 1) inset,
        0 12px 48px rgba(48, 67, 143, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.04);
}

.site-header.is-scrolled .header-deco__line {
    opacity: 1;
    transform: scaleX(1);
}

.site-header.menu-open {
    background: rgba(255, 255, 255, 0.98);
    border-bottom-color: transparent;
    box-shadow: none;
}

.site-header.menu-open .header-deco {
    opacity: 0;
}

/* ─── Decorative layers ─── */
.header-deco {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
    transition: opacity 0.4s ease;
}

.header-deco__line {
    position: absolute;
    left: 5%;
    right: 5%;
    bottom: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(232, 81, 38, 0.35) 25%,
        rgba(48, 67, 143, 0.25) 50%,
        rgba(232, 81, 38, 0.35) 75%,
        transparent 100%
    );
    opacity: 0.5;
    transform: scaleX(0.6);
    transform-origin: center;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.header-deco__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(48px);
    opacity: 0.35;
    animation: headerOrbFloat 14s ease-in-out infinite;
}

.header-deco__orb--1 {
    width: 180px;
    height: 180px;
    top: -60%;
    left: 18%;
    background: rgba(48, 67, 143, 0.2);
}

.header-deco__orb--2 {
    width: 140px;
    height: 140px;
    top: -40%;
    right: 22%;
    background: rgba(232, 81, 38, 0.18);
    animation-delay: -5s;
}

.header-deco__mesh {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: radial-gradient(rgba(48, 67, 143, 0.8) 0.6px, transparent 0.6px);
    background-size: 20px 20px;
}

@keyframes headerOrbFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(12px, 6px); }
}

.header-shell {
    position: relative;
    z-index: 5;
    padding-left: 24px;
    padding-right: 24px;
}

@media (min-width: 992px) {
    .header-shell {
        padding-left: 48px;
        padding-right: 48px;
    }
}

@media (min-width: 1400px) {
    .header-shell {
        padding-left: 64px;
        padding-right: 64px;
    }
}

.header-bar {
    position: relative;
    z-index: 5;
    gap: 24px;
}

.header-bar__brand,
.header-bar__nav,
.header-bar__actions {
    position: relative;
    z-index: 6;
}

/* ─── Logo (LOCKED — do not change dimensions) ─── */
.header-brand {
    line-height: 0;
}

/* Default header logo only — sticky logo uses separate rules below */
.header-brand__img--default {
    display: block;
    width: auto;
    height: 130px;
    object-fit: contain;
}

@media (min-width: 768px) {
    .header-brand__img--default {
        height: 72px;
    }
}

@media (min-width: 1200px) {
    .header-brand__img--default {
        height: 130px;
    }
}

.header-brand--mobile .header-brand__img {
    height: 90px;
}

/* ─── Desktop nav pill ─── */
.header-nav__track {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 5px;
    border-radius: 100px;
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.92) 0%,
        rgba(238, 242, 250, 0.75) 100%
    );
    border: 1px solid rgba(48, 67, 143, 0.1);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 1) inset,
        0 8px 28px rgba(48, 67, 143, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.03);
}

.site-header.is-scrolled .header-nav__track {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 1) inset,
        0 10px 32px rgba(48, 67, 143, 0.1);
}

.header-nav__indicator {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    margin: 0;
    box-sizing: border-box;
    border-radius: 100px;
    background: linear-gradient(
        135deg,
        rgba(48, 67, 143, 0.12) 0%,
        rgba(232, 81, 38, 0.14) 100%
    );
    border: 1px solid rgba(48, 67, 143, 0.12);
    box-shadow:
        0 4px 16px rgba(48, 67, 143, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    pointer-events: none;
    transition:
        transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        width 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        height 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.3s ease;
    opacity: 1;
}

.header-nav__list {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-nav__item {
    display: flex;
    align-items: center;
}

.header-nav__link {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 20px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    border-radius: 100px;
    transition:
        color 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        letter-spacing 0.35s ease;
}

.header-nav__link:hover {
    color: var(--color-primary-dark);
    letter-spacing: 0.05em;
}

.header-nav__link.is-active {
    color: var(--color-primary-dark);
    font-weight: 600;
}

/* ─── CTA ─── */
.header-cta {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    gap: 0;
    padding: 14px 32px;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    border-radius: 100px;
    border: none;
    background: linear-gradient(135deg, #30438f 0%, #243366 40%, #1a2744 100%);
    box-shadow:
        0 4px 24px rgba(48, 67, 143, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset,
        0 1px 0 rgba(255, 255, 255, 0.2) inset;
    transition:
        transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-cta::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, #e85126 0%, #e85126 50%, #c9431f 100%);
    opacity: 0;
    transition: opacity 0.45s ease;
    z-index: 0;
}

.header-cta__shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(255, 255, 255, 0.35) 50%,
        transparent 100%
    );
    transform: skewX(-18deg);
    z-index: 1;
    transition: left 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-cta__text {
    position: relative;
    z-index: 2;
}

.header-cta:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow:
        0 16px 48px rgba(232, 81, 38, 0.45),
        0 0 32px rgba(232, 81, 38, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.header-cta:hover::after {
    opacity: 1;
}

.header-cta:hover .header-cta__shine {
    left: 140%;
}

.header-cta--full {
    display: flex;
    text-align: center;
}

/* ─── Hamburger ─── */
.header-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: none;
    border-radius: 16px;
    background: linear-gradient(145deg, #fff 0%, #eef2fa 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 1) inset,
        0 6px 20px rgba(48, 67, 143, 0.12);
    transition:
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.4s ease;
}

.header-toggle:hover {
    transform: scale(1.04);
    box-shadow:
        0 8px 28px rgba(232, 81, 38, 0.2),
        0 1px 0 rgba(255, 255, 255, 1) inset;
}

.header-toggle__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 24px;
}

.header-toggle__line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-primary-dark);
    border-radius: 2px;
    transition:
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.3s,
        width 0.35s,
        background 0.35s;
}

.header-toggle.is-active {
    background: linear-gradient(145deg, #30438f 0%, #243366 100%);
}

.header-toggle.is-active .header-toggle__line {
    background: #fff;
}

.header-toggle.is-active .header-toggle__line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.header-toggle.is-active .header-toggle__line:nth-child(2) {
    opacity: 0;
    width: 0;
}

.header-toggle.is-active .header-toggle__line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ─── Mobile overlay + fullscreen menu ─── */
.header-overlay {
    position: fixed;
    inset: 0;
    z-index: 1028;
    background: rgba(15, 22, 48, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.55s;
    pointer-events: none;
}

.header-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.header-mobile {
    position: fixed;
    inset: 0;
    z-index: 1029;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.header-mobile__backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(
        165deg,
        #0f1630 0%,
        #1a2744 45%,
        #243366 100%
    );
    opacity: 0;
    transition: opacity 0.5s ease;
}

.header-mobile.is-open .header-mobile__backdrop {
    opacity: 1;
}

.header-mobile__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    padding: 28px 28px 40px;
    overflow: hidden;
    background: transparent;
    transform: translateY(100%);
    opacity: 0;
    transition:
        transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.45s ease;
    pointer-events: auto;
}

.header-mobile.is-open {
    pointer-events: auto;
}

.header-mobile.is-open .header-mobile__panel {
    transform: translateY(0);
    opacity: 1;
}

.header-mobile__glow {
    position: absolute;
    top: -20%;
    right: -30%;
    width: 70%;
    height: 50%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 81, 38, 0.35) 0%, transparent 70%);
    filter: blur(40px);
    pointer-events: none;
}

.header-mobile__top {
    position: relative;
    z-index: 2;
    margin-bottom: 8px;
}

.header-mobile__label {
    position: relative;
    z-index: 2;
    margin: 0 0 20px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.header-mobile__close {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), background 0.35s;
}

.header-mobile__close-ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.35s, transform 0.35s;
}

.header-mobile__close:hover {
    background: rgba(232, 81, 38, 0.35);
    transform: rotate(90deg);
}

.header-mobile__close:hover .header-mobile__close-ring {
    opacity: 1;
    transform: scale(1);
}

.header-mobile__nav {
    position: relative;
    z-index: 2;
}

.header-mobile__list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.header-mobile__link {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: padding-left 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s;
}

.header-mobile__index {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: rgba(232, 81, 38, 0.7);
    min-width: 1.5rem;
}

.header-mobile__text {
    font-size: clamp(1.75rem, 6vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: rgba(255, 255, 255, 0.88);
    transition: color 0.35s ease, transform 0.35s ease;
}

.header-mobile__link:hover {
    padding-left: 12px;
    border-bottom-color: rgba(232, 81, 38, 0.35);
}

.header-mobile__link:hover .header-mobile__text {
    color: #fff;
    transform: translateX(4px);
}

.header-mobile__link.is-active .header-mobile__text {
    color: #e85126;
}

.header-mobile__footer {
    position: relative;
    z-index: 2;
    padding-top: 28px;
}

.header-mobile__footer .header-cta {
    background: linear-gradient(135deg, #e85126 0%, #e85126 50%, #c9431f 100%);
    box-shadow: 0 8px 32px rgba(232, 81, 38, 0.4);
}

.header-mobile__footer .header-cta::after {
    display: none;
}

body.header-locked {
    overflow: hidden !important;
}

/* ─── Sticky header (separate from default — own logo size & layout) ─── */
.header-brand__media {
    position: relative;
    display: flex;
    align-items: center;
    line-height: 0;
}

.header-brand__img--default,
.header-brand__img--sticky {
    transition:
        opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sticky logo — hidden in main header (no layout space); shown only when .is-sticky */
.header-brand__img--sticky {
    display: none;
    width: auto;
    max-width: 200px;
    height: auto;
    max-height: 52px;
    object-fit: contain;
    object-position: left center;
}

.site-header.is-sticky .header-bar {
    align-items: center;
}

/* Keep brand column width = main header so nav pill does not shift on sticky */
@media (min-width: 992px) {
    .site-header.is-sticky .header-bar__brand {
        flex: 0 0 var(--header-brand-slot-w, auto);
        width: var(--header-brand-slot-w, auto);
        max-width: var(--header-brand-slot-w, none);
    }

    .site-header.is-sticky .header-brand__media {
        width: 100%;
        max-width: 100%;
    }

    .site-header.is-sticky .header-brand__img--sticky {
        object-position: left center;
    }
}

.site-header.is-sticky .header-brand__media {
    min-height: 0;
    height: auto;
}

.site-header.is-sticky .header-brand__img--default {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.site-header.is-sticky .header-brand__img--sticky {
    display: block;
    position: relative;
    top: auto;
    left: auto;
    transform: none;
}

@media (min-width: 768px) {
    .header-brand__img--sticky {
        max-height: 44px;
        max-width: 180px;
    }
}

@media (min-width: 1200px) {
    .header-brand__img--sticky {
        max-height: 48px;
        max-width: 220px;
    }
}

.site-header.is-sticky {
    padding-top: 10px;
    padding-bottom: 10px;
    backdrop-filter: blur(26px) saturate(1.45);
    -webkit-backdrop-filter: blur(26px) saturate(1.45);
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.96) 0%,
        rgba(248, 250, 254, 0.94) 100%
    );
    border-bottom-color: rgba(48, 67, 143, 0.12);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 1) inset,
        0 16px 56px rgba(48, 67, 143, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.05);
}

.site-header.is-sticky.is-sticky-enter {
    animation: siteHeaderStickyIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes siteHeaderStickyIn {
    from {
        transform: translate3d(0, -100%, 0);
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-header,
    .header-nav__link,
    .header-nav__indicator,
    .header-cta,
    .header-toggle,
    .header-mobile__panel,
    .header-mobile__backdrop,
    .header-overlay,
    .header-deco__orb {
        transition-duration: 0.01ms;
        animation: none;
    }

    .site-header.is-sticky.is-sticky-enter {
        animation: none;
    }

    .header-brand__img--default,
    .header-brand__img--sticky {
        transition-duration: 0.01ms;
        transform: none;
    }

    .header-brand:hover,
    .header-cta:hover,
    .header-toggle:hover {
        transform: none;
    }
}
