/* ═══════════════════════════════════════════════════════
   Real iPhone Service — Spare Parts Store (parts.html)
   ═══════════════════════════════════════════════════════ */

/* Nav active link */
.nav-link.active { background: var(--accent); color: #fff; font-weight: 800; }

.brand-logo-img {
  width: 42px; height: 42px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ═══════════ Spare Parts HERO (parts ဆိုင်နဲ့ လိုက်ဖက်တဲ့) ═══════════ */
.parts-hero {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(22,163,74,.28), transparent 60%),
    radial-gradient(900px 450px at -10% 115%, rgba(10,130,200,.35), transparent 60%),
    linear-gradient(160deg, #071c33 0%, #0a2d52 55%, #0e3a3a 100%);
  border-bottom: 3px solid var(--accent);
}
/* circuit-like background lines */
.parts-hero .hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 22% 28%, rgba(245,166,35,.14) 0 3px, transparent 4px),
    radial-gradient(circle at 74% 62%, rgba(56,189,248,.12) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 22%, rgba(34,197,94,.12) 0 2px, transparent 3px);
  background-size: 90px 90px, 130px 130px, 160px 160px;
  pointer-events: none;
}

/* hero title — parts theme */
.parts-hero .hero-title {
  color: #fff;
  position: relative;
  display: inline-block;
  font-size: 21px;
  margin-bottom: 8px;
}
.parts-hero .hero-title::after {
  content: "";
  display: block;
  width: 96px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #22c55e);
}
.parts-hero .hero-sub { color: #c7d6e8; font-size: 13px; margin-bottom: 12px; }
.parts-hero .hero-inner { padding-top: 22px; padding-bottom: 22px; }

/* parts quick category strip — Banner အောက်က light strip (ပစ္စည်းစာရင်းအထက်) */
.parts-quick-wrap {
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 3px 12px rgba(10,37,64,.05);
  position: sticky;
  top: 70px;
  z-index: 40;
  padding: 10px 0;
}
.parts-quick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.parts-quick-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.parts-quick-btn:hover { border-color: var(--accent); color: var(--primary); }
.parts-quick-btn.on {
  background: linear-gradient(135deg, #f7b733 0%, var(--accent) 55%, #f08c00 100%);
  border-color: transparent;
  color: var(--primary);
  box-shadow: 0 3px 8px rgba(245,166,35,.3);
}
.parts-quick-btn .q-icon { margin-right: 4px; }

/* trust badges — parts specific */
.parts-hero .tbadge {
  background: rgba(255,255,255,.1);
  color: #e6eef7;
  border: 1px solid rgba(255,255,255,.14);
}

/* Parts content toolbars */
.parts-main { scroll-margin-top: 130px; }
.parts-toolbar { margin: 18px 0 14px; }
.parts-toolbar .chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* Product grid — denser so more parts visible per screen */
#partsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  padding-bottom: 40px;
}

.part-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .2s;
}
.part-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(10,37,64,.12); }

