/* ── Franchise Manager Customer CSS v7 ───────────────────────────────── */

/* No scroll when popup open */
body.fm-no-scroll { overflow: hidden; }
select#billing_country,select#fm_franchise {
    padding: 10px 15px;
    font-size: 12px;
    border: 1px solid #cccccc;
}
/* ══ TOP BAR ════════════════════════════════════════════════════════════ */
.fm-topbar {
    width: 100%;
    background: #000;
    color: #fff;
    padding: 15px 20px;
    z-index: 9998;
    border-bottom: 1px solid #163050;
    border-radius: 50px;;
}
.fm-topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.fm-topbar-icon { display: flex; align-items: center; opacity: .8; flex-shrink: 0; }
.fm-topbar-label { font-size: 13px; opacity: .75; white-space: nowrap; }
.fm-topbar-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}
.fm-topbar-change-btn,
.fm-topbar-select-btn {
   padding: 12px 25px;

  border: 1.5px solid rgba(255,255,255,.4);

    border-top-color: rgba(255, 255, 255, 0.4);
    border-right-color: rgba(255, 255, 255, 0.4);
    border-bottom-color: rgba(255, 255, 255, 0.4);
    border-left-color: rgba(255, 255, 255, 0.4);

  border-radius: 20px;

  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;

  white-space: nowrap;

  margin-left: auto;
  background: #fff !important;

  color: #000 !important;
  font-size: 14px;

}
.fm-topbar-change-btn:hover,
.fm-topbar-select-btn:hover {
    background: rgba(255,255,255,.15);
    border-color: rgba(255,255,255,.8);
}
.fm-topbar-select-btn {
    background: #2563eb;
    border-color: #2563eb;
    animation: fm-pulse-btn 2s ease infinite;
}
@keyframes fm-pulse-btn {
    0%,100% { box-shadow: 0 0 0 0 rgba(37,99,235,.5); }
    50%      { box-shadow: 0 0 0 6px rgba(37,99,235,0); }
}

/* ══ POPUP OVERLAY ══════════════════════════════════════════════════════ */
.fm-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s, visibility .22s;
    backdrop-filter: blur(3px);
}
.fm-popup-overlay.fm-popup-visible {
    opacity: 1;
    visibility: visible;
}

