/* ==========================================================================
   Prestige Car Insurance — Two-tone Utility header
   Translated from the Desktop3 / Mobile3 design prototype.
   ========================================================================== */

:root {
    --pci-ink: #1a1715;
    --pci-cream: #faf8f4;
    --pci-paper: #f3efe8;
    --pci-teal: #25826A;
    --pci-teal-deep: #003A37;
    --pci-teal-pulse: #7bc4a8;
    --pci-line: rgba(26, 23, 21, .08);
    --pci-dim: rgba(26, 23, 21, .55);
    --pci-cream-dim: rgba(247, 244, 239, .75);
    --pci-cream-fg: #f7f4ef;
    --pci-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --pci-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Hide the legacy theme + HFE-rendered Elementor header (we replace both) */
header#rs-header,
header#masthead,
.elementor-location-header,
.rs-toolbar-section {
    display: none !important;
}

/* ===== Header shell ===================================================== */
.pci-header {
    position: relative;
    z-index: 200;
    font-family: var(--pci-sans);
    color: var(--pci-ink);
    background: #fff;
    box-sizing: border-box;
}
.pci-header *, .pci-header *::before, .pci-header *::after { box-sizing: border-box; }
.pci-header a { color: inherit; text-decoration: none; }
.pci-header svg { display: block; }

/* ===== Layout container ================================================= */
.pci-container {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

/* ===== Utility strip (deep teal) ======================================== */
.pci-utility {
    background: var(--pci-teal-deep);
    color: var(--pci-cream-dim);
    padding: 10px 40px;
    font-size: 12px;
    letter-spacing: .01em;
}
.pci-utility-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.pci-utility-left,
.pci-utility-right {
    display: flex;
    align-items: center;
    gap: 24px;
}
.pci-utility-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--pci-teal-pulse);
}
.pci-utility-dot {
    width: 6px;
    height: 6px;
    border-radius: 99px;
    background: var(--pci-teal-pulse);
    box-shadow: 0 0 0 3px rgba(123, 196, 168, .25);
    animation: pci-pulse 2s ease-in-out infinite;
    display: inline-block;
}
.pci-utility-tag { opacity: .85; }
.pci-utility-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(247, 244, 239, .9);
}
.pci-utility-link:hover { color: #fff; }

@keyframes pci-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

/* ===== Main bar ========================================================= */
.pci-main {
    background: #fff;
    padding: 18px 40px;
    border-bottom: 1px solid var(--pci-line);
    position: relative;
    z-index: 20;
    transition: padding .2s ease;
}
.pci-main-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}
.pci-main-row > .pci-logo { justify-self: start; }
.pci-main-row > .pci-cta,
.pci-main-row > .pci-mobile-controls { justify-self: end; }

/* Logo lockup — uses the full brand logo (image already contains wordmark). */
.pci-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.pci-logo-mark {
    height: 64px;
    max-height: 100%;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: height .2s ease;
    overflow: visible;
}
.pci-logo-mark img {
    height: 64px;
    width: auto;
    max-height: none;
    object-fit: contain;
    display: block;
    transition: height .2s ease;
}
.pci-logo-fallback {
    font-weight: 700;
    color: var(--pci-ink);
    font-size: 18px;
}
/* Wordmark text hidden — the brand logo image already contains it. */
.pci-logo-text { display: none; }
.pci-logo-title {
    font-family: var(--pci-sans);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.005em;
    text-transform: uppercase;
    color: var(--pci-ink);
}
.pci-logo-accent { color: var(--pci-teal); }
.pci-logo-sub {
    font-family: var(--pci-mono);
    font-size: 9.5px;
    color: var(--pci-dim);
    margin-top: 5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* Nav — middle column of the grid; centers naturally because the side
   columns each occupy 1fr. */
.pci-nav { display: flex; justify-content: center; }
.pci-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px;
    align-items: center;
}
.pci-nav a,
.pci-nav-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 16px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.005em;
    color: var(--pci-ink);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.pci-nav a:hover,
.pci-nav-trigger:hover {
    background: rgba(37, 130, 106, .08);
    color: var(--pci-teal);
}
.pci-nav-has-mega.is-open .pci-nav-trigger {
    background: rgba(37, 130, 106, .08);
    color: var(--pci-teal);
}
.pci-chev {
    opacity: .55;
    transition: transform .18s ease;
}
.pci-nav-has-mega.is-open .pci-chev { transform: rotate(180deg); }

