/* =========================
   ORDERS + ORDER DETAILS
   Mobile-first clean production CSS
   Scoped to orders.html and order-details.html only
========================= */

.orders-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(36, 76, 68, 0.08), transparent 30%),
    linear-gradient(180deg, #fffdf8 0%, #fbf7ef 100%);
  color: #244c44;
  overflow-x: hidden;
}

.orders-body .nav {
  background: rgba(36, 76, 68, 0.96);
}

.orders-page {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 118px 16px 46px;
}

.orders-hero {
  margin-bottom: 18px;
}

.orders-hero .eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 161, 98, 0.14);
  color: #a65f2f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.orders-hero h1 {
  color: #244c44;
  font-size: clamp(36px, 9vw, 60px);
  line-height: 0.96;
  letter-spacing: -0.045em;
  margin: 0 0 10px;
}

.orders-hero p {
  max-width: 540px;
  color: #68766f;
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
}

.orders-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(36, 76, 68, 0.10);
  border-radius: 24px;
  min-height: 260px;
  padding: 16px;
  box-shadow: 0 18px 48px rgba(36, 76, 68, 0.08);
  backdrop-filter: blur(10px);
}

/* Empty / loading states */
.orders-empty {
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px 12px;
}

.orders-empty-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: #f7f2e7;
  color: #244c44;
  font-size: 30px;
  margin-bottom: 14px;
}

.orders-empty h2 {
  color: #244c44;
  font-size: 24px;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
}

.orders-empty p {
  color: #6e7a75;
  max-width: 360px;
  margin: 0 0 20px;
  line-height: 1.55;
}

.orders-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: #244c44;
  color: #fffdf8;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.orders-btn:hover {
  background: #a27b5c;
  color: #fffdf8;
  transform: translateY(-1px);
}

.orders-btn.secondary {
  background: #f2eadf;
  color: #244c44;
}

.orders-btn.secondary:hover {
  background: #244c44;
  color: #fffdf8;
}

.orders-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Orders listing */
.orders-list {
  display: grid;
  gap: 14px;
}

.order-item {
  display: block;
  padding: 16px;
  border: 1px solid rgba(36, 76, 68, 0.10);
  border-radius: 20px;
  background: #fffdf8;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(36, 76, 68, 0.045);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.order-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(36, 76, 68, 0.08);
  border-color: rgba(36, 76, 68, 0.18);
}

.order-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.order-label {
  color: #a27b5c;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 5px;
}

.order-top h2,
.order-details-header h2 {
  color: #244c44;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0;
}

.order-status,
.payment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.order-status {
  background: #f7f2e7;
  color: #244c44;
}

.payment-badge {
  gap: 5px;
}

.payment-verified {
  background: rgba(26, 127, 55, 0.10);
  color: #1a7f37;
}

.payment-pending {
  background: rgba(184, 116, 0, 0.12);
  color: #9a6200;
}

.order-info {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr 0.8fr;
  gap: 10px;
}

.order-info div {
  min-width: 0;
  background: #ffffff;
  border: 1px solid rgba(36, 76, 68, 0.07);
  border-radius: 15px;
  padding: 12px;
}

.order-info span {
  display: block;
  color: #7a8580;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 5px;
}

.order-info strong {
  display: block;
  color: #244c44;
  font-size: 14px;
  line-height: 1.25;
  word-break: break-word;
}

.order-view-text {
  margin: 14px 0 0;
  color: #a27b5c;
  font-size: 14px;
  font-weight: 900;
}

/* Order details */
.order-details-card {
  padding: 18px;
}

.order-details-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 22px;
}

.order-details-date {
  color: #6e7a75;
  margin: 8px 0 0;
  font-size: 14px;
}

.order-details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.order-details-box {
  background: #fffdf8;
  border: 1px solid rgba(36, 76, 68, 0.10);
  border-radius: 18px;
  padding: 16px;
}

.order-details-box span {
  display: block;
  color: #7a8580;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 7px;
}

.order-details-box strong {
  color: #244c44;
  font-size: 17px;
  line-height: 1.25;
}

.order-timeline {
  border-top: 1px solid rgba(36, 76, 68, 0.10);
  padding-top: 22px;
}

.order-timeline h3 {
  color: #244c44;
  font-size: 22px;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  margin-bottom: 18px;
  color: #78837e;
}

.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 22px;
  bottom: -14px;
  width: 2px;
  background: rgba(36, 76, 68, 0.10);
}

.timeline-item > span {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 50%;
  background: #d7dfdb;
  box-shadow: 0 0 0 4px #fffdf8;
  z-index: 1;
}

.timeline-item.active > span {
  background: #244c44;
}

.timeline-item strong {
  display: block;
  color: #244c44;
  margin-bottom: 3px;
  font-size: 15px;
}

.timeline-item p {
  color: #6e7a75;
  line-height: 1.45;
  font-size: 14px;
  margin: 0;
}

