/* ============================================================
   MMPS Location Chip + Branch Popover  (responsive)
   Matched to the storefront LocationChip component

   Desktop  >= 992px : chip in the dark utility bar (upper-left)
   Tablet   768-991  : full-width sand strip under the header
   Mobile   <= 767   : same strip, popover fills the viewport width
   ============================================================ */

/* --- Design tokens from the storefront --- */
:root {
    --mmps-navy: #1c326b;
    --mmps-navy-700: #16264f;
    --mmps-orange-ink: #bf4d00;
    --mmps-gold: #ffb63f;
    --mmps-slate: #4d4d4d;
    --mmps-steel: #5d6675;
    --mmps-sand: #f3f0e7;
    --mmps-line: #d9d9d9;
}

/* ============================================================
   CHIP TRIGGER — shared
   ============================================================ */
.mmps-location-chip {
    position: relative;
    display: inline-block;
}

.mmps-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mmps-chip-pin,
.mmps-chip-chevron {
    flex-shrink: 0;
}

.mmps-chip-pin {
    width: 16px;
    height: 16px;
}

.mmps-chip-chevron {
    width: 14px;
    height: 14px;
    transition: transform .2s ease;
}

.mmps-chip-btn[aria-expanded="true"] .mmps-chip-chevron {
    transform: rotate(180deg);
}

/* ---- Desktop chip: sits on the dark utility bar ---- */
.mmps-location-chip:not(.mmps-chip-strip) .mmps-chip-btn {
    color: #fff;
}

    .mmps-location-chip:not(.mmps-chip-strip) .mmps-chip-btn:hover {
        color: var(--mmps-gold);
    }

.mmps-location-chip:not(.mmps-chip-strip) .mmps-chip-pin {
    color: var(--mmps-gold);
}

/* ---- Tablet/mobile strip: full-width sand bar ---- */
.mmps-chip-strip {
    display: none; /* shown at <= 991px */
    width: 100%;
}

    .mmps-chip-strip .mmps-chip-btn {
        display: flex;
        width: 100%;
        min-height: 44px; /* comfortable tap target */
        padding: 8px 20px;
        background: var(--mmps-sand);
        border-top: 1px solid var(--mmps-line);
        color: var(--mmps-navy);
        font-size: 16px;
        text-align: left;
    }

    .mmps-chip-strip .mmps-chip-pin {
        color: var(--mmps-orange-ink);
    }

    .mmps-chip-strip .mmps-trigger-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mmps-chip-strip .mmps-chip-chevron {
        margin-left: auto; /* pushes the chevron to the right edge */
        color: var(--mmps-steel);
    }

/* ---- Utility bar extras (hours beside the chip) ---- */
.mmps-bar-divider {
    margin: 0 24px;
    color: rgba(255, 255, 255, .8);
}

.mmps-bar-hours {
    color: rgba(255, 255, 255, .9);
}

/* ============================================================
   POPOVER
   ============================================================ */
#mmps-branch-popover {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 70;
    width: 320px;
    max-width: 320px;
    max-width: calc(100vw - 2.5rem);
    margin-top: 10px;
    padding: 16px;
    background: #fff;
    border: 2px solid var(--mmps-navy);
    box-shadow: 8px 8px 0 rgba(28, 50, 107, .15);
    text-align: left;
    color: #333;
    cursor: default;
}

    #mmps-branch-popover.mmps-open {
        display: block;
    }

/* Micro-labels: "Your nearest branch" / "Your ZIP code" */
.mmps-branch-label,
.mmps-zip-label {
    display: block;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.4;
    color: var(--mmps-slate);
}

.mmps-branch-name {
    margin-top: 4px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--mmps-navy);
}

.mmps-branch-address {
    margin-top: 4px;
    font-size: 18px;
    line-height: 24px;
    color: var(--mmps-slate);
}

/* Icon rows: hours and phone */
.mmps-branch-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 16px;
    line-height: 24px;
    color: var(--mmps-slate);
}

    .mmps-branch-row.mmps-row-hours {
        margin-top: 8px;
    }

    .mmps-branch-row.mmps-row-phone {
        margin-top: 4px;
        align-items: center;
    }

    .mmps-branch-row svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
        color: var(--mmps-orange-ink);
    }

.mmps-row-hours svg {
    margin-top: 4px;
}

.mmps-branch-row a {
    font-weight: 700;
    color: var(--mmps-navy) !important;
    text-decoration: none;
}

    .mmps-branch-row a:hover {
        color: var(--mmps-orange-ink) !important;
    }