/* CTA pill */
.pci-cta {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 8px 8px 8px 22px;
    background: var(--pci-teal-deep);
    color: var(--pci-cream-fg) !important;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 99px;
    letter-spacing: -0.005em;
    flex-shrink: 0;
    transition: background .15s;
}
.pci-cta:hover { background: #002827; }
.pci-cta-chip {
    width: 32px;
    height: 32px;
    border-radius: 99px;
    background: var(--pci-teal);
    display: grid;
    place-items: center;
    color: #fff;
}

/* ===== Mega menu ======================================================== */
.pci-mega {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    margin-top: -1px;
    padding: 4px 16px 16px;
}
.pci-mega[hidden] { display: none; }
.pci-mega-inner {
    background: #fff;
    border: 1px solid rgba(26, 23, 21, .06);
    border-radius: 14px;
    padding: 24px;
    min-width: 820px;
    max-width: 100%;
    box-shadow: 0 30px 60px -20px rgba(26, 23, 21, .18), 0 0 0 1px rgba(26, 23, 21, .03);
}
.pci-mega-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(26, 23, 21, .06);
    gap: 24px;
}
.pci-mega-eyebrow {
    font-family: var(--pci-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--pci-teal);
}
.pci-mega-title {
    margin-top: 6px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--pci-ink);
}
.pci-mega-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 99px;
    background: rgba(37, 130, 106, .08);
    color: var(--pci-teal) !important;
    flex-shrink: 0;
}
.pci-mega-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}
.pci-mega-item {
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--pci-ink);
    display: block;
    transition: background .12s;
}
.pci-mega-item:hover { background: rgba(37, 130, 106, .06); }
.pci-mega-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pci-mega-item-label {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.005em;
}
.pci-mega-item-num {
    font-family: var(--pci-mono);
    font-size: 10px;
    color: var(--pci-teal);
    margin-right: 8px;
    font-weight: 500;
}
.pci-mega-item-row svg { opacity: .35; }
.pci-mega-item-tag {
    font-size: 12.5px;
    color: var(--pci-dim);
    margin-top: 4px;
    padding-left: 26px;
    line-height: 1.4;
}

/* ===== Sticky / scrolled state ========================================= */
.pci-header.is-stuck {
    position: sticky;
    top: 0;
}
.pci-header.is-stuck .pci-utility {
    padding-top: 0;
    padding-bottom: 0;
    height: 0;
    overflow: hidden;
    border: 0;
}
.pci-header.is-stuck .pci-main {
    padding-top: 10px;
    padding-bottom: 10px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px -16px rgba(26, 23, 21, .15);
}
.pci-header.is-stuck .pci-logo-mark,
.pci-header.is-stuck .pci-logo-mark img {
    height: 48px;
}
.pci-header.is-stuck .pci-logo-sub { display: none; }

/* ===== Mobile controls (hidden on desktop) ============================== */
.pci-mobile-controls {
    display: none;
    align-items: center;
    gap: 6px;
}
.pci-mobile-icon {
    width: 40px;
    height: 40px;
    border-radius: 99px;
    background: rgba(26, 23, 21, .06);
    display: grid;
    place-items: center;
    color: var(--pci-ink);
    border: 0;
    cursor: pointer;
    padding: 0;
}
.pci-mobile-icon:hover { background: rgba(26, 23, 21, .1); }
.pci-burger-close { display: none; }
body.pci-drawer-open .pci-burger-open { display: none; }
body.pci-drawer-open .pci-burger-close { display: block; }

