:root {
  --orders-bg: #fff8cc;
  --orders-yellow: #ffd600;
  --orders-yellow-soft: #fff8cc;
  --orders-yellow-deep: #f4b400;
  --orders-yellow-strong: #ffec6e;
  --orders-blue: #1a3a6b;
  --orders-blue-mid: #2555a0;
  --orders-blue-soft: #e8eff9;
  --orders-text: #1f2937;
  --orders-text-muted: #6b7280;
  --orders-surface: #ffffff;
  --orders-surface-alt: #fffdf2;
  --orders-border: #f3e8a1;
  --orders-shadow: 0 10px 28px rgba(26, 58, 107, 0.08);
}

/* Main Content */
body {
  background: linear-gradient(180deg, #fff8cc 0%, #fffbe0 40%, #ffffff 100%);
  overflow-y: hidden;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0;
}

.main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(1220px, 95%);
  padding: 0 16px 24px;
}

.page-title {
  font-size: 2rem;
  font-weight: bold;
  color: black;
  margin-bottom: 15px;
  text-align: center;
}

.control-container {
  background: linear-gradient(120deg, var(--orders-yellow) 0%, #ffe65f 65%, #ffef99 100%);
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: var(--orders-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  width: 90%;
}

.control-container-left-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-container-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 6px;
  border: 1px solid rgba(26, 58, 107, 0.18);
}

.control-container-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--orders-blue);
}

