/* ==============================================
   My Orders Page — mop-style.css
   Place in: /wp-content/plugins/my-orders/assets/
   ============================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── VARIABLES ── */
:root {
  --c-bg:         #f0f2f8;
  --c-surface:    #ffffff;
  --c-surface2:   #f7f8fc;
  --c-border:     #e4e7f0;
  --c-text:       #1a1d2e;
  --c-muted:      #7c829a;
  --c-primary:    #2563eb;
  --c-primary-l:  #dbeafe;
  --c-accent:     #0ea5e9;
  --c-accent-l:   #e0f2fe;
  --c-green:      #16a34a;
  --c-green-l:    #dcfce7;
  --c-warn:       #d97706;
  --c-warn-l:     #fef3c7;
  --c-red:        #dc2626;
  --c-red-l:      #fee2e2;
  --c-purple:     #7c3aed;
  --c-purple-l:   #ede9fe;
  --c-radius:     14px;
  --c-radius-sm:  8px;
  --c-shadow:     0 2px 12px rgba(30,40,80,.08);
  --c-shadow-lg:  0 12px 48px rgba(30,40,80,.18);
  --font:         'Outfit', sans-serif;
  --mono:         'JetBrains Mono', monospace;
}

/* ── RESET ── */
.mop-page *, .mop-page *::before, .mop-page *::after { box-sizing: border-box; }
.mop-page { font-family: var(--font); color: var(--c-text); max-width: 820px; margin: 0 auto; padding: 24px 16px 80px; }
.mop-page a { text-decoration: none; }

/* ── TOP BAR ── */
.mop-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #0ea5e9 100%);
  border-radius: 20px;
  padding: 24px 28px;
  color: #fff;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(37,99,235,.3);
}
.mop-topbar__left { display: flex; align-items: center; gap: 16px; }
.mop-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  border: 2px solid rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #fff;
  backdrop-filter: blur(8px);
}
.mop-hello { margin: 0; font-size: 13px; opacity: .75; letter-spacing: .3px; }
.mop-name  { margin: 0; font-size: 22px; font-weight: 700; }
.mop-topbar__stats { display: flex; gap: 24px; }
.mop-stat  { text-align: center; }
.mop-stat__num { display: block; font-size: 26px; font-weight: 800; line-height: 1; }
.mop-stat__num--active { color: #fbbf24; }
.mop-stat__num--done   { color: #86efac; }
.mop-stat__lbl { font-size: 11px; opacity: .7; text-transform: uppercase; letter-spacing: .5px; }

/* ── FILTERS ── */
.mop-filters { margin-bottom: 20px; display: flex; flex-direction: column; gap: 12px; }
.mop-search-wrap { position: relative; }
.mop-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 18px; color: var(--c-muted); pointer-events: none;
}
.mop-search {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--c-radius);
  font-family: var(--font);
  font-size: 14px;
  color: var(--c-text);
  outline: none;
  box-shadow: var(--c-shadow);
  transition: border-color .2s;
}
.mop-search:focus { border-color: var(--c-primary); }
.mop-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.mop-tab {
  padding: 7px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--c-muted);
  cursor: pointer;
  transition: all .18s;
}
.mop-tab:hover { border-color: var(--c-primary); color: var(--c-primary); }
.mop-tab--active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; font-weight: 600; }

/* ── ORDER CARD ── */
.mop-order {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--c-radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--c-shadow);
  transition: border-color .2s, box-shadow .2s;
  animation: mopFadeIn .35s ease both;
}
.mop-order:hover { border-color: #c7d2fe; box-shadow: 0 4px 20px rgba(37,99,235,.1); }
@keyframes mopFadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* Summary Row */
.mop-order__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  cursor: pointer;
  gap: 12px;
  flex-wrap: wrap;
  user-select: none;
}
.mop-order__summary:focus-visible { outline: 2px solid var(--c-primary); outline-offset: -2px; }
.mop-order__left { display: flex; align-items: center; gap: 14px; }
.mop-order__icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.mop-order__icon--pending    { background: var(--c-warn-l); }
.mop-order__icon--processing { background: var(--c-accent-l); }
.mop-order__icon--on-hold    { background: var(--c-purple-l); }
.mop-order__icon--completed  { background: var(--c-green-l); }
.mop-order__icon--cancelled  { background: #f3f4f6; }
.mop-order__icon--refunded   { background: var(--c-warn-l); }
.mop-order__icon--failed     { background: var(--c-red-l); }

.mop-order__num  { display: block; font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--c-primary); }
.mop-order__date { display: block; font-size: 12px; color: var(--c-muted); margin-top: 2px; }
.mop-order__right { display: flex; align-items: center; gap: 16px; }
.mop-order__total { font-size: 17px; font-weight: 700; text-align: right; line-height: 1.2; }
.mop-order__chevron { color: var(--c-muted); transition: transform .25s; flex-shrink: 0; }
.mop-order__chevron.open { transform: rotate(180deg); }

