/**
 * MPR Digital Products — "Your Stores" header trigger + slide-over panel.
 * Global (all front pages). Guest-first, brand green accents.
 */

/* Trigger — renders as a native theme header block (next to sign-in / cart) via
   displayNav2, so the theme's .header-block / .header-block__action-btn own the
   sizing, padding & alignment. We only neutralise the <button> chrome (the theme
   styles <a>) and tint the storefront green — no padding/size overrides, so it
   matches the sign-in & cart icons exactly. */
.mpr-stores-trigger {
    background: transparent;
    border: 0;
    font: inherit;
    cursor: pointer;
}
.mpr-stores-trigger .header-block__icon { color: inherit; }
.mpr-stores-trigger:hover .header-block__icon { color: #16a34a; }
/* Count badge inherits the theme .header-block__badge look — identical to the cart. */

/* Overlay + slide-over panel */
.mpr-stores-overlay {
    position: fixed; inset: 0;
    background: rgba(17,24,39,0.45);
    z-index: 1300;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.mpr-stores-overlay.is-open { opacity: 1; }
.mpr-stores-overlay[hidden] { display: none; }

.mpr-stores-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 380px;
    max-width: 92vw;
    background: #fff;
    z-index: 1310;
    display: flex;
    flex-direction: column;
    box-shadow: -12px 0 40px rgba(0,0,0,0.18);
    transform: translateX(100%);
    transition: transform 0.22s ease;
}
.mpr-stores-panel.is-open { transform: translateX(0); }
.mpr-stores-panel[hidden] { display: none; }

.mpr-stores-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid #f0f1f3;
}
.mpr-stores-panel__title { font-size: 1.05rem; font-weight: 700; color: #111827; }
.mpr-stores-panel__sub { font-size: 0.76rem; color: #9ca3af; margin-top: 2px; }
.mpr-stores-panel__close {
    flex: 0 0 auto;
    width: 30px; height: 30px;
    border: 0; background: transparent;
    font-size: 1.5rem; line-height: 1;
    color: #9ca3af; cursor: pointer;
    border-radius: 6px;
}
.mpr-stores-panel__close:hover { background: #f3f4f6; color: #111827; }

.mpr-stores-panel__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px 18px;
}
.mpr-stores-loading, .mpr-stores-empty {
    color: #9ca3af; font-size: 0.85rem; text-align: center; padding: 24px 8px;
}

/* Store card */
.mpr-store-card {
    border: 1px solid #eef0f2;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.mpr-store-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mpr-store-card__name { font-weight: 700; color: #111827; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpr-store-card__domain { font-size: 0.74rem; color: #9ca3af; margin-top: 1px; }
.mpr-store-card__badge {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 0.68rem; font-weight: 600;
    color: #6b7280; background: #f3f4f6;
    padding: 2px 8px; border-radius: 20px;
}
.mpr-store-card__badge--ok { color: #15803d; background: #dcfce7; }
.mpr-store-card__badge .material-icons { font-size: 13px; }
.mpr-store-card__signs { list-style: none; margin: 8px 0 0; padding: 0; }
.mpr-store-card__signs li {
    display: flex; align-items: flex-start; gap: 6px;
    font-size: 0.78rem; color: #4b5563; line-height: 1.4; margin-top: 4px;
}
.mpr-store-card__signs li .material-icons { font-size: 15px; color: #16a34a; flex: 0 0 auto; margin-top: 1px; }
.mpr-store-card__signs li strong { color: #b45309; }
.mpr-store-card__muted { color: #9ca3af; }

/* "Save to your account" card (Stripe-style) */
.mpr-stores-panel__foot {
    border-top: 1px solid #f0f1f3;
    padding: 14px 18px;
    background: #f0fdf4;
}
.mpr-stores-account__head {
    display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px;
}
.mpr-stores-account__head .material-icons { font-size: 18px; color: #16a34a; flex: 0 0 auto; margin-top: 1px; }
.mpr-stores-account__title { font-size: 0.86rem; font-weight: 700; color: #111827; }
.mpr-stores-account__text { font-size: 0.76rem; color: #4b5563; line-height: 1.45; margin-top: 2px; }
.mpr-stores-save__form { display: flex; gap: 8px; }
.mpr-stores-save__form input {
    flex: 1 1 auto; min-width: 0;
    padding: 9px 11px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 0.85rem;
}
.mpr-stores-save__form input:focus { border-color: #16a34a; outline: none; }
.mpr-stores-save__btn {
    flex: 0 0 auto;
    background: #16a34a; border: 1px solid #16a34a; color: #fff;
    font-weight: 600; font-size: 0.85rem; padding: 9px 14px; border-radius: 8px;
}
.mpr-stores-save__btn:hover { background: #15803d; border-color: #15803d; }
.mpr-stores-save__msg { margin-top: 8px; font-size: 0.78rem; }
.mpr-stores-save__msg[hidden] { display: none; }
.mpr-stores-save__msg.is-ok { color: #15803d; }
.mpr-stores-save__msg.is-err { color: #b91c1c; }

/* Empty state + "add your store" form */
.mpr-stores-empty-lead {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 6px 2px 14px;
}
.mpr-stores-empty-lead .material-icons { font-size: 28px; color: #16a34a; flex: 0 0 auto; }
.mpr-stores-empty-lead strong { display: block; color: #111827; font-size: 0.98rem; }
.mpr-stores-empty-lead span { display: block; color: #9ca3af; font-size: 0.78rem; margin-top: 2px; }

.mpr-store-add { display: flex; flex-direction: column; gap: 10px; }
.mpr-store-add__lead { font-size: 0.8rem; color: #4b5563; line-height: 1.45; }
.mpr-store-add__field { display: flex; flex-direction: column; gap: 4px; }
.mpr-store-add__field > span { font-size: 0.76rem; font-weight: 600; color: #374151; }
.mpr-store-add__field > span em { font-weight: 400; color: #9ca3af; font-style: normal; }
.mpr-store-add__field input,
.mpr-store-add__field select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.88rem;
    background: #fff;
}
.mpr-store-add__field input:focus,
.mpr-store-add__field select:focus { border-color: #16a34a; outline: none; box-shadow: 0 0 0 3px rgba(22,163,74,0.12); }
/* Auth affordance revealed under the email field (login for existing / create for new) */
.mpr-store-add__auth { display: flex; flex-direction: column; gap: 8px; }
.mpr-store-add__auth[hidden] { display: none; }
.mpr-store-add__auth-hint {
    display: flex; align-items: flex-start; gap: 7px;
    padding: 9px 11px;
    background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px;
    font-size: 0.76rem; color: #374151; line-height: 1.4;
}
.mpr-store-add__auth-hint .material-icons { font-size: 16px; color: #16a34a; flex: 0 0 auto; margin-top: 1px; }
/* Create-account checkbox */
.mpr-store-add__create {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 0.8rem; color: #374151; line-height: 1.4; cursor: pointer; margin: 0;
}
.mpr-store-add__create input { margin-top: 2px; flex: 0 0 auto; width: 16px; height: 16px; accent-color: #16a34a; }
.mpr-store-add__pw-wrap { display: flex; flex-direction: column; gap: 6px; }
.mpr-store-add__pw-wrap[hidden] { display: none; }
/* Password field with show/hide toggle */
.mpr-store-add__pw { position: relative; display: flex; }
.mpr-store-add__pw input {
    flex: 1 1 auto; min-width: 0;
    padding: 9px 40px 9px 11px;
    border: 1px solid #e5e7eb; border-radius: 8px; font-size: 0.88rem; background: #fff;
}
.mpr-store-add__pw input:focus { border-color: #16a34a; outline: none; box-shadow: 0 0 0 3px rgba(22,163,74,0.12); }
.mpr-store-add__pw-toggle {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border: 0; background: transparent; color: #9ca3af; cursor: pointer;
}
.mpr-store-add__pw-toggle:hover { color: #16a34a; }
.mpr-store-add__pw-toggle .material-icons { font-size: 18px; }
.mpr-store-add__pw-gen {
    display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
    background: transparent; border: 0; color: #15803d; font-weight: 600; font-size: 0.78rem; cursor: pointer; padding: 2px 0;
}
.mpr-store-add__pw-gen:hover { text-decoration: underline; }
.mpr-store-add__pw-gen .material-icons { font-size: 16px; }
.mpr-store-add__forgot { font-size: 0.76rem; color: #6b7280; text-decoration: underline; align-self: flex-start; }
.mpr-store-add__forgot:hover { color: #16a34a; }
/* Submit: use the theme's primary button; just lay out the icon + label. */
.mpr-store-add__btn {
    margin-top: 2px;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    width: 100%;
}
.mpr-store-add__btn .material-icons { font-size: 18px; }
.mpr-store-add__btn:disabled { opacity: 0.6; cursor: default; }
.mpr-store-add__msg { font-size: 0.78rem; margin-top: 2px; }
.mpr-store-add__msg[hidden] { display: none; }
.mpr-store-add__msg.is-err { color: #b91c1c; }
.mpr-store-add__msg.is-ok { color: #15803d; }

.mpr-store-add-toggle {
    display: inline-flex; align-items: center; gap: 4px;
    background: transparent; border: 1px dashed #bbf7d0; color: #15803d;
    font-weight: 600; font-size: 0.82rem; padding: 8px 12px; border-radius: 8px;
    cursor: pointer; width: 100%; justify-content: center;
}
.mpr-store-add-toggle:hover { background: #f0fdf4; border-color: #16a34a; }
.mpr-store-add-toggle .material-icons { font-size: 17px; }
.mpr-store-add-wrap { margin-top: 10px; }
.mpr-store-add-wrap[hidden] { display: none; }

/* The theme puts a subset icon font ("MI Critical") first in the .material-icons
   stack for fast above-the-fold paint. That subset lacks a few glyphs this panel
   injects client-side (add_business, timelapse, visibility_off): the partial
   coverage splits the shaping run, the ligature never forms, and each character
   renders as a notdef box. The panel is below the fold and the full font is
   already loaded, so opt its icons out of the subset. The header trigger keeps
   the subset (its `storefront` glyph is present) so first paint is unaffected.
   The critical CSS declares `.material-icons{font-family:...!important}` inline,
   so this override has to carry !important too. */
.mpr-stores-panel .material-icons {
    font-family: 'Material Icons', sans-serif !important;
}

body.mpr-stores-open { overflow: hidden; }