.order-details-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  justify-content: start;
  gap: 10px;
  margin-top: 24px;
}

#reorderMessage {
  margin-top: 14px !important;
  color: #6e7a75 !important;
  font-size: 14px;
  font-weight: 800 !important;
}

/* Clean product summary row generated from order-details.js */
.order-details-card > div[style*="grid-template-columns: 110px"] {
  background: #f7f2e7;
  border-radius: 20px;
  padding: 12px;
}

.order-details-card > div[style*="grid-template-columns: 110px"] h3 {
  font-size: 22px !important;
  line-height: 1.12 !important;
  letter-spacing: -0.025em;
}

/* Desktop */
@media (min-width: 769px) {
  .orders-page {
    padding: 130px 24px 64px;
  }

  .orders-card {
    padding: 28px;
    border-radius: 28px;
  }

  .orders-hero {
    margin-bottom: 26px;
  }
}

/* Mobile */
@media (max-width: 700px) {
  .orders-page {
    padding: 96px 14px 34px;
  }

  .orders-hero {
    margin-bottom: 16px;
  }

  .orders-hero h1 {
    font-size: 38px;
  }

  .orders-hero p {
    font-size: 14px;
  }

  .orders-card {
    padding: 12px;
    border-radius: 22px;
    min-height: 220px;
  }

  .orders-empty {
    min-height: 220px;
  }

  .orders-list {
    gap: 12px;
  }

  .order-item {
    padding: 14px;
    border-radius: 18px;
  }

  .order-top,
  .order-details-header {
    grid-template-columns: 1fr;
  }

  .order-top > div:last-child,
  .order-details-header > div:last-child {
    align-items: flex-start !important;
  }

  .order-info {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .order-info div:first-child {
    grid-column: 1 / -1;
  }

  .order-info div {
    padding: 11px;
    border-radius: 14px;
  }

  .order-details-card {
    padding: 14px;
  }

  .order-details-card > div[style*="grid-template-columns: 110px"] {
    grid-template-columns: 82px 1fr !important;
    gap: 12px !important;
    margin-bottom: 22px !important;
  }

  .order-details-card > div[style*="grid-template-columns: 110px"] > div:first-child {
    width: 82px !important;
    height: 82px !important;
    border-radius: 16px !important;
  }

  .order-details-card > div[style*="grid-template-columns: 110px"] h3 {
    font-size: 18px !important;
    margin-bottom: 5px !important;
  }

  .order-details-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 22px;
  }

  .order-details-actions {
    grid-template-columns: 1fr;
  }

  .orders-btn {
    width: 100%;
    min-height: 46px;
  }
}

@media (max-width: 360px) {
  .orders-page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .order-info {
    grid-template-columns: 1fr;
  }
}

/* =========================
   FAST ORDER TIMELINE PATCH
========================= */

.order-badge-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.order-product-summary {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 26px;
  padding: 12px;
  border-radius: 22px;
  background: #f7f2e7;
}

.order-product-image {
  width: 110px;
  height: 110px;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #fffdf8;
  border: 1px solid rgba(36, 76, 68, 0.10);
}

.order-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-product-image span {
  font-size: 34px;
}

.order-product-summary h3 {
  color: #244c44;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 7px;
}

.order-product-summary p:not(.order-label) {
  color: #707a75;
  margin: 0;
  font-weight: 700;
}

.tracking-box {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 26px;
  padding: 16px;
  border-radius: 20px;
  background: #fffdf8;
  border: 1px solid rgba(36, 76, 68, 0.10);
}

.tracking-box span {
  display: block;
  color: #7a8580;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.tracking-box strong {
  color: #244c44;
  font-size: 15px;
}

.tracking-box p {
  margin: 6px 0 0;
  color: #6e7a75;
  line-height: 1.5;
}

.tracking-pending-box {
  grid-template-columns: 1fr;
  background: rgba(255, 161, 98, 0.10);
}

.timeline-item.active strong {
  color: #244c44;
}

.timeline-item.active p {
  color: #4d625a;
  font-weight: 650;
}

.timeline-item.active:not(:last-child)::before {
  background: rgba(36, 76, 68, 0.35);
}

#reorderMessage {
  margin-top: 14px !important;
  color: #6e7a75 !important;
  font-size: 14px;
  font-weight: 800 !important;
}

@media (max-width: 700px) {
  .order-badge-stack {
    align-items: flex-start;
  }

  .order-product-summary {
    grid-template-columns: 82px 1fr;
    gap: 12px;
    margin-bottom: 22px;
    border-radius: 18px;
  }

  .order-product-image {
    width: 82px;
    height: 82px;
    border-radius: 16px;
  }

  .order-product-summary h3 {
    font-size: 18px;
  }

  .tracking-box {
    grid-template-columns: 1fr;
    padding: 14px;
  }
}