/* ── STATUS BADGE ── */
.mop-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}
.mop-badge--pending    { background: var(--c-warn-l);   color: var(--c-warn);   }
.mop-badge--processing { background: var(--c-accent-l); color: var(--c-accent); }
.mop-badge--on-hold    { background: var(--c-purple-l); color: var(--c-purple); }
.mop-badge--completed  { background: var(--c-green-l);  color: var(--c-green);  }
.mop-badge--cancelled  { background: #f3f4f6;           color: var(--c-muted);  }
.mop-badge--refunded   { background: var(--c-warn-l);   color: var(--c-warn);   }
.mop-badge--failed     { background: var(--c-red-l);    color: var(--c-red);    }

/* ── DETAIL PANEL ── */
.mop-order__detail {
  border-top: 1.5px solid var(--c-border);
  padding: 20px;
  display: none;
  background: var(--c-surface2);
  animation: mopSlideIn .2s ease;
}
@keyframes mopSlideIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.mop-section-label { font-size: 12px; font-weight: 600; color: var(--c-muted); text-transform: uppercase; letter-spacing: .6px; margin: 0 0 12px; }

/* ── ITEMS LIST ── */
.mop-items { margin-bottom: 20px; }
.mop-items__list { display: flex; flex-direction: column; gap: 10px; }
.mop-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--c-radius-sm);
  padding: 12px 14px;
  flex-wrap: wrap;
}
.mop-item__thumb { width: 52px; height: 52px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--c-border); }
.mop-item__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mop-item__no-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.mop-item__info { flex: 1; min-width: 0; }
.mop-item__name { display: block; font-size: 14px; font-weight: 600; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mop-item__meta { display: block; font-size: 12px; color: var(--c-muted); margin-top: 3px; }
.mop-item__right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-left: auto; }
.mop-item__total { font-size: 15px; font-weight: 700; font-family: var(--mono); white-space: nowrap; }

