/* ============================================================================
   CYRAHOP — vendor.css
   Vendor dashboard + product management. Mobile-first.
   ============================================================================ */

.vendor { padding-block: 20px 60px; }

.vendor-head {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 18px;
}
.vendor-head h1 { font-size: 1.4rem; }
.vendor-tabs { display: flex; gap: 8px; }
.vendor-tabs a {
  padding: 8px 16px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); font-size: 0.88rem; font-weight: 500;
}
.vendor-tabs a.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* stat cards */
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap-card); margin-bottom: 22px; }
.stat { padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.stat-n { font-size: 1.4rem; font-weight: 600; }
.stat-l { font-size: 0.78rem; }

.vendor-section { margin-bottom: 28px; }
.vendor-section h2 { font-size: 1.05rem; margin-bottom: 12px; }

/* order cards */
.order-list { display: grid; grid-template-columns: 1fr; gap: var(--gap-card); }
.order-card { padding: 16px; }
.order-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.order-meta, .order-addr { font-size: 0.84rem; margin-bottom: 4px; }
.order-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.order-actions form { margin: 0; }

/* earnings table */
.earn-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.earn-table th, .earn-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.earn-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.earn-table tr:last-child td { border-bottom: none; }
.earn-table .r { text-align: right; }

/* product form */
.prod-form { padding: 20px; margin-bottom: 24px; }
.prod-form h2 { font-size: 1.05rem; margin-bottom: 14px; }
.prod-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.prod-desc { grid-column: 1 / -1; }
.prod-form-actions { display: flex; gap: 10px; margin-top: 14px; }

/* product list */
.prod-list { display: grid; grid-template-columns: 1fr; gap: var(--gap-card); }
.prod-row { display: flex; align-items: center; gap: 12px; padding: 12px; }
.prod-row.is-off { opacity: 0.55; }
.prod-thumb { width: 56px; height: 56px; border-radius: var(--radius-sm); flex: 0 0 auto;
  background: var(--border) center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.prod-info { flex: 1; min-width: 0; }
.prod-name { font-weight: 600; font-size: 0.92rem; }
.prod-d { font-size: 0.8rem; }
.prod-price { font-weight: 600; margin-top: 2px; }
.prod-row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.prod-row-actions form { margin: 0; }

/* ===========================================================================
   Desktop (>=768px)
   =========================================================================== */
@media (min-width: 768px) {
  .vendor-head { flex-direction: row; align-items: center; justify-content: space-between; }
  .stat-row { grid-template-columns: repeat(4, 1fr); }
  .order-list { grid-template-columns: repeat(2, 1fr); }
  .prod-grid { grid-template-columns: 1fr 160px 200px; }
  .prod-desc { grid-column: 1 / -1; }
}

/* ---- Vendor delivery schedule form -------------------------------------- */
.day-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.day-chip { position: relative; cursor: pointer; }
.day-chip input { position: absolute; opacity: 0; pointer-events: none; }
.day-chip span {
  display: inline-block; padding: 8px 14px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong); font-size: .85rem; font-weight: 600;
  color: var(--text-muted); transition: all .12s ease;
}
.day-chip input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-pastel); }
.time-range { display: flex; align-items: center; gap: 8px; }
.time-range input[type="time"] { width: auto; flex: 1; }

/* ---- Shop open/closed banner -------------------------------------------- */
.shop-open.is-open   { border-left: 4px solid #2E9E5B; }
.shop-open.is-closed { border-left: 4px solid #D64545; }

/* ---- Toggle switch (offer own delivery) --------------------------------- */
.switch-row { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch { position: relative; display: inline-block; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  display: inline-block; width: 46px; height: 26px; border-radius: 999px;
  background: var(--border-strong); transition: background .15s ease; vertical-align: middle;
}
.switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s ease;
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch-label { font-weight: 500; font-size: .92rem; }

/* ---- Vendor "you have orders" prompt banner ----------------------------- */
.vendor-alert {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius-md);
  background: var(--yellow-soft); border: 1.5px solid var(--yellow);
  color: var(--yellow-ink); font-weight: 600; text-decoration: none;
  animation: vendorAlertPulse 1.6s ease-in-out infinite;
}
.vendor-alert:hover { filter: brightness(0.97); }
.vendor-alert-cta { color: var(--primary); white-space: nowrap; }
@keyframes vendorAlertPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(247,201,72,.0); } 50% { box-shadow: 0 0 0 4px rgba(247,201,72,.35); } }

/* ---- KYC checklist (tick/untick) + expiry alert ------------------------- */
.kyc-check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .92rem; }
.kyc-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; flex: 0 0 auto; }
.kyc-alert {
  display: block; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius-md);
  background: rgba(214,69,69,.10); border: 1.5px solid #D64545; color: #B33; font-weight: 600; text-decoration: none;
}
.kyc-alert:hover { filter: brightness(.98); }
.kyc-alert ul { margin: 6px 0 0; padding-left: 18px; font-weight: 500; }
.badge-expired { background: rgba(214,69,69,.15); color: #C0392B; }
.badge-expiring { background: var(--yellow-soft); color: var(--yellow-ink); }
