/* Customer orders — list and detail */

.shop-account-orders-page,
.shop-account-addresses-page,
.shop-account-wallet-page {
  max-width: 920px;
}

.shop-account-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.shop-account-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--w);
  color: var(--g6);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.shop-account-nav-link:hover {
  border-color: rgba(198, 123, 78, 0.45);
  color: var(--dark);
}

.shop-account-nav-link.is-active {
  border-color: var(--a1, #c67b4e);
  background: rgba(198, 123, 78, 0.1);
  color: var(--a1, #c67b4e);
}

.cust-orders,
.cust-order-detail {
  display: grid;
  gap: 16px;
}

.cust-orders-tabs {
  margin-bottom: 20px;
}

.cust-orders-tabs-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--g1) 0%, rgba(248, 248, 248, 0.65) 100%);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.cust-orders-tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--g5);
  font: inherit;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.cust-orders-tab-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.cust-orders-tab-icon {
  font-size: 14px;
  opacity: 0.72;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.cust-orders-tab-label {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.cust-orders-tab:hover:not(.is-active) {
  color: var(--dark);
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(0, 0, 0, 0.04);
}

.cust-orders-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring-soft, rgba(217, 127, 74, 0.18));
}

.cust-orders-tab.is-active {
  color: var(--dark);
  background: var(--w);
  border-color: rgba(198, 123, 78, 0.22);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 8px 20px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.cust-orders-tab.is-active .cust-orders-tab-icon {
  color: var(--a1, #c67b4e);
  opacity: 1;
}

.cust-orders-tab.is-active::after {
  content: '';
  position: absolute;
  inset-inline: 18%;
  bottom: 5px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--a1, #c67b4e), rgba(198, 123, 78, 0.55));
}

.cust-orders-tabs.is-loading .cust-orders-tab {
  pointer-events: none;
  opacity: 0.72;
}

@media (max-width: 640px) {
  .cust-orders-tabs-track {
    gap: 4px;
    padding: 4px;
  }

  .cust-orders-tab {
    min-height: 44px;
    padding: 8px 6px;
  }

  .cust-orders-tab-inner {
    flex-direction: column;
    gap: 4px;
  }

  .cust-orders-tab-label {
    font-size: 12px;
  }

  .cust-orders-tab-icon {
    font-size: 13px;
  }

  .cust-orders-tab.is-active::after {
    inset-inline: 24%;
    bottom: 4px;
    height: 2px;
  }
}

.cust-orders-panel {
  display: grid;
  gap: 16px;
}

.cust-orders-list {
  display: grid;
  gap: 12px;
}

.cust-order-card {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--w);
}

.cust-order-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.cust-order-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--dark);
}

.cust-order-card-meta {
  font-size: 13px;
  color: var(--g5);
  line-height: 1.7;
}

.cust-order-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cust-order-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--g1);
  color: var(--g6);
}

.cust-order-badge--payment-pending {
  background: #fff7ed;
  color: #c2410c;
}

.cust-order-badge--payment-paid {
  background: #ecfdf5;
  color: #047857;
}

.cust-order-badge--cancelled {
  background: #fef2f2;
  color: #b91c1c;
}

.cust-order-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cust-order-amount {
  font-size: 15px;
  font-weight: 800;
  color: var(--dark);
}

.cust-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cust-order-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--w);
  color: var(--g6);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.cust-order-btn:hover {
  border-color: var(--g4);
  color: var(--dark);
}

.cust-order-btn--primary {
  border-color: var(--a1, #c67b4e);
  background: var(--a1, #c67b4e);
  color: #fff;
}

.cust-order-btn--primary:hover {
  color: #fff;
  filter: brightness(0.96);
}

.cust-orders-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cust-orders-empty,
.cust-orders-loading,
.cust-orders-error {
  text-align: center;
  padding: 40px 20px;
  color: var(--g5);
  border: 1px dashed var(--border);
  border-radius: 14px;
}

.cust-orders-empty i {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.45;
}

.cust-order-detail-back {
  margin-bottom: 4px;
}

.cust-order-detail-grid {
  display: grid;
  gap: 16px;
}

.cust-order-panel {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--w);
}

.cust-order-panel-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--dark);
}