/* ── QTY CONTROL ── */
.mop-qty-ctrl { display: flex; align-items: center; gap: 6px; }
.mop-qty-btn {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1.5px solid var(--c-border);
  background: var(--c-surface2);
  color: var(--c-text);
  font-size: 16px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.mop-qty-btn:hover { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.mop-qty-inp {
  width: 52px;
  text-align: center;
  border: 1.5px solid var(--c-border);
  border-radius: 8px;
  background: var(--c-surface);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
  padding: 5px 6px;
  outline: none;
  transition: border-color .2s;
}
.mop-qty-inp:focus { border-color: var(--c-primary); }
.mop-qty-inp.changed { border-color: var(--c-warn); background: var(--c-warn-l); }

/* ── TOTALS ── */
.mop-totals {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--c-radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.mop-totals__row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--c-muted);
  padding: 5px 0;
}
.mop-totals__row--discount { color: var(--c-green); }
.mop-totals__row--total {
  color: var(--c-text);
  font-size: 16px;
  font-weight: 700;
  border-top: 1.5px solid var(--c-border);
  margin-top: 6px;
  padding-top: 10px;
}

/* ── ADDRESS ── */
.mop-address { margin-bottom: 16px; }
.mop-address__text { font-size: 13px; color: var(--c-muted); font-style: normal; line-height: 1.7; margin: 0; }

/* ── ACTIONS ── */
.mop-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

/* ── BUTTONS ── */
.mop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .18s;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.mop-btn--primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.mop-btn--primary:hover { background: #1d4ed8; }
.mop-btn--accent  { background: var(--c-accent-l); color: var(--c-accent); border-color: #bae6fd; }
.mop-btn--accent:hover { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.mop-btn--warn    { background: var(--c-warn-l); color: var(--c-warn); border-color: #fde68a; }
.mop-btn--warn:hover { background: var(--c-warn); color: #fff; border-color: var(--c-warn); }
.mop-btn--danger  { background: var(--c-red-l); color: var(--c-red); border-color: #fecaca; }
.mop-btn--danger:hover { background: var(--c-red); color: #fff; border-color: var(--c-red); }
.mop-btn--ghost   { background: transparent; color: var(--c-muted); border-color: var(--c-border); }
.mop-btn--ghost:hover { background: var(--c-surface2); color: var(--c-text); }
.mop-btn--full    { width: 100%; }
.mop-btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ── HINT ── */
.mop-hint { font-size: 12px; color: var(--c-muted); margin: 0; padding: 8px 12px; background: var(--c-warn-l); border-radius: 8px; }

/* ── EMPTY STATE ── */
.mop-empty { text-align: center; padding: 64px 24px; }
.mop-empty__icon { font-size: 56px; margin-bottom: 16px; }
.mop-empty__title { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
.mop-empty__sub   { color: var(--c-muted); margin: 0 0 24px; }

/* ── LOGIN GATE ── */
.mop-gate { text-align: center; padding: 64px 24px; }
.mop-gate__icon { font-size: 48px; margin-bottom: 16px; }
.mop-gate p { font-size: 16px; color: var(--c-muted); }
.mop-gate a { color: var(--c-primary); font-weight: 600; }

/* ── MODAL ── */
.mop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: mopOverlayIn .2s ease;
}
.mop-overlay[hidden] { display: none !important; }
@keyframes mopOverlayIn { from { opacity:0; } to { opacity:1; } }
.mop-modal {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  padding: 32px 28px;
  position: relative;
  box-shadow: var(--c-shadow-lg);
  animation: mopModalIn .22s cubic-bezier(.34,1.56,.64,1);
}
@keyframes mopModalIn { from { opacity:0; transform:scale(.9) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }
.mop-modal__close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--c-surface2);
  border: 1.5px solid var(--c-border);
  border-radius: 8px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--c-muted);
  transition: all .15s;
}
.mop-modal__close:hover { background: var(--c-red-l); border-color: var(--c-red); color: var(--c-red); }
.mop-modal__icon  { font-size: 40px; text-align: center; margin-bottom: 12px; }
.mop-modal__title { font-size: 20px; font-weight: 700; text-align: center; margin: 0 0 8px; }
.mop-modal__body  { font-size: 14px; color: var(--c-muted); text-align: center; margin: 0 0 20px; }
.mop-modal__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.mop-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.mop-required { color: var(--c-red); }
.mop-input, .mop-textarea {
  width: 100%;
  background: var(--c-surface2);
  border: 1.5px solid var(--c-border);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--c-text);
  padding: 10px 14px;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
  margin-bottom: 14px;
}
.mop-input:focus, .mop-textarea:focus { border-color: var(--c-primary); }
.mop-textarea { min-height: 96px; resize: vertical; }

/* ── TOAST ── */
.mop-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1e293b;
  color: #f1f5f9;
  padding: 14px 22px;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  z-index: 999999;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  pointer-events: none;
  max-width: 90vw;
  white-space: nowrap;
}
.mop-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.mop-toast--success { border-left: 4px solid #22c55e; }
.mop-toast--error   { border-left: 4px solid #ef4444; }
.mop-toast--warn    { border-left: 4px solid #f59e0b; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .mop-topbar { padding: 18px 16px; }
  .mop-name   { font-size: 18px; }
  .mop-stat__num { font-size: 20px; }
  .mop-order__summary { padding: 14px 16px; }
  .mop-order__detail  { padding: 16px; }
  .mop-actions { flex-direction: column; }
  .mop-btn { width: 100%; }
  .mop-modal { padding: 24px 18px; }
  .mop-item__right { width: 100%; justify-content: flex-end; }
}
