/* ── MODALS ── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.8);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
  backdrop-filter: blur(4px);
}
.overlay.open { opacity: 1; pointer-events: all; }

.modal-wrap {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}
.modal-wrap.open { display: flex; animation: modalIn .25s ease; }
@keyframes modalIn { from{opacity:0;transform:scale(.96)} to{opacity:1;transform:scale(1)} }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--t3);
  position: sticky; top: 0;
  background: var(--bg2);
  z-index: 1;
}
.modal-head button {
  background: none; border: none;
  color: var(--t3); font-size: 16px;
  transition: color .2s;
}
.modal-head button:hover { color: var(--text); }
.modal-body { padding: 20px; }

/* ADMIN MODAL */
.admin-modal { max-width: 700px; }
.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 20px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.atab {
  background: none; border: none;
  color: var(--t3);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid transparent;
  transition: all .2s;
  white-space: nowrap;
  font-family: var(--ar);
}
.atab.active { color: var(--accent2); border-bottom-color: var(--accent); }
.atab-pane { display: none; padding: 20px; }
.atab-pane.active { display: block; }

/* PIN MODAL */
.pin-modal { max-width: 380px; }
.pin-body { padding: 28px; text-align: center; }
.pin-logo {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--bg3), var(--bg4));
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.pin-hint { font-size: 13px; color: var(--t2); margin-bottom: 20px; line-height: 1.6; }
.pin-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 14px;
  border-radius: 10px;
  font-size: 20px;
  text-align: center;
  letter-spacing: 8px;
  outline: none;
  transition: border .2s;
  font-family: var(--mono);
}
.pin-input:focus { border-color: var(--accent); }
.pin-err { color: var(--red); font-size: 12px; margin-top: 8px; min-height: 16px; font-family: var(--mono); }

/* FORM */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--t2); margin-bottom: 5px; font-family: var(--mono); }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 13px;
  outline: none;
  transition: border .2s;
  font-family: var(--ar);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 80px; }
.field select option { background: var(--bg3); }

/* TABLES */
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th {
  text-align: right;
  padding: 8px 10px;
  color: var(--t3);
  font-family: var(--mono);
  border-bottom: 1px solid var(--border);
  font-weight: 400;
}
.admin-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border: none; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-family: var(--mono); }
.badge-green { background: rgba(52,211,153,.15); color: var(--green); }
.badge-red { background: rgba(248,113,113,.15); color: var(--red); }
.badge-yellow { background: rgba(251,191,36,.15); color: var(--yellow); }

/* REVIEWS */
.review-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.review-stars { color: var(--yellow); font-size: 13px; margin-bottom: 6px; }
.review-text { font-size: 13px; color: var(--t2); margin-bottom: 8px; line-height: 1.5; }
.review-meta { font-size: 11px; color: var(--t3); font-family: var(--mono); display: flex; justify-content: space-between; margin-bottom: 8px; }
.review-reply { background: var(--bg2); border: 1px solid var(--border2); border-radius: 8px; padding: 10px; margin-top: 8px; font-size: 12px; color: var(--t2); }
.review-reply-label { font-size: 10px; color: var(--accent2); font-family: var(--mono); margin-bottom: 4px; }
.hidden-review { opacity: .5; filter: blur(2px); }

/* PRODUCT DETAIL */
.pdetail-img { width: 100%; height: 200px; object-fit: cover; border-radius: 10px; margin-bottom: 16px; }
.pdetail-cat { font-family: var(--mono); font-size: 10px; color: var(--t3); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px; }
.pdetail-name { font-size: 22px; font-weight: 900; margin-bottom: 8px; }
.pdetail-price { font-family: var(--mono); font-size: 24px; font-weight: 700; color: var(--accent2); margin-bottom: 16px; }
.pdetail-desc { font-size: 14px; color: var(--t2); line-height: 1.7; margin-bottom: 24px; }
.pdetail-actions { display: flex; gap: 10px; }
.pdetail-actions .btn-primary, .pdetail-actions .btn-ghost { flex: 1; justify-content: center; }

/* DRAWER */
.drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 340px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--t3);
}
.drawer-head button { background: none; border: none; color: var(--t3); font-size: 16px; transition: color .2s; }
.drawer-head button:hover { color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 18px; }
.drawer-foot { padding: 16px 18px; border-top: 1px solid var(--border); }
.total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 14px; }
.total-val { font-family: var(--mono); font-size: 20px; color: var(--accent2); font-weight: 700; }
.cart-item { display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 10px; }
.ci-name { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.ci-price { font-family: var(--mono); font-size: 12px; color: var(--accent2); }
.ci-rm { background: none; border: none; color: var(--t3); font-size: 13px; transition: color .2s; }
.ci-rm:hover { color: var(--red); }
.cart-empty { text-align: center; padding: 48px 0; color: var(--t3); font-family: var(--mono); font-size: 12px; }

/* FREE SERVICE MODAL */
.fservice-wrap { padding: 20px; }
.fservice-desc { font-size: 13px; color: var(--t2); line-height: 1.7; margin-bottom: 18px; }
.fservice-result {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent2);
  max-height: 220px;
  overflow-y: auto;
  white-space: pre;
  display: none;
  margin: 14px 0 10px;
  line-height: 1.6;
}
.fservice-result.show { display: block; }


/* ── FS ROW ── */
.fs-row {
  display: flex;
  gap: 12px;
}
.fs-row .field { flex: 1; }

/* ── FS ACTIONS ── */
#fsActions { display: none; }

/* ── OFFER BADGE ON PRODUCT CARD ── */
.pcard-offer-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--mono);
  letter-spacing: 1px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(239,68,68,.3);
}
.pcard { position: relative; }
.pcard-price-original {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--t3);
  text-decoration: line-through;
  margin-left: 6px;
}
