/* ====== SDP: Global Variables ====== */
:root {
  --sdp-primary: #ff7a00;
  --sdp-primary-hover: #e66e00;
  --sdp-dark: #111827;
  --sdp-bg-input: #f0f4f8;       /* Lebih gelap sikit dari putih */
  --sdp-bg-alt: #fbfcfd;
  --sdp-border: #dfe5ea;
  --sdp-border-light: #e6edf2;
  --sdp-text-main: #0d2538;
  --sdp-text-muted: #97a0a8;
  --sdp-success: #0a8f3e;
}

/* Container Borang */
.sdp-form {
  max-width: 720px;
  margin: 10px auto;
  padding: 15px;
  border: 1px solid #eee;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,.06);
  font-family: system-ui, -apple-system, sans-serif;
  color: #444;
  background: #e1e8ed;
}

.sdp-form h2 { margin: 0 0 18px; font-size: 34px; letter-spacing: .2px; }

/* Label & Inputs */
.sdp-form label { display: block; font-weight: 600; margin-top: 14px; }
.sdp-form label small { font-weight: 400; color: var(--sdp-text-muted); }

.sdp-form input[type="text"],
.sdp-form input[type="email"],
.sdp-form input[type="tel"] {
  width: 100%;
  padding: 12px 14px;
  margin: 6px 0 0;
  border: 1px solid var(--sdp-border);
  border-radius: 10px;
  background: var(--sdp-bg-input);
  color: var(--sdp-text-main);
  font-size: 16px; /* Elak iOS Zoom */
  transition: all .15s;
}

.sdp-form input::placeholder { color: #8a99a8; opacity: 1; }

.sdp-form input:focus {
  outline: none;
  background: #eef3f7;
  border-color: var(--sdp-primary);
  box-shadow: 0 0 0 3px rgba(255,122,0,.18);
}

/* Order Summary */
.sdp-summary-title { font-weight: 700; font-size: 20px; margin: 30px 0 12px; text-transform: uppercase; }

.sdp-item-row {
  display: flex; gap: 14px; align-items: center;
  border-top: 2px solid #eef2f6;
  border-bottom: 1px dashed var(--sdp-border-light);
  padding: 12px 0;
}

.sdp-item-img {
  width: 72px; height: 72px; border-radius: 10px; overflow: hidden;
  background: #f6f8fa; flex: 0 0 72px; display: flex; align-items: center; justify-content: center;
}

/* Coupon Box */
.sdp-coupon-wrapper {
  margin-top: 14px; padding: 14px;
  border: 2px dashed #777;
  border-radius: 12px; background: #c6cbce;
}

.sdp-coupon-input-group {
  display: flex;
  flex-wrap: nowrap;           /* Paksa kekal satu baris */
  gap: 10px;
  align-items: stretch;        /* Buat height selari */
}

.sdp-coupon-input-group input[type="text"] {
  flex: 1 1 auto;              /* Input ambil baki ruang */
  min-width: 0;                /* Penting supaya boleh mengecil */
  padding: 12px 14px;
  border: 1px solid var(--sdp-border);
  border-radius: 10px;
  background: var(--sdp-bg-input);
  font-size: 16px;
}

.sdp-btn-apply {
  padding: 0 24px;
  white-space: nowrap;         /* Elak teks pecah baris */
  border: 0;
  border-radius: 10px;
  background: #fcb900;
  color: #222;
  font-weight: 700;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.2s;
}

.sdp-btn-apply:hover {
  background: #f5b000;
}

/* Pricing */
.sdp-price-row { display: flex; justify-content: space-between; padding: 10px 0; }
.sdp-price-discount { color: var(--sdp-success); font-weight: 700; display: none; }
.sdp-price-total { border-top: 1px dashed var(--sdp-border-light); font-weight: 800; font-size: 1.1em; padding-top: 12px; }

/* Buttons */
.sdp-btn-submit {
  margin-top: 12px; width: 100%; padding: 10px; border: 0; border-radius: 12px;
  background: #fcb900; color: #fff; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 16px;
}

button.sdp-btn-submit {
  margin-top: 12px; width: 100%; padding: 10px; border: 0; border-radius: 12px;
  background: #fcb900; color: #333; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 18px;
}

.sdp-footer-note { font-size: 13px; color: var(--sdp-text-muted); margin-top: 14px; }

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --sdp-bg-input: #eee;
    --sdp-border: #334155;
    --sdp-text-main: #111; /* Kekalkan teks gelap jika bg form masih putih */
  }
}

/* Optional: kalau nak button Apply lebih kecil lagi pada skrin sangat kecik */
@media (max-width: 360px) {
  .sdp-btn-apply {
    padding: 0 16px;
    font-size: 14px;
  }
}

/* Referral dashboard table: responsive on mobile */
.sdp-refdash-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sdp-refdash-table {
  width: 100%;
  min-width: 680px;
}

@media (max-width: 768px) {
  .sdp-refdash-table {
    min-width: 0;
    border-collapse: separate !important;
    border-spacing: 0;
  }

  .sdp-refdash-table thead {
    display: none;
  }

  .sdp-refdash-table,
  .sdp-refdash-table tbody,
  .sdp-refdash-table tr,
  .sdp-refdash-table td {
    display: block;
    width: 100%;
  }

  .sdp-refdash-table tr {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px 10px;
    margin: 0 0 10px;
    background: #fff;
  }

  .sdp-refdash-table td {
    border: 0 !important;
    padding: 6px 0 !important;
    text-align: left !important;
  }

  .sdp-refdash-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .02em;
  }

  .sdp-refdash-table tr.is-empty {
    border: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
  }

  .sdp-refdash-table tr.is-empty td {
    padding: 10px 0 !important;
  }

  .sdp-refdash-table tr.is-empty td::before {
    content: '';
    display: none;
  }
}