.order-controls {
  max-width: 560px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.order-search-container {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.order-search-bar {
  width: 100%;
  border: 1px solid rgba(26, 58, 107, 0.2);
  border-radius: 999px;
  padding: 11px 16px 11px 42px;
  font-size: 0.95rem;
  background: #fff;
  transition: all 0.2s ease;
  outline: none;
}

.order-search-bar:focus {
  border-color: var(--orders-blue);
  box-shadow: 0 0 0 3px rgba(26, 58, 107, 0.14);
}

/* Tabs Container */
.order-tabs {
  display: flex;
  justify-content: space-between;
  background: var(--orders-yellow-soft);
  width: 90%; /* Expanded width further */
  padding: 12px 8px;
  border-radius: 14px;
  border: 1px solid var(--orders-border);
  box-shadow: 0 6px 18px rgba(255, 214, 0, 0.18);
  position: relative;
}

.order-tab {
  flex: 1;
  text-align: center;
  font-weight: 700;
  color: var(--orders-text-muted);
  cursor: pointer;
  padding: 10px 8px;
  position: relative;
  transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
  border-radius: 10px;
}

.order-tab:hover {
  color: var(--orders-blue);
  background: rgba(255, 255, 255, 0.45);
}

/* Active Tab Indicator */
.active-indicator {
  position: absolute;
  bottom: 6px;
  height: calc(100% - 12px);
  background: linear-gradient(135deg, var(--orders-yellow) 0%, #ffe65f 100%);
  width: 0; /* Will be set dynamically */
  left: 0;
  border-radius: 10px;
  z-index: 0;
  transition: left 0.3s ease-in-out, width 0.3s ease-in-out;
}

.order-tab.active {
  color: var(--orders-blue);
  z-index: 1;
}

/* .order-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  width: 90%;
  gap: 12px;
  margin-bottom: 25px;
} */

@media (min-width: 800px) {
  .order-controls {
    flex-direction: row;
  }
}

/* .order-search-container {
  display: flex;
  width: 400px;
  align-items: center;

  position: relative;
  border: 2px solid #ccc;
  gap: 10px;
  border-radius: 10px;
} */

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--orders-blue);
  z-index: 1;
}

.date-sort {
  font-size: 0.95rem;
  background: var(--orders-yellow-soft);
  color: var(--orders-blue);
  border: 1px solid rgba(26, 58, 107, 0.12);
  border-radius: 999px;
  padding: 11px 16px;
  box-shadow: 0 4px 12px rgba(26, 58, 107, 0.08);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.date-sort:hover {
  background: var(--orders-yellow);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 214, 0, 0.24);
}

/* Orders Section */
.orders-wrapper {
  background: var(--orders-surface-alt); /* The outer container keeps the visual styling */
  width: 90%;
  padding-top: 30px;
  padding-bottom: 25px;
  padding-left: 30px;
  padding-right: 30px;
  margin-top: 10px;
  border-radius: 20px;
  border: 1px solid #f5edc3;
  box-shadow: 0 6px 18px rgba(255, 214, 0, 0.14);
  text-align: center;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
  height: 63vh; /* Outer container has a fixed height */
  display: flex;
  flex-direction: column;
}

/* Scrollable inner container */
.orders-container {
  opacity: 0;
  transform: translateY(10px); /* start position (slid down) */
  transition: opacity 0.4s ease, transform 0.4s ease;
  height: 58vh;
  overflow-y: auto;
  padding: 10px 0;
  background: none;
}

/* Show: fade in + move up */
.orders-container.show {
  opacity: 1;
  transform: translateY(0);
}

/* Hide: fade out + move down */
.orders-container.hide {
  opacity: 0;
  transform: translateY(10px);
}

.empty-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.empty-state img {
  margin-top: 20px;
  width: 200px;
  height: auto;
  margin-bottom: 20px;
}

.empty-state p {
  font-size: 1.2rem;
  color: var(--orders-text-muted);
}

.order-card {
  background: var(--orders-surface);
  border: 1px solid var(--orders-border);
  border-radius: 14px;
  padding: 10px 20px;
  margin-bottom: 20px;
  text-align: left;
  box-shadow: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.order-card:hover {
  transform: none;
  border-color: #e6c000;
  box-shadow: 0 6px 14px rgba(255, 214, 0, 0.16);
}

.order-card p {
  margin: 6px 0;
  font-size: 0.95rem;
  color: var(--orders-text);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f2e6b0;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.order-header .store-name,
.order-header .order-date {
  margin: 0;
  font-size: 0.95rem;
  color: var(--orders-text-muted);
}

.order-header .order-date span {
  color: var(--orders-text-muted);
  font-weight: normal;
}

.order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  border-top: 1px solid #f2e6b0;
  padding-top: 12px;
}

.order-actions {
  display: flex;
  gap: 12px;
  color: var(--orders-text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.order-actions .edit-icon:hover {
  color: var(--orders-blue); /* blue for edit */
}

.order-actions .delete-icon:hover {
  color: #ff3b30; /* red for delete */
}

.order-total {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--orders-blue);
}

.items-list {
  margin-top: 15px;
}

.item-box {
  display: flex;
  align-items: flex-start;
  background: #fffef8;
  border: 1px solid var(--orders-border);
  border-left: 6px solid var(--orders-yellow-deep);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.item-box p {
  margin: 4px 0;
  font-size: 0.92rem;
  color: var(--orders-text);
}

.item-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--orders-border);
  margin-right: 15px;
  flex-shrink: 0;
}

.item-details {
  flex-grow: 1;
  font-size: 0.9rem;
  color: var(--orders-text);
  display: flex;
  flex-direction: column;
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.product-name {
  margin-bottom: 5px;
  flex: 1;
  min-width: 0;
  word-break: break-word;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* limit to 2 lines */
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unit-price {
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--orders-blue);
  font-weight: 500;
}

.item-attributes {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--orders-text-muted);
}

.item-attributes span {
  background-color: #fff2b3;
  color: var(--orders-blue);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #f2d96d;
}

.delivery-button {
  background: var(--orders-yellow);
  color: var(--orders-blue);
  border: none;
  padding: 8px 15px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(244, 180, 0, 0.25);
  transition: all 0.2s ease-in-out;
}

.delivery-button:hover {
  background: var(--orders-yellow-deep);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(244, 180, 0, 0.35);
}

.delivery-button:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.delete-button {
  background-color: var(--orders-blue);
  color: var(--orders-yellow);
  border: none;
  /* padding: 8px 15px;
  font-size: 0.95rem; */
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(26, 58, 107, 0.16);
  transition: all 0.2s ease-in-out;
}

.delete-button:hover {
  background-color: var(--orders-blue-mid);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(26, 58, 107, 0.22);
}

.delete-button:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.payment-method {
    font-size: 0.95rem;
    margin-top: 8px;
    color: var(--orders-text);
}

@media (max-width: 900px) {
  .control-container,
  .order-controls,
  .order-footer,
  .item-header {
    flex-direction: column;
    align-items: stretch;
  }

  .control-container {
    width: 100%;
    padding: 18px;
  }

  .order-tabs,
  .orders-wrapper {
    width: 100%;
  }

  .date-sort {
    width: 100%;
    text-align: center;
  }
}
