/* ==========================================================================
   Storefront "طلباتي" page
   ========================================================================== */

:root {
  --ords1-primary: var(--ebmenu1-primary-color, #a8894f);
  --ords1-secondary: var(--ebmenu1-secondary-color, #4b362d);
  --ords1-ink: #2c2119;
  --ords1-muted: #7b6f63;
  --ords1-line: #e9e1d5;
  --ords1-surface: #ffffff;
  --ords1-surface-alt: #faf6f0;
  --ords1-shadow: 0 18px 40px rgba(75, 54, 45, 0.10);
  --ords1-radius: 18px;
  --ords1-radius-sm: 12px;

  --ords1-pending: #b7791f;
  --ords1-pending-bg: #fdf3e2;
  --ords1-progress: #0f766e;
  --ords1-progress-bg: #e3f5f2;
  --ords1-delivered: #15803d;
  --ords1-delivered-bg: #e6f6ea;
  --ords1-rejected: #b91c1c;
  --ords1-rejected-bg: #fdeaea;
}

.ords1-page {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  color: var(--ords1-ink);
}

/* ---- Hero ---------------------------------------------------------------- */
.ords1-hero {
  width: 100%;
  background: linear-gradient(135deg, var(--ords1-secondary), var(--ords1-primary));
  color: #fff;
  padding: 40px 16px 46px;
}

.ords1-hero-inner {
  max-width: 1080px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ords1-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.82rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.ords1-hero-title {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
}

.ords1-hero-subtitle {
  margin: 0;
  max-width: 560px;
  font-size: 0.95rem;
  line-height: 1.7;
  opacity: 0.92;
}

/* ---- Section shell ----------------------------------------------------- */
.ords1-section {
  width: 100%;
  padding: 22px 14px 40px;
}

.ords1-container {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- Filter ----------------------------------------------------------- */
.ords1-filter {
  background: var(--ords1-surface);
  border: 1px solid var(--ords1-line);
  border-radius: var(--ords1-radius);
  box-shadow: var(--ords1-shadow);
  padding: 18px;
}

.ords1-filter-head h3 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ords1-secondary);
}

.ords1-filter-body {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 14px;
}

.ords1-filter-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ords1-filter-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 38px;
}

.ords1-filter-section-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--ords1-ink);
}

.ords1-filter-units {
  display: flex;
  gap: 6px;
}

.ords1-unit-btn {
  padding: 7px 13px;
  border-radius: 10px;
  border: 1px solid var(--ords1-line);
  background: var(--ords1-surface);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ords1-muted);
  transition: all 0.18s ease;
}

.ords1-unit-btn.is-active {
  background: linear-gradient(135deg, var(--ords1-primary), var(--ords1-secondary));
  border-color: transparent;
  color: #fff;
}

.ords1-date-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 12px;
  padding: 14px;
  background: var(--ords1-surface-alt);
  border: 1px solid var(--ords1-line);
  border-radius: var(--ords1-radius-sm);
}

.ords1-date-field,
.ords1-status-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ords1-date-field label,
.ords1-status-field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ords1-muted);
}

.ords1-date-field input,
.ords1-select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--ords1-line);
  border-radius: var(--ords1-radius-sm);
  background: var(--ords1-surface);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ords1-ink);
}

.ords1-date-field input:focus,
.ords1-select:focus {
  outline: none;
  border-color: var(--ords1-primary);
  box-shadow: 0 0 0 3px rgba(168, 137, 79, 0.16);
}

.ords1-status-field {
  padding: 14px;
  background: var(--ords1-surface-alt);
  border: 1px solid var(--ords1-line);
  border-radius: var(--ords1-radius-sm);
  height: 100%;
  justify-content: center;
}

.ords1-select-wrap {
  position: relative;
}

.ords1-select {
  padding-left: 38px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.ords1-select-arrow {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--ords1-muted);
  font-size: 0.75rem;
}

.ords1-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.ords1-filter-reset,
.ords1-filter-apply {
  padding: 10px 22px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid var(--ords1-line);
}