/* ===== Mobile drawer ==================================================== */
.pci-drawer {
    position: fixed;
    inset: 0;
    z-index: 199;
    background: var(--pci-cream);
    padding-top: 132px; /* height of utility + main on mobile */
    padding-bottom: 110px;
    overflow-y: auto;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s ease, opacity .2s ease;
}
.pci-drawer:not([hidden]) {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.pci-drawer[hidden] { display: block; } /* keep transitions; visibility via opacity */

.pci-drawer-inner { padding: 24px 20px 0; }
.pci-drawer-eyebrow {
    font-size: 10px;
    color: var(--pci-dim);
    font-family: var(--pci-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.pci-drawer-link,
.pci-drawer-toggle {
    width: 100%;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--pci-line);
    padding: 18px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--pci-ink);
    font-family: inherit;
    cursor: pointer;
}
.pci-drawer-link > span:first-child,
.pci-drawer-toggle > span:first-child {
    font-family: "Newsreader", Georgia, serif;
    font-size: 28px;
    font-weight: 400;
    letter-spacing: -0.02em;
}
.pci-drawer-link svg { opacity: .4; }
.pci-drawer-plus {
    width: 32px;
    height: 32px;
    border-radius: 99px;
    background: rgba(26, 23, 21, .06);
    display: grid;
    place-items: center;
    transition: transform .2s ease;
}
.pci-drawer-toggle[aria-expanded="true"] .pci-drawer-plus { transform: rotate(45deg); }

.pci-drawer-sublist {
    padding: 10px 0 14px;
    overflow: hidden;
}
.pci-drawer-toggle[aria-expanded="false"] + .pci-drawer-sublist { display: none; }
.pci-drawer-sublink {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    color: var(--pci-ink);
    font-size: 15px;
    opacity: .85;
}
.pci-drawer-sublink svg { opacity: .4; }

.pci-drawer-contact {
    margin: 28px 0 32px;
    padding: 18px;
    border-radius: 14px;
    background: rgba(26, 23, 21, .04);
}
.pci-drawer-contact-eyebrow {
    font-size: 10px;
    color: var(--pci-dim);
    font-family: var(--pci-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.pci-drawer-contact-phone {
    font-family: "Newsreader", Georgia, serif;
    font-size: 24px;
    color: var(--pci-ink);
    letter-spacing: -0.01em;
    display: block;
}
.pci-drawer-contact-email {
    font-size: 13px;
    color: var(--pci-dim);
    margin-top: 6px;
}

.pci-drawer-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px 20px 28px;
    background: linear-gradient(to top, var(--pci-cream) 60%, rgba(250, 248, 244, 0));
    display: flex;
    gap: 10px;
    z-index: 201;
    transform: translateY(100%);
    transition: transform .25s ease;
}
body.pci-drawer-open .pci-drawer-cta { transform: translateY(0); }
.pci-drawer-cta-call {
    width: 52px;
    height: 52px;
    border-radius: 99px;
    background: var(--pci-ink);
    color: var(--pci-cream-fg) !important;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.pci-drawer-cta-quote {
    flex: 1;
    padding: 17px 0;
    border-radius: 99px;
    background: var(--pci-ink);
    color: var(--pci-cream-fg) !important;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.pci-drawer-cta-chip {
    width: 26px;
    height: 26px;
    border-radius: 99px;
    background: var(--pci-teal);
    display: grid;
    place-items: center;
    color: var(--pci-ink);
}

/* Lock body scroll when drawer is open */
body.pci-drawer-open { overflow: hidden; }

/* ===== Responsive ====================================================== */
@media (max-width: 1100px) {
    .pci-main { padding: 16px 24px; }
    .pci-utility { padding: 9px 24px; }
    .pci-utility-mail { display: none; }
    .pci-mega-inner { min-width: 0; width: calc(100vw - 48px); max-width: 1232px; }
}

@media (max-width: 880px) {
    .pci-utility {
        font-size: 11px;
        padding: 8px 20px;
        gap: 12px;
    }
    .pci-utility-tag,
    .pci-utility-mail { display: none; }
    .pci-utility-left,
    .pci-utility-right { gap: 16px; }

    .pci-main {
        padding: 12px 20px;
    }
    .pci-main-row {
        display: flex;
        justify-content: space-between;
    }
    .pci-nav,
    .pci-cta { display: none; }
    .pci-mobile-controls { display: flex; }

    .pci-logo-mark,
    .pci-logo-mark img { height: 48px; }
    .pci-logo-sub { display: none; }
    .pci-logo-title { font-size: 14px; }

    .pci-mega { display: none !important; }
}

@media (max-width: 420px) {
    .pci-logo-text { display: none; }
    .pci-utility-tag { display: none; }
}
