/* ==========================================================================
   Kargoza — Desktop Redesign (v1.1, 2026-10-11)
   --------------------------------------------------------------------------
   Scope: DESKTOP ONLY (>= 1025px). Below that breakpoint every rule is a no-op
   or scoped behind the media query so mobile/tablet stay byte-for-byte
   unchanged.

   Specificity strategy: most rules target the parent header/site via the
   id+class combo (`header#masthead.site-header`) so we beat the older
   single-class rules in header-fix.css without needing `!important` on
   every line. Where we MUST override `!important` from the old CSS, we do
   so explicitly.
   ========================================================================== */

/* Hide the desktop-only blocks on mobile/tablet. Default hidden, revealed
   inside the desktop media query. */
.kgz-desktop-only { display: none; }

@media (min-width: 1025px) {
    .kgz-desktop-only { display: block; }

    /* Defensive: mobile menu panel must never render on desktop even if a
       body class is wrong or a media-query edge case sneaks one open. */
    #mobile-menu,
    #mobile-menu-overlay,
    .km-menu,
    .km-menu-overlay { display: none !important; }
    body.km-open { overflow: visible !important; }

    /* ----------------------------------------------------------------------
       1. HEADER — white, ~90px, logo / centered menu / search+CTA
       ----------------------------------------------------------------------
       Use id+class on the header to beat header-fix.css specificity. */
    header#masthead.site-header {
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        background: #ffffff !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
        height: 90px !important;
        padding: 0 !important;
        min-height: 90px !important;
    }
    header#masthead .header-container {
        max-width: 1440px !important;
        margin: 0 auto;
        height: 90px !important;
        min-height: 90px !important;
        padding: 0 32px !important;
        display: flex;
        align-items: center !important;
        gap: 24px;
    }
    /* Logo container + image: explicit size, no `!important` collisions */
    header#masthead .site-branding {
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        height: 100% !important;
        margin: 0 !important;
    }
    header#masthead .site-branding > a {
        display: inline-flex !important;
        align-items: center !important;
        line-height: 1 !important;
    }
    /* Logo: hard-overwrite whatever header-fix.css / style.css says.
       Critical: style.css applies `filter: brightness(0) invert(1)` on
       the logo to render it white on dark headers. With our white
       desktop header that makes the logo invisible, so we kill the
       filter and force a fixed visible size. */
    header#masthead .header-logo {
        display: block !important;
        /* Aspect of the source: 512x147 ≈ 3.483. At 200px wide we get
           ~57px tall — within the brief's "proportional" range. */
        width: 200px !important;
        height: auto !important;
        max-width: 220px;
        visibility: visible !important;
        opacity: 1 !important;
        filter: none !important;
    }
    /* Hide the WP fallback nav if it ever renders */
    .main-navigation > ul#primary-menu,
    .main-navigation > .menu { display: none !important; }
    .mobile-menu-toggle { display: none !important; }

    /* Custom desktop nav container */
    header#masthead .main-navigation {
        flex: 1 1 auto;
        display: flex !important;
        align-items: center !important;
        justify-content: center;
        gap: 12px !important;
        height: 100% !important;
        position: static;
        background: transparent;
        width: auto;
        padding: 0;
        box-shadow: none;
        border: 0;
    }

    /* Custom desktop nav list */
    .kgz-desktop-nav {
        display: flex;
        align-items: center;
        gap: 2px;
        list-style: none;
        margin: 0;
        padding: 0;
    }
    .kgz-desktop-nav > li { position: static; }
    .kgz-desktop-nav > li > .kgz-nav-link {
        display: inline-flex !important;
        align-items: center;
        gap: 6px;
        padding: 10px 14px;
        color: #0a0a0a;
        font-family: 'Outfit', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
        font-size: 15px;
        font-weight: 500;
        letter-spacing: 0.01em;
        text-decoration: none;
        background: transparent;
        border: 0;
        cursor: pointer;
        border-radius: 6px;
        position: relative;
        white-space: nowrap;
        line-height: 1.2 !important;
        height: auto;
    }
    .kgz-desktop-nav > li > .kgz-nav-link:hover,
    .kgz-desktop-nav > li.is-open > .kgz-nav-link { color: #d31b2c; }
    /* Red underline indicator on active/open */
    .kgz-desktop-nav > li > .kgz-nav-link::after {
        content: "";
        position: absolute;
        left: 14px;
        right: 14px;
        bottom: 4px;
        height: 2px;
        background: #d31b2c;
        transform: scaleX(0);
        transform-origin: center;
        transition: transform .18s ease;
    }
    .kgz-desktop-nav > li.is-open > .kgz-nav-link::after,
    .kgz-desktop-nav > li > .kgz-nav-link:hover::after { transform: scaleX(1); }
    .kgz-nav-caret {
        width: 10px;
        height: 10px;
        display: inline-block;
        transition: transform .18s ease;
    }
    .kgz-desktop-nav > li.is-open .kgz-nav-caret { transform: rotate(180deg); }

    /* Right cluster: search + CTA. CTA: single line, properly sized. */
    .kgz-desktop-right {
        display: flex;
        align-items: center;
        gap: 12px;
        flex: 0 0 auto;
    }
    .kgz-search-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #f3f3f3;
        border: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #0a0a0a;
        transition: background .15s ease, color .15s ease;
        flex: 0 0 auto;
    }
    .kgz-search-btn:hover { background: #d31b2c; color: #fff; }
    .kgz-search-btn svg { width: 18px; height: 18px; }

    /* CTA: white-space nowrap + tightened padding so the label stays on
       one line at 1366px. */
    .kgz-desktop-cta {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px;
        background: #d31b2c !important;
        color: #fff !important;
        padding: 12px 22px !important;
        height: 44px !important;
        border-radius: 6px;
        text-decoration: none !important;
        font-family: 'Outfit', sans-serif !important;
        font-weight: 600 !important;
        font-size: 14px !important;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        white-space: nowrap;
        line-height: 1 !important;
        transition: background .15s ease, transform .15s ease;
        flex: 0 0 auto;
    }
    .kgz-desktop-cta:hover { background: #b31525 !important; transform: translateY(-1px); }

    /* ----------------------------------------------------------------------
       2. MEGA-MENU
       ---------------------------------------------------------------------- */
    .kgz-mega {
        position: absolute;
        left: 50%;
        top: 100%;
        transform: translate(-50%, 6px);
        min-width: 720px;
        max-width: 920px;
        background: #ffffff;
        border-radius: 14px;
        border: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
        padding: 28px;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
        z-index: 999;
    }
    .kgz-desktop-nav > li.is-open .kgz-mega {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translate(-50%, 0);
    }
    .kgz-mega::before {
        content: "";
        position: absolute;
        left: 0; right: 0; top: -10px;
        height: 10px;
    }
    .kgz-mega-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 0;
        row-gap: 6px;
    }
    .kgz-mega-col {
        padding: 0 14px;
        position: relative;
    }
    .kgz-mega-col + .kgz-mega-col::before {
        content: "";
        position: absolute;
        left: 0;
        top: 8px;
        bottom: 8px;
        width: 1px;
        background: rgba(0, 0, 0, 0.08);
    }
    .kgz-mega-item {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 10px 10px;
        border-radius: 8px;
        text-decoration: none;
        color: #0a0a0a;
        transition: background .12s ease, color .12s ease;
    }
    .kgz-mega-item:hover { background: #fafafa; color: #d31b2c; }
    .kgz-mega-icon {
        flex: 0 0 auto;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        background: #f3f3f3;
        color: #0a0a0a;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: background .12s ease, color .12s ease;
    }
    .kgz-mega-item:hover .kgz-mega-icon { background: rgba(211, 27, 44, 0.08); color: #d31b2c; }
    .kgz-mega-icon svg { width: 20px; height: 20px; }
    .kgz-mega-text { display: flex; flex-direction: column; gap: 2px; }
    .kgz-mega-title { font-size: 14px; font-weight: 600; }
    .kgz-mega-sub { font-size: 12px; color: #6b6b6b; }
    .kgz-mega-item:hover .kgz-mega-sub { color: #d31b2c; }

    .kgz-mega-foot {
        margin-top: 18px;
        padding-top: 16px;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        text-align: center;
    }
    .kgz-mega-view-all {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-family: 'Outfit', sans-serif;
        font-weight: 600;
        font-size: 14px;
        color: #d31b2c;
        text-decoration: none;
    }
    .kgz-mega-view-all:hover { color: #b31525; }
    .kgz-mega-view-all svg { width: 14px; height: 14px; transition: transform .15s ease; }
    .kgz-mega-view-all:hover svg { transform: translateX(3px); }

    /* ----------------------------------------------------------------------
       3. HERO
       ----------------------------------------------------------------------
       The truck should sit clearly on the right; gradient on the left
       for legibility. We use background-position to push the focal
       point (truck) to the right of the frame. */
    .hero,
    .hero-dark {
        position: relative;
        min-height: 680px;
        background: #0a0a0a;
        overflow: hidden;
        padding: 0;
    }
    .hero-bg {
        position: absolute;
        inset: 0;
        background-image: url('https://kargoza.com/wp-content/uploads/2026/10/kgz-hero-desktop-1920.jpg');
        background-size: cover;
        /* Truck focal point is on the right side of the source image and
           sits a bit above center. Push the focal point to the right
           AND up so the cab stays clear of the bottom form bar and
           the left gradient. */
        background-position: 78% 38%;
        background-repeat: no-repeat;
        z-index: 0;
    }
    .hero-overlay {
        position: absolute;
        inset: 0;
        background:
            linear-gradient(90deg,
                rgba(0, 0, 0, 0.88) 0%,
                rgba(0, 0, 0, 0.72) 28%,
                rgba(0, 0, 0, 0.45) 50%,
                rgba(0, 0, 0, 0.20) 70%,
                rgba(0, 0, 0, 0.05) 100%);
        z-index: 1;
    }
    .hero-container {
        position: relative;
        z-index: 2;
        max-width: 1440px;
        margin: 0 auto;
        padding: 96px 32px 180px;
        display: block;
    }
    .hero-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 64px;
        align-items: start;
    }
    .hero-content { max-width: 640px; color: #fff; }
    .hero-eyebrow {
        display: inline-flex;
        align-items: center;
        gap: 12px;
        font-family: 'Outfit', sans-serif;
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 0.18em;
        text-transform: uppercase;
        color: #ffffff;
        margin-bottom: 24px;
    }
    .hero-eyebrow-line {
        display: inline-block;
        width: 36px;
        height: 2px;
        background: #d31b2c;
    }
    .hero-title {
        font-family: 'Outfit', sans-serif;
        font-size: 72px;
        line-height: 1.05;
        font-weight: 700;
        letter-spacing: -0.02em;
        margin: 0 0 24px;
        color: #ffffff !important;
    }
    .hero-title-accent { color: #d31b2c; }
    .hero-description {
        font-size: 19px;
        line-height: 1.55;
        color: rgba(255, 255, 255, 0.86);
        max-width: 560px;
        margin: 0 0 32px;
    }

    /* Three indicators: SINGLE ROW, no wrap. */
    .hero-benefits {
        list-style: none;
        padding: 0;
        margin: 0 0 0;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
        align-items: stretch;
        max-width: 720px;
    }
    .hero-benefit {
        display: flex;
        align-items: center;
        gap: 14px;
        flex: 1 1 0;
        min-width: 0;
        padding: 4px 24px 4px 0;
        position: relative;
    }
    /* Vertical dividers between indicators */
    .hero-benefit + .hero-benefit::before {
        content: "";
        position: absolute;
        left: 0;
        top: 6px;
        bottom: 6px;
        width: 1px;
        background: rgba(255, 255, 255, 0.18);
    }
    .hero-benefit-icon {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: rgba(211, 27, 44, 0.12);
        color: #d31b2c;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
    }
    .hero-benefit-icon svg { width: 22px; height: 22px; }
    .hero-benefit-text {
        min-width: 0;
    }
    .hero-benefit-text strong {
        display: block;
        font-family: 'Outfit', sans-serif;
        font-size: 15px;
        font-weight: 600;
        color: #fff;
        line-height: 1.25;
    }
    .hero-benefit-text small {
        display: block;
        font-size: 12px;
        color: rgba(255, 255, 255, 0.7);
        margin-top: 2px;
        line-height: 1.3;
    }

    /* Hide the right-side vertical quote card on desktop — replaced by
       horizontal form below. Also kill the inline CTA buttons. */
    .hero-form-wrapper { display: none !important; }
    .hero-buttons { display: none !important; }
    .hero-trust,
    .hero-trust-mobile,
    .hero-indicators { display: none !important; }

    /* ----------------------------------------------------------------------
       4. HORIZONTAL QUOTE FORM (pinned to lower portion of hero)
       ----------------------------------------------------------------------
       The form lives in a wrapper below the hero section but we want it
       to visually anchor at the bottom of the hero. Easiest reliable way
       without absolute positioning across sections: place it as a normal
       block that flows under the hero, and let the hero's bottom padding
       create the overlap. We add a slight upward margin so it kisses the
       lower edge of the hero. */
    .kgz-hero-form-wrap {
        position: relative;
        z-index: 3;
        max-width: 1376px;
        margin: -90px auto 0;
        padding: 0 32px;
    }
    .kgz-hero-form {
        background: #ffffff;
        border-radius: 14px;
        box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
        display: grid;
        grid-template-columns: 260px 1fr;
        overflow: hidden;
        align-items: stretch;
        min-height: 116px;
        border: 1px solid rgba(0, 0, 0, 0.04);
    }
    .kgz-hero-form-left {
        background: #d31b2c;
        color: #ffffff;
        padding: 24px 24px;
        display: flex;
        align-items: center;
        gap: 16px;
    }
    .kgz-hero-form-left-icon {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.18);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
    }
    .kgz-hero-form-left-icon svg { width: 22px; height: 22px; color: #fff; }
    .kgz-hero-form-left-text { display: flex; flex-direction: column; gap: 2px; }
    .kgz-hero-form-left-title {
        display: block;
        font-family: 'Outfit', sans-serif;
        font-weight: 700;
        font-size: 18px;
        line-height: 1.2;
    }
    .kgz-hero-form-left-sub {
        display: block;
        font-size: 12px;
        color: rgba(255, 255, 255, 0.88);
        margin-top: 2px;
        line-height: 1.3;
    }
    .kgz-hero-form-right {
        display: grid;
        grid-template-columns: 1.4fr 1fr 1fr 1fr 156px;
        align-items: stretch;
    }
    .kgz-hero-form-field {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 16px 22px;
        border-left: 1px solid rgba(0, 0, 0, 0.06);
        min-width: 0;
        background: #ffffff;
    }
    .kgz-hero-form-field label {
        display: block;
        font-family: 'Outfit', sans-serif;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #6b6b6b;
        margin-bottom: 8px;
        line-height: 1;
    }
    .kgz-hero-form-field input,
    .kgz-hero-form-field select {
        width: 100%;
        border: 0;
        outline: 0;
        background: transparent;
        font-family: 'Outfit', sans-serif;
        font-size: 16px;
        font-weight: 500;
        color: #0a0a0a;
        padding: 0;
        min-width: 0;
        height: 26px;
        line-height: 26px;
    }
    .kgz-hero-form-field input:focus,
    .kgz-hero-form-field select:focus { outline: 0; }
    .kgz-hero-form-field:focus-within label { color: #d31b2c; }
    .kgz-hero-form-submit {
        background: #d31b2c;
        color: #fff;
        border: 0;
        padding: 0 22px;
        font-family: 'Outfit', sans-serif;
        font-weight: 700;
        font-size: 14px;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: background .15s ease;
        border-radius: 0;
        white-space: nowrap;
        line-height: 1.2;
    }
    .kgz-hero-form-submit:hover { background: #b31525; }
    .kgz-hero-form-submit svg { width: 14px; height: 14px; flex: 0 0 auto; }

    /* On narrower desktops (1366px) shrink the form so it doesn't overflow. */
    @media (max-width: 1440px) {
        .kgz-hero-form { grid-template-columns: 220px 1fr; min-height: 108px; }
        .kgz-hero-form-right { grid-template-columns: 1.3fr 0.9fr 0.9fr 0.9fr 140px; }
        .kgz-hero-form-field { padding: 12px 16px; }
    }

    /* ----------------------------------------------------------------------
       5. BENEFITS STRIP — black bar with 4 indicators
       ---------------------------------------------------------------------- */
    .kgz-benefits-strip {
        background: #0a0a0a;
        color: #fff;
        padding: 28px 0;
        margin-top: 32px;
    }
    .kgz-benefits-strip-inner {
        max-width: 1440px;
        margin: 0 auto;
        padding: 0 32px;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0;
    }
    .kgz-benefit {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 8px 28px;
        position: relative;
    }
    .kgz-benefit + .kgz-benefit::before {
        content: "";
        position: absolute;
        left: 0;
        top: 8px;
        bottom: 8px;
        width: 1px;
        background: rgba(255, 255, 255, 0.18);
    }
    .kgz-benefit-icon {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: rgba(211, 27, 44, 0.14);
        color: #d31b2c;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
    }
    .kgz-benefit-icon svg { width: 24px; height: 24px; }
    .kgz-benefit-text strong {
        display: block;
        font-family: 'Outfit', sans-serif;
        font-size: 16px;
        font-weight: 700;
        color: #fff;
        line-height: 1.2;
    }
    .kgz-benefit-text small {
        display: block;
        font-size: 13px;
        color: rgba(255, 255, 255, 0.7);
        margin-top: 4px;
        line-height: 1.3;
    }
}