/* ══ POPUP BOX ══════════════════════════════════════════════════════════ */
.fm-popup {
    background: #fff;
    border-radius: 16px;
    width: 92%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    position: relative;
    transform: translateY(16px);
    transition: transform .22s;
    overflow: hidden;
}
.fm-popup-overlay.fm-popup-visible .fm-popup {
    transform: translateY(0);
}
.fm-popup-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background .15s;
    background: #0765ed !important;
    border: 1px solid;
    padding: 0px;
}
.fm-popup-close:hover { background: #e5e7eb; color: #111; }

/* Hide close button + darken overlay when location selection is mandatory */
.fm-popup-mandatory .fm-popup-close {
    display: none !important;
}
.fm-popup-mandatory.fm-popup-overlay {
    background: rgba(0, 0, 0, 0.72);
    cursor: not-allowed;
}
.fm-popup-mandatory .fm-popup {
    cursor: default;
}
.fm-popup-mandatory-note {
    display: none;
    text-align: center;
    padding: 10px 20px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #dc2626;
    border-top: 1px solid #fee2e2;
    background: #fff5f5;
}
.fm-popup-mandatory .fm-popup-mandatory-note {
    display: block;
}

.fm-popup-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #0765ed;
    color: #fff;
    padding: 24px 24px 20px;
}
.fm-popup-head svg { flex-shrink: 0; margin-top: 2px; opacity: .9; }
.fm-popup-title { margin: 0 0 4px; font-size: 18px; font-weight: 700;color: #fff; }
.fm-popup-sub   { margin: 0; font-size: 13px; opacity: .8; line-height: 1.4; }

.fm-popup-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fm-popup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #fff !important;
    cursor: pointer;
    text-align: left;
    transition: all .15s;
    width: 100%;
}
.fm-popup-item:hover {
    border-color: #1e3a5f;
    background: #f0f4ff;
}
.fm-popup-item-active {
    border-color: #1e3a5f;
    background: #eff6ff;
}
.fm-popup-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0eaff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #1e3a5f;
}
.fm-popup-item-active .fm-popup-item-icon {
    background: #1e3a5f;
    color: #fff;
}
.fm-popup-item-name {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}
.fm-popup-item-check {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #1e3a5f;
    background: #dbeafe;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}
.fm-popup-note {
    margin: 0;
    padding: 12px 20px 16px;
    font-size: 12px;
    color: #9ca3af;
    border-top: 1px solid #f3f4f6;
    text-align: center;
}

/* ══ SHOP BAR ═══════════════════════════════════════════════════════════ */
.fm-shop-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: #f0f4ff;
    border: 1px solid #c7d7f8;
    border-radius: 10px;
    padding: 11px 18px;
    margin-bottom: 16px;
    color: #1e3a5f;
}
.fm-shop-bar-text { font-size: 14px; flex: 1; }
.fm-shop-bar-text strong { color: #1e3a5f; }
.fm-shop-change-btn,
.fm-shop-select-btn {
    padding: 6px 16px;
    border: 1.5px solid #1e3a5f;
    border-radius: 20px;
    background: #1e3a5f;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.fm-shop-change-btn:hover,
.fm-shop-select-btn:hover { background: #2c5282; }
.fm-shop-select-btn { background: #2563eb; border-color: #2563eb; }

/* ══ LOOP BADGES ═════════════════════════════════════════════════════════ */
ul.products li.product { position: relative !important; }
.fm-loop-badge {
    position: absolute;
    top: 10px; left: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.fm-badge-ins     { background: #d1fae5; color: #065f46; }
.fm-badge-low     { background: #fef3c7; color: #92400e; }
.fm-badge-oos     { background: #fee2e2; color: #991b1b; }
.fm-badge-loading { background: #f3f4f6; color: #9ca3af; }

/* ══ SOLD OUT BUTTON (loop) ═════════════════════════════════════════════ */
.fm-sold-out-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: #f9fafb;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: not-allowed;
    text-align: center;
    margin-top: 6px;
}

/* ══ SINGLE PRODUCT STRIP ════════════════════════════════════════════════ */
.fm-single-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #f8f9fc;
    border: 1px solid #e2e5ef;
    border-radius: 8px;
    padding: 11px 16px;
    margin: 8px 0 16px;
    font-size: 14px;
}
.fm-strip-franchise { font-weight: 600; color: #1e3a5f; }
.fm-strip-prompt    { font-size: 13px; color: #6b7280; }
.fm-stock-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}
.fm-stock-ins { background: #d1fae5; color: #065f46; }
.fm-stock-low { background: #fef3c7; color: #92400e; }
.fm-stock-oos { background: #fee2e2; color: #991b1b; }

.fm-strip-change {
  background: #fff !important;

  padding: 10px 30px;

  color: #000 !important;
}

.fm-strip-change,
.fm-strip-select {
    margin-left: auto;
    padding: 5px 13px;
    border: 1.5px solid #1e3a5f;
    border-radius: 20px;
    background: transparent;
    color: #1e3a5f;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}
.fm-strip-change:hover,
.fm-strip-select:hover { background: #1e3a5f; color: #fff; }

/* ══ SOLD OUT BAR (single) ═══════════════════════════════════════════════ */
.fm-sold-out-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    border-radius: 8px;
    padding: 13px 18px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
}

/* ══ CHECKOUT DELIVERY OPTION ════════════════════════════════════════════ */
#fm-delivery-option { margin-bottom: 20px; }
#fm-delivery-option h3 { margin: 0 0 12px; font-size: 16px; }
.fm-delivery-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.fm-delivery-label {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: #fff;
}
.fm-delivery-label:hover {
    border-color: #1e3a5f;
    background: #f8faff;
}
.fm-delivery-label.fm-delivery-active {
    border-color: #1e3a5f;
    background: #eff6ff;
}
.fm-delivery-label input[type="radio"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #1e3a5f;
    cursor: pointer;
}
.fm-delivery-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.fm-delivery-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}
.fm-delivery-desc {
    font-size: 12px;
    color: #6b7280;
}
.fm-delivery-address {
    font-size: 12px;
    color: #374151;
    font-style: italic;
    margin-top: 2px;
}
.fm-delivery-price {
    font-size: 14px;
    font-weight: 700;
    color: #1e3a5f;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .fm-topbar-inner { gap: 8px; }
    .fm-topbar-change-btn, .fm-topbar-select-btn { margin-left: 0; }
    .fm-shop-bar { flex-direction: column; align-items: flex-start; }
    .fm-popup { width: 96%; }
    .fm-single-strip { flex-direction: column; align-items: flex-start; }
    .fm-strip-change, .fm-strip-select { margin-left: 0; }
}