.mmps-branch-distance {
    margin-top: 6px;
    font-size: 16px;
    line-height: 20px;
    color: var(--mmps-steel);
}

    .mmps-branch-distance strong {
        font-weight: 600;
        font-variant-numeric: tabular-nums;
    }

/* ============================================================
   ZIP BLOCK
   ============================================================ */
.mmps-zip-block {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--mmps-line);
}

    .mmps-zip-block.mmps-zip-only {
        margin-top: 10px;
        padding-top: 0;
        border-top: none;
    }

.mmps-zip-controls {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.mmps-zip-input {
    height: 44px;
    width: 100%;
    min-width: 0;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--mmps-line);
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    outline: none;
    border-radius: 0;
    -webkit-appearance: none;
}

    .mmps-zip-input:focus {
        border-color: var(--mmps-navy);
        box-shadow: 0 0 0 2px rgba(28, 50, 107, .15);
    }

.mmps-zip-update {
    flex-shrink: 0;
    height: 44px;
    padding: 0 16px;
    background: #fff;
    border: 2px solid var(--mmps-navy);
    font-size: 16px;
    font-weight: 600;
    color: var(--mmps-navy);
    cursor: pointer;
    border-radius: 0;
    -webkit-appearance: none;
    transition: background-color .15s ease, border-color .15s ease;
}

    .mmps-zip-update:hover:not(:disabled) {
        border-color: var(--mmps-gold);
        background: var(--mmps-gold);
    }

    .mmps-zip-update:disabled {
        opacity: .6;
        cursor: default;
    }

.mmps-zip-note {
    margin-top: 6px;
    font-size: 14px;
    line-height: 20px;
    color: var(--mmps-steel);
}

/* "Use my location" — main site only, no default branch to fall back to */
.mmps-use-location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 4px 0;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--mmps-navy);
    text-decoration: underline;
    cursor: pointer;
}

    .mmps-use-location:hover {
        color: var(--mmps-orange-ink);
    }

    .mmps-use-location svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

/* ============================================================
   TABLET + MOBILE  (<= 991px)
   ============================================================ */
@media (max-width: 991px) {

    /* Desktop chip hides, strip takes over */
    .mmps-location-chip:not(.mmps-chip-strip) {
        display: none;
    }

    .mmps-chip-strip {
        display: block;
    }

    /* Popover spans the strip width, offset from the screen edges */
    #mmps-branch-popover {
        left: 20px;
        right: 20px;
        width: 320px;
        max-width: calc(100vw - 2.5rem);
        margin-top: 0;
        box-shadow: 6px 6px 0 rgba(28, 50, 107, .15);
    }
}

/* ============================================================
   MOBILE  (<= 767px)
   ============================================================ */
@media (max-width: 767px) {

    .mmps-chip-strip .mmps-chip-btn {
        padding: 10px 16px;
        font-size: 16px;
    }

    #mmps-branch-popover {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: calc(100vw - 24px);
        max-width: 340px;
        padding: 16px 14px;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Larger type needs more room — scale back a step on phones */
    .mmps-branch-label,
    .mmps-zip-label {
        font-size: 14px;
    }

    .mmps-branch-name {
        font-size: 18px;
    }

    .mmps-branch-address,
    .mmps-branch-row {
        font-size: 16px;
    }

    .mmps-branch-distance {
        font-size: 14px;
    }

    /* Stack the ZIP controls so neither gets squeezed */
    .mmps-zip-controls {
        flex-direction: column;
    }

    .mmps-zip-input,
    .mmps-zip-update {
        width: 100%;
    }
}

/* Small phones — tighten the shadow so it doesn't cause overflow */
@media (max-width: 400px) {
    #mmps-branch-popover {
        box-shadow: 4px 4px 0 rgba(28, 50, 107, .15);
    }
}
span#mmps-header-phone-number {
    color: white;
}

.mmps-use-location-primary {
    display: flex;
    justify-content: center;
    width: 100%;
    height: 44px;
    margin-top: 12px;
    background: var(--mmps-navy);
    color: #fff;
    text-decoration: none;
    font-size: 15px;
}

    .mmps-use-location-primary:hover {
        background: var(--mmps-navy-700);
        color: #fff;
    }

@media (max-width: 991px) {

    /* Strip belongs to the header, in flow, no stacking of its own */
    .mmps-chip-strip {
        position: relative;
        z-index: 1;
        top: -10px;
    }

    /* Mobile nav panel starts below the full header incl. the strip */
    .mobile-only .mobile-panel,
    #mobile-main-menu {
        margin-top:50px;
    }

    /* Popover floats above everything except the nav */
    #mmps-branch-popover {
        z-index: 1200;
    }
}
.mmps-chip-btn svg,
.mmps-chip-btn span {
    pointer-events: none;
}