.p-img-wrap { position: relative; }
.p-img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  display: block;
  padding: 6px;
  background: linear-gradient(135deg, #eef4fb, #f7f9fc);
  box-sizing: border-box;
}
.p-img-emoji {
  display: grid;
  place-items: center;
  font-size: 46px;
  background: linear-gradient(135deg, #eef4fb, #f7f9fc);
}

.stock {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.st-ok  { background: var(--green); }
.st-low { background: #f59e0b; }
.st-out { background: var(--red); }

.p-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.p-name { font-size: 14px; font-weight: 800; color: var(--primary); line-height: 1.35; }
.p-model { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.p-note { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; flex: 1; }

.p-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.p-price { font-size: 15px; font-weight: 800; color: var(--accent); }

.p-order-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(135deg, #f7b733 0%, var(--accent) 55%, #f08c00 100%);
  color: var(--primary);
  cursor: pointer;
  transition: transform .12s, box-shadow .2s;
}
.p-order-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,166,35,.4); }
.p-order-btn:active { transform: scale(.95); }
.p-order-btn.disabled { background: #cbd5e1; color: #64748b; cursor: not-allowed; box-shadow: none; }

/* Track section */
.track-section { background: var(--primary); color: #fff; }
.track-section .section-title { color: #fff; }
.track-section .section-sub { color: #b6c6d8; }

.track-box {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 640px;
  margin: 0 auto;
}
.track-input {
  flex: 1;
  min-width: 180px;
  padding: 12px 14px;
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 10px;
  background: rgba(255,255,255,.07);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
.track-input::placeholder { color: #8fa7c0; }
.track-input:focus { border-color: var(--accent); }
.track-btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--primary);
  cursor: pointer;
}

#trackResult { max-width: 640px; margin: 16px auto 0; }
.track-card {
  background: rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 16px;
  text-align: left;
  font-size: 13.5px;
  line-height: 1.7;
}
.track-card.warn { text-align: center; }
.track-card.ok { border: 1px solid rgba(255,255,255,.14); }
.t-head { font-weight: 800; font-size: 15px; margin-bottom: 10px; }

.t-steps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.t-step {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: #b6c6d8;
}
.t-step.on { background: var(--accent); color: var(--primary); }
.t-step.past { background: rgba(22,163,74,.85); color: #fff; }

.t-item { font-size: 13px; }
.t-total { font-weight: 800; margin-top: 8px; font-size: 14px; color: var(--accent); }
.t-meta { font-size: 11.5px; color: #8fa7c0; margin-top: 6px; }

/* ─────────────── Cart FAB ─────────────── */
.cart-fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #f7b733 0%, var(--accent) 55%, #f08c00 100%);
  color: var(--primary);
  font-size: 24px;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(245,166,35,.45);
  z-index: 60;
  transition: transform .15s;
}
.cart-fab:active { transform: scale(.92); }
.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(220,38,38,.4);
}

/* ─────────────── Cart Drawer ─────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,25,45,.55);
  z-index: 70;
}
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 92vw);
  background: var(--card);
  z-index: 71;
  transform: translateX(105%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(0,0,0,.18);
}
.cart-drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--primary);
  color: #fff;
}
.drawer-head h3 { font-size: 16px; font-weight: 800; }
.drawer-close {
  width: 34px; height: 34px;
  border: none; border-radius: 9px;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.drawer-body { flex: 1; overflow-y: auto; padding: 16px; }
.cart-empty { text-align: center; color: var(--text-muted); font-size: 13.5px; padding: 40px 10px; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.ci-info { flex: 1; min-width: 0; }
.ci-name { font-size: 13.5px; font-weight: 800; color: var(--primary); line-height: 1.35; }
.ci-price { font-size: 12px; color: var(--text-muted); }
.ci-qty { display: flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 30px; height: 30px;
  border: none; border-radius: 9px;
  background: var(--accent-soft);
  color: var(--primary);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.qty-btn:disabled { opacity: .4; cursor: not-allowed; }
.qty-val { min-width: 22px; text-align: center; font-weight: 800; font-size: 14px; }
.ci-line { font-weight: 800; font-size: 13.5px; color: var(--accent); min-width: 70px; text-align: right; }

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 800;
  padding: 14px 2px;
  border-top: 1.5px dashed var(--border);
  margin-top: 6px;
}
.cart-total span:last-child { color: var(--accent); font-size: 18px; }

.checkout-form { display: flex; flex-direction: column; gap: 6px; }
.checkout-form label { font-size: 12.5px; font-weight: 800; color: var(--text-muted); margin-top: 6px; }
.checkout-form input,
.checkout-form textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  outline: none;
  resize: vertical;
}
.checkout-form input:focus, .checkout-form textarea:focus { border-color: var(--accent); }

.order-btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  padding: 13px;
  border: none;
  border-radius: 12px;
  margin-top: 12px;
  background: linear-gradient(135deg, #f7b733 0%, var(--accent) 55%, #f08c00 100%);
  color: var(--primary);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(245,166,35,.35);
}
.form-note { font-size: 11.5px; color: var(--text-muted); text-align: center; margin-top: 6px; }

/* ─────────────── Success Modal ─────────────── */
/* !important — `hidden` attribute က display:none လုပ်ရမယ်။
   .modal-overlay မှာ display:grid ရှိတာကြောင့် hidden ကို override မဖြစ်အောင် */
[hidden] { display: none !important; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,25,45,.6);
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}
.modal {
  background: var(--card);
  border-radius: 18px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: pop .25s ease;
}
@keyframes pop {
  from { transform: scale(.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-icon { font-size: 48px; margin-bottom: 6px; }
.modal h3 { font-size: 18px; color: var(--primary); margin-bottom: 8px; }
.modal p { font-size: 13px; color: var(--text-muted); }
.modal-ref {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
  margin: 12px auto;
  padding: 10px;
  letter-spacing: .5px;
}
.modal-note { font-size: 12px !important; }

/* ─────────────── Product Detail Modal ─────────────── */
.detail-modal {
  position: relative;
  max-width: 420px;
  width: 100%;
  padding: 22px;
  text-align: left;
}
.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.detail-close:hover { background: #e2e8f0; }

.p-detail-img-wrap { position: relative; border-radius: 14px; overflow: hidden; }
.p-detail-img {
  width: 100%;
  height: 240px;
  object-fit: contain;
  display: block;
  padding: 8px;
  box-sizing: border-box;
  background: linear-gradient(135deg, #eef4fb, #f7f9fc);
}
.p-detail-emoji {
  display: grid;
  place-items: center;
  font-size: 72px;
  background: linear-gradient(135deg, #eef4fb, #f7f9fc);
}

.p-detail-body { padding-top: 14px; }
.p-detail-name { font-size: 19px; font-weight: 800; color: var(--primary); }
.p-detail-model { font-size: 13.5px; color: var(--text-muted); margin: 2px 0 10px; }

.p-detail-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.p-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  background: var(--bg);
  border-radius: 9px;
  padding: 8px 12px;
}
.dr-label { font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.dr-value { font-weight: 700; color: var(--text); text-align: right; }

.p-detail-desc {
  font-size: 13.5px;
  color: var(--text);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  line-height: 1.7;
}
.p-detail-total { font-size: 24px; font-weight: 800; color: var(--accent); margin-bottom: 6px; }
.p-detail-na {
  font-size: 13px;
  color: var(--red);
  font-weight: 700;
  background: #fee2e2;
  border-radius: 9px;
  padding: 10px 12px;
  text-align: center;
  margin-top: 8px;
}

/* ─────────────── Responsive ─────────────── */
@media (max-width: 560px) {
  #partsGrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .p-img { height: 130px; }
  .p-img-emoji { font-size: 42px; }
  .p-foot { flex-direction: column; align-items: stretch; }
  .p-order-btn { width: 100%; }
  .track-box { flex-direction: column; }
  .track-btn { width: 100%; }
}