.cust-order-summary-grid {
  display: grid;
  gap: 10px;
}

.cust-order-summary-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  color: var(--g5);
}

.cust-order-summary-row strong {
  color: var(--dark);
}

.cust-order-summary-row--total {
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 15px;
  font-weight: 800;
}

.cust-order-items {
  display: grid;
  gap: 10px;
}

.cust-order-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.cust-order-item-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--g1);
  border: 1px solid var(--border);
}

.cust-order-item-thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--g5);
  font-size: 18px;
}

.cust-order-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.cust-order-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
}

.cust-order-item-meta,
.cust-order-item-qty {
  font-size: 13px;
  color: var(--g5);
}

.cust-order-item-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--dark);
  text-align: left;
}

.cust-order-address {
  font-size: 14px;
  line-height: 1.8;
  color: var(--g5);
}

.cust-order-timeline {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0 14px 0 0;
  list-style: none;
}

.cust-order-timeline-item {
  position: relative;
  padding-right: 28px;
  border-right: 2px solid var(--border);
}

.cust-order-timeline-item:last-child {
  border-right-color: var(--a1, #c67b4e);
}

.cust-order-timeline-icon {
  position: absolute;
  right: -13px;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--w);
  border: 2px solid var(--border);
  color: var(--g5);
  font-size: 11px;
  line-height: 1;
}

.cust-order-timeline-item:last-child .cust-order-timeline-icon {
  border-color: var(--a1, #c67b4e);
  color: var(--a1, #c67b4e);
  background: color-mix(in srgb, var(--a1, #c67b4e) 12%, white);
}

.cust-order-timeline-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
}

.cust-order-timeline-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--g5);
  line-height: 1.6;
}

.cust-order-shipment {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--g1);
  font-size: 13px;
  line-height: 1.7;
  color: var(--g5);
}

.cust-order-shipment + .cust-order-shipment {
  margin-top: 10px;
}

.cust-order-alert {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.cust-order-alert--success {
  background: #ecfdf3;
  border: 1px solid #abefc6;
}

.cust-order-alert--failed {
  background: #fef3f2;
  border: 1px solid #fecdca;
}

.cust-order-alert-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.cust-order-alert--success .cust-order-alert-icon {
  background: #d1fadf;
  color: #027a48;
}

.cust-order-alert--failed .cust-order-alert-icon {
  background: #fee4e2;
  color: #b42318;
}

.cust-order-alert-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--dark);
}

.cust-order-alert-text,
.cust-order-alert-meta {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--g5);
}

.cust-order-alert-meta {
  margin-top: 8px;
  font-size: 13px;
}

.cust-fulfillment-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.cust-fulfillment-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 0 0 18px 0;
  position: relative;
}

.cust-fulfillment-step:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 19px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.cust-fulfillment-step--done:not(:last-child)::after {
  background: color-mix(in srgb, var(--a1, #c67b4e) 55%, var(--border));
}

.cust-fulfillment-step-marker {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  background: var(--g1);
  color: var(--g4);
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.cust-fulfillment-step--active .cust-fulfillment-step-marker {
  border-color: var(--a1, #c67b4e);
  background: color-mix(in srgb, var(--a1, #c67b4e) 14%, white);
  color: var(--a1, #c67b4e);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1, #c67b4e) 12%, transparent);
}

.cust-fulfillment-step--done .cust-fulfillment-step-marker {
  border-color: #12b76a;
  background: #ecfdf3;
  color: #027a48;
}

.cust-fulfillment-step--pending .cust-fulfillment-step-title,
.cust-fulfillment-step--pending .cust-fulfillment-step-subtitle {
  opacity: 0.45;
}

.cust-fulfillment-step-title {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--dark);
}

.cust-fulfillment-step-subtitle {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--g5);
  line-height: 1.6;
}

.cust-order-panel--fulfillment {
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .cust-order-detail-grid--two {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }
}