.ords1-filter-reset {
  background: var(--ords1-surface);
  color: var(--ords1-muted);
}

.ords1-filter-apply {
  border-color: transparent;
  background: linear-gradient(135deg, var(--ords1-primary), var(--ords1-secondary));
  color: #fff;
  box-shadow: 0 10px 20px rgba(168, 137, 79, 0.24);
}

/* ---- Cards ---------------------------------------------------------- */
.ords1-cards {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ords1-card {
  background: var(--ords1-surface);
  border: 1px solid var(--ords1-line);
  border-radius: var(--ords1-radius);
  box-shadow: var(--ords1-shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 4px solid var(--ords1-primary);
}

.ords1-card--locked {
  opacity: 0.92;
  border-top-color: var(--ords1-delivered);
}

.ords1-card.ords1-status--rejected { border-top-color: var(--ords1-rejected); }
.ords1-card.ords1-status--pending { border-top-color: var(--ords1-pending); }
.ords1-card.ords1-status--progress { border-top-color: var(--ords1-progress); }
.ords1-card.ords1-status--delivered { border-top-color: var(--ords1-delivered); }

.ords1-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ords1-order-badge {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--ords1-secondary);
  background: var(--ords1-surface-alt);
  border: 1px solid var(--ords1-line);
  padding: 6px 12px;
  border-radius: 10px;
  direction: ltr;
}

.ords1-status {
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
}

.ords1-status.ords1-status--pending { background: var(--ords1-pending-bg); color: var(--ords1-pending); }
.ords1-status.ords1-status--progress { background: var(--ords1-progress-bg); color: var(--ords1-progress); }
.ords1-status.ords1-status--delivered { background: var(--ords1-delivered-bg); color: var(--ords1-delivered); }
.ords1-status.ords1-status--rejected { background: var(--ords1-rejected-bg); color: var(--ords1-rejected); }

.ords1-block-title,
.ords1-customer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--ords1-secondary);
}

/* customer block */
.ords1-customer {
  background: var(--ords1-surface-alt);
  border: 1px solid var(--ords1-line);
  border-radius: var(--ords1-radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ords1-customer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ords1-edit-data-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--ords1-primary);
  background: rgba(168, 137, 79, 0.10);
  color: var(--ords1-secondary);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.78rem;
}

.ords1-customer-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.ords1-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--ords1-surface);
  border: 1px solid var(--ords1-line);
  border-radius: 9px;
  padding: 8px 10px;
}

.ords1-field-key {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ords1-muted);
}

.ords1-field-val {
  font-size: 0.9rem;
  font-weight: 700;
  word-break: break-word;
}

/* products */
.ords1-prd-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ords1-prd-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ords1-prd {
  display: grid;
  grid-template-columns: 26px 76px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: var(--ords1-surface-alt);
  border: 1px solid var(--ords1-line);
  border-radius: var(--ords1-radius-sm);
}

.ords1-prd-seq {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ords1-primary), var(--ords1-secondary));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

.ords1-prd-media {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 10px;
  overflow: hidden;
  background: #efe7db;
}

.ords1-prd-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ords1-prd-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--ords1-rejected);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
}

.ords1-prd-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ords1-prd-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
}

.ords1-prd-pricing {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.ords1-prd-price {
  font-weight: 800;
  color: var(--ords1-secondary);
  font-size: 0.9rem;
}

.ords1-prd-price-old {
  text-decoration: line-through;
  color: var(--ords1-muted);
  font-size: 0.78rem;
}

.ords1-prd-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.ords1-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ords1-line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--ords1-surface);
}

.ords1-qty-btn {
  width: 34px;
  height: 36px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ords1-secondary);
  background: var(--ords1-surface-alt);
}

.ords1-qty-input {
  width: 46px;
  height: 36px;
  border: none;
  border-left: 1px solid var(--ords1-line);
  border-right: 1px solid var(--ords1-line);
  text-align: center;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ords1-ink);
  background: var(--ords1-surface);
  -moz-appearance: textfield;
}

