/* My Orders — light ImpromptuIndian brand palette */

body.page-customer-app.page-orders {
  background: var(--ci-page-bg);
}

body.page-customer-app.page-orders main {
  background: var(--ci-page-bg);
}

/* Orders page: solid maroon active nav (per design reference) */
body.page-orders .ci-sidebar .menu-item.active {
  background: var(--ci-brand) !important;
  color: #fff !important;
  border-radius: 0.5rem;
}

body.page-orders .ci-sidebar .menu-item.active::before {
  display: none;
}

body.page-orders .ci-sidebar .menu-item.active i,
body.page-orders .ci-sidebar .menu-item.active svg {
  color: #fff;
}

/* Page header */
.orders-page-header h1 {
  color: var(--ci-text);
  font-weight: 700;
}

.orders-page-header p {
  color: var(--ci-text-muted);
}

/* Order History card */
.orders-history-card {
  background: var(--ci-card-bg);
  border: 1px solid var(--ci-border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem 1rem;
  box-shadow: var(--ci-card-shadow);
}

@media (min-width: 768px) {
  .orders-history-card {
    padding: 1.5rem 1.75rem 1.25rem;
  }
}

.orders-history-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ci-text);
  margin: 0 0 1rem;
}

@media (min-width: 768px) {
  .orders-history-title {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
  }
}

/* Toolbar */
.orders-history-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 1024px) {
  .orders-history-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }
}

.orders-history-toolbar__left {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.orders-search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 1024px) {
  .orders-search-wrap {
    max-width: 420px;
  }
}

.orders-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ci-text-muted);
  pointer-events: none;
}

.orders-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  font-size: 0.8125rem;
  color: var(--ci-text);
  background: #fff;
  border: 1px solid var(--ci-border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.orders-search-input::placeholder {
  color: #9ca3af;
}

.orders-search-input:focus {
  border-color: var(--ci-brand);
  box-shadow: 0 0 0 2px var(--ci-brand-light);
}

.orders-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  color: var(--ci-text-muted);
  background: #fff;
  border: 1px solid var(--ci-border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.orders-filter-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: var(--ci-text);
}

.orders-date-range {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ci-text);
  background: #fff;
  border: 1px solid var(--ci-border);
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.orders-date-range:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.orders-date-range__label {
  user-select: none;
}

.orders-date-inputs {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Table */
.orders-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--ci-border);
}

.orders-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  font-size: 0.8125rem;
  background: #fff;
}

.orders-table thead {
  background: #f5f5f5;
}

.orders-table thead th {
  padding: 0.75rem 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ci-text);
  text-align: left;
  border-bottom: 1px solid var(--ci-border);
  white-space: nowrap;
}

.orders-table thead th.col-cost,
.orders-table thead th.col-action {
  text-align: right;
}

.orders-table tbody tr {
  border-bottom: 1px solid var(--ci-border);
  transition: background 0.15s ease;
}

.orders-table tbody tr:last-child {
  border-bottom: none;
}

.orders-table tbody tr:hover {
  background: #fafafa;
}

.orders-table tbody td {
  padding: 1rem;
  vertical-align: middle;
  color: var(--ci-text);
  background: #fff;
}

/* Order reference */
.order-ref-link {
  display: inline;
  padding: 0;
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--ci-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.order-ref-link:hover {
  color: var(--ci-brand-hover);
}

.order-ref-cell__id {
  font-weight: 600;
  color: var(--ci-brand);
  font-size: 0.875rem;
  line-height: 1.3;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.order-ref-cell__date {
  margin-top: 0.2rem;
  font-size: 0.6875rem;
  color: var(--ci-text-muted);
}

/* Product */
.order-product-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 180px;
}

.order-product-thumb {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover;
  background: #f3f4f6;
  border: 1px solid var(--ci-border);
}

.order-product-thumb--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ci-text-muted);
}

.order-product-cell__title {
  font-weight: 700;
  color: var(--ci-text);
  font-size: 0.8125rem;
  line-height: 1.3;
}

.order-product-cell__meta {
  margin-top: 0.15rem;
  font-size: 0.6875rem;
  color: var(--ci-text-muted);
  line-height: 1.35;
}

/* Status badge */
.order-status-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 9999px;
  white-space: nowrap;
}

.order-status-badge--neutral {
  background: #9ca3af;
  color: #fff;
}

.order-status-badge--warning {
  background: #d97706;
  color: #fff;
}

.order-status-badge--success {
  background: #059669;
  color: #fff;
}

.order-status-badge--danger {
  background: #dc2626;
  color: #fff;
}

/* Scrollbar */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Quantity */
.order-qty-cell {
  font-size: 0.8125rem;
  color: var(--ci-text);
  line-height: 1.45;
}

.order-qty-cell__bulk {
  margin-top: 0.15rem;
  font-size: 0.6875rem;
  color: var(--ci-text-muted);
}

/* Deadline */
.order-deadline-cell__date {
  color: var(--ci-text);
  font-size: 0.8125rem;
}

.order-deadline-cell__countdown {
  margin-top: 0.2rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ci-text-muted);
}

.order-deadline-cell__countdown--overdue {
  color: var(--ci-brand);
}

.order-deadline-cell__countdown--done {
  color: #059669;
}

/* Address */
.order-address-cell {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  max-width: 200px;
  font-size: 0.75rem;
  color: var(--ci-text-muted);
  line-height: 1.4;
}

.order-address-cell__icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--ci-text-muted);
}

/* Sample cost */
.col-cost {
  font-weight: 600;
  color: var(--ci-text);
  text-align: right;
  white-space: nowrap;
}

/* Action */
.col-action {
  text-align: right;
  white-space: nowrap;
}

.order-view-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ci-brand);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.order-view-link:hover {
  color: var(--ci-brand-hover);
}

.order-action-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.order-feedback-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: var(--ci-brand);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.order-feedback-link:hover {
  background: var(--ci-brand-hover);
}

.order-action-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.order-bulk-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: #16a34a;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.order-bulk-link:hover {
  background: #15803d;
}

.order-mobile-card__view--bulk {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}

.order-mobile-card__view--bulk:hover {
  background: #15803d;
}

.order-mobile-card__view--feedback {
  background: var(--ci-brand);
  color: #fff;
  border-color: var(--ci-brand);
}

.order-mobile-card__view--feedback:hover {
  background: var(--ci-brand-hover);
}

/* Mobile cards */
.orders-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.order-mobile-card {
  background: #fff;
  border: 1px solid var(--ci-border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--ci-card-shadow);
}

.order-mobile-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.order-mobile-card__product {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.order-mobile-card__meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.order-mobile-card__meta-item {
  background: #f9fafb;
  border: 1px solid var(--ci-border);
  border-radius: 8px;
  padding: 0.5rem 0.625rem;
}

.order-mobile-card__meta-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ci-text-muted);
}

.order-mobile-card__meta-value {
  margin-top: 0.15rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ci-text);
}

.order-mobile-card__address {
  display: flex;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--ci-text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.order-mobile-card__view {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ci-brand);
  background: var(--ci-brand-light);
  border: 1px solid var(--ci-brand-ring);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.order-mobile-card__view:hover {
  background: var(--ci-brand-mid);
}

.orders-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ci-text-muted);
}

.orders-empty__icon {
  margin: 0 auto 0.5rem;
  color: var(--ci-brand);
  opacity: 0.45;
}

.orders-table-error {
  color: #b91c1c;
}