.ords1-qty-input::-webkit-outer-spin-button,
.ords1-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ords1-qty-input:focus {
  outline: none;
  background: #fffdf9;
}

.ords1-prd-qty-static {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ords1-muted);
}

.ords1-prd-line {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.ords1-prd-line-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ords1-muted);
}

.ords1-prd-line strong {
  font-size: 0.92rem;
  color: var(--ords1-ink);
}

.ords1-prd-remove {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--ords1-rejected-bg);
  background: var(--ords1-rejected-bg);
  color: var(--ords1-rejected);
  font-weight: 800;
}

.ords1-prd-more[hidden] { display: none; }

.ords1-prd-more-toggle {
  align-self: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px dashed var(--ords1-primary);
  background: transparent;
  color: var(--ords1-secondary);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
}

/* meta */
.ords1-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.ords1-meta-item {
  background: var(--ords1-surface-alt);
  border: 1px solid var(--ords1-line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ords1-meta-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ords1-muted);
}

.ords1-meta-val {
  font-size: 0.9rem;
  font-weight: 700;
}

.ords1-meta-total {
  color: var(--ords1-secondary);
  font-size: 1rem;
  font-weight: 800;
}

/* notes */
.ords1-notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ords1-notes-input {
  width: 100%;
  border: 1px solid var(--ords1-line);
  border-radius: var(--ords1-radius-sm);
  background: var(--ords1-surface-alt);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ords1-ink);
  resize: vertical;
}

.ords1-notes-input:focus {
  outline: none;
  border-color: var(--ords1-primary);
  box-shadow: 0 0 0 3px rgba(168, 137, 79, 0.16);
}

.ords1-notes-input[readonly] {
  opacity: 0.7;
  cursor: not-allowed;
}

/* footer */
.ords1-card-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px dashed var(--ords1-line);
  padding-top: 14px;
}

.ords1-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  border: none;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(135deg, var(--ords1-primary), var(--ords1-secondary));
  box-shadow: 0 10px 20px rgba(168, 137, 79, 0.24);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.ords1-send-btn:disabled {
  opacity: 0.45;
  box-shadow: none;
  cursor: not-allowed;
}

.ords1-send-btn.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.ords1-dirty-hint {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ords1-pending);
}

.ords1-dirty-hint[hidden] { display: none; }

.ords1-locked-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--ords1-radius-sm);
  background: var(--ords1-delivered-bg);
  color: var(--ords1-delivered);
  font-weight: 700;
  font-size: 0.85rem;
}

.ords1-muted {
  color: var(--ords1-muted);
  font-size: 0.85rem;
}

/* empty state */
.ords1-empty {
  text-align: center;
  padding: 48px 20px;
  background: var(--ords1-surface);
  border: 1px dashed var(--ords1-line);
  border-radius: var(--ords1-radius);
  color: var(--ords1-muted);
}

.ords1-empty i {
  font-size: 2.4rem;
  color: var(--ords1-primary);
  opacity: 0.55;
}

.ords1-empty p {
  margin: 12px 0 0;
  font-weight: 700;
}

/* edit-data modal (rendered inside the SweetAlert popup) */
.ords1-modal-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: right;
}

.ords1-modal-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
}

.ords1-modal-input {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
}

.ords1-modal-input:focus {
  outline: none;
  border-color: var(--ords1-primary);
}

/* ---- Responsive ---------------------------------------------------- */
@media (max-width: 860px) {
  .ords1-filter-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .ords1-prd {
    grid-template-columns: 26px 1fr;
    grid-template-areas:
      "seq media"
      "body body"
      "side side";
  }
  .ords1-prd-seq { grid-area: seq; }
  .ords1-prd-media { grid-area: media; width: 100%; height: 120px; }
  .ords1-prd-body { grid-area: body; }
  .ords1-prd-side {
    grid-area: side;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .ords1-date-panel {
    grid-template-columns: 1fr;
  }
  .ords1-filter-actions {
    flex-direction: column-reverse;
  }
  .ords1-filter-actions button {
    width: 100%;
  }
}
