/* === Reset & Base === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Sarabun', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.7;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* === Tab Bar (top navigation) === */
.tab-bar {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}
.tab-bar-inner {
  max-width: 960px;
  margin: 0 auto;
}
.tab-bar-scroll {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  white-space: nowrap;
  padding: 8px 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-bar-scroll::-webkit-scrollbar {
  display: none;
}
.tab-link {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #4a5568;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1.5px solid transparent;
}
.tab-link:hover {
  background: #edf2f7;
  color: #2d3748;
}
.tab-link.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}
.tab-link-logout {
  color: #c53030;
}
.tab-link-logout:hover {
  background: #fff5f5;
  color: #9b2c2c;
}
@media (max-width: 600px) {
  .tab-link {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* === Navbar === */
.navbar {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.navbar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 16px 6px;
}
.navbar-brand {
  font-size: 16px;
  font-weight: 700;
  color: #2d3748;
  text-decoration: none;
  white-space: nowrap;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}
.navbar-links {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.nav-link {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #4a5568;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-link:hover {
  background: #edf2f7;
  color: #2d3748;
}
.nav-link.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}
.nav-link-logout {
  color: #c53030;
}
.nav-link-logout:hover {
  background: #fff5f5;
  color: #9b2c2c;
}
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #2d3748;
  padding: 8px;
  border-radius: 8px;
  position: absolute;
  right: 16px;
  top: 12px;
}
.navbar-toggle:active {
  background: #edf2f7;
}
.navbar-mobile {
  display: none;
  flex-direction: column;
  padding: 8px 16px 12px;
  gap: 4px;
}
.navbar-mobile.open {
  display: flex;
}
.navbar-mobile .nav-link {
  padding: 12px 16px;
  font-size: 15px;
  border-radius: 10px;
}

@media (max-width: 700px) {
  .navbar-inner {
    flex-direction: row;
    justify-content: center;
    position: relative;
  }
  .navbar-links {
    display: none;
  }
  .navbar-toggle {
    display: block;
  }
  .navbar-brand {
    margin-bottom: 0;
  }
}
@media (max-width: 900px) and (min-width: 701px) {
  .navbar-links {
    gap: 2px;
  }
  .nav-link {
    padding: 6px 8px;
    font-size: 12px;
  }
}

/* === Page Container === */
.page {
  max-width: 720px;
  margin: 24px auto;
  padding: 0 12px;
}

/* === Header === */
.header {
  text-align: center;
  padding: 32px 16px 24px;
  background: #fff url('/images/logo.png') no-repeat center center;
  background-size: 160px auto;
  background-blend-mode: soft-light;
  border-radius: 16px 16px 0 0;
  border-bottom: 3px solid #667eea;
  position: relative;
  overflow: hidden;
}
.header::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: url('/images/logo.png') center/contain no-repeat;
  opacity: 0.06;
  pointer-events: none;
}
.header-icon {
  font-size: 40px;
  margin-bottom: 8px;
}
.header h1 {
  font-size: 22px;
  color: #2d3748;
  font-weight: 700;
  margin-bottom: 6px;
}
.header p {
  font-size: 13px;
  color: #718096;
  padding: 0 8px;
}
.order-number-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* === Form Card === */
.form-card {
  background: #fff;
  border-radius: 0 0 16px 16px;
  padding: 24px 16px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

/* === Section === */
.form-section {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid #e2e8f0;
}
.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 20px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.section-title .icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}
.section-title h2 {
  font-size: 20px;
  color: #2d3748;
  font-weight: 600;
}
.section-subtitle {
  font-size: 13px;
  color: #a0aec0;
  margin-top: -14px;
  margin-bottom: 16px;
  padding-left: 46px;
}

/* === Form Groups === */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 6px;
}
.form-group label .required {
  color: #e53e3e;
  margin-left: 2px;
}
.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #f7fafc;
  color: #2d3748;
  -webkit-appearance: none;
  appearance: none;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
  background: #fff;
}
.form-group textarea {
  resize: vertical;
  min-height: 70px;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #a0aec0;
  font-size: 14px;
}

/* === Row (two columns) === */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* === Checkbox / Radio Group === */
.checkbox-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: #f7fafc;
  min-height: 52px;
}
.checkbox-item:hover {
  border-color: #667eea;
  background: #f0f0ff;
}
.checkbox-item:active {
  transform: scale(0.98);
}
.checkbox-item input[type="checkbox"],
.checkbox-item input[type="radio"] {
  width: 22px;
  height: 22px;
  accent-color: #667eea;
  cursor: pointer;
  flex-shrink: 0;
}
.checkbox-item span {
  font-size: 15px;
  color: #2d3748;
  line-height: 1.3;
  font-weight: 500;
}

/* === Quantity Input in Checkbox === */
.checkbox-item.has-qty {
  flex-wrap: wrap;
}
.qty-input {
  width: 100%;
  margin-top: 10px;
  display: none;
}
.checkbox-item.has-qty.selected .qty-input {
  display: block;
}
.pack-select {
  width: 100%;
  margin-top: 10px;
  display: none;
  gap: 16px;
  flex-wrap: wrap;
}
.checkbox-item.has-qty.selected .pack-select {
  display: flex;
}
.pack-select label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #4a5568;
  cursor: pointer;
  padding: 8px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  transition: all 0.2s;
}
.pack-select label:active {
  transform: scale(0.96);
}
.pack-select input[type="radio"] {
  accent-color: #667eea;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* === Price Display === */
.price-display {
  width: 100%;
  margin-top: 8px;
  padding: 6px 12px;
  background: #fed7d7;
  color: #e53e3e;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  display: none;
}
.checkbox-item.has-qty.selected .price-display.show-on-select {
  display: block;
}

/* === Product Warning === */
.product-warning {
  width: 100%;
  margin-top: 6px;
  padding: 6px 12px;
  background: #fefcbf;
  color: #744210;
  border: 1px solid #f6e05e;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: none;
}
.checkbox-item.has-qty.selected .product-warning.show-on-select {
  display: block;
}

/* === Product Image + Warning Row === */
.product-img-warning-row {
  width: 100%;
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.checkbox-item.has-qty.selected .product-img-warning-row {
  display: flex;
}
.product-img-warning-row .product-img-preview {
  margin-top: 0;
  width: auto;
  flex-shrink: 0;
}
.product-img-warning-row .product-warning {
  display: block;
  margin-top: 0;
  width: auto;
  flex: 1;
}
.qty-input input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: #2d3748;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.qty-input input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.checkbox-item.has-qty.selected {
  border-color: #667eea;
  background: #f0f0ff;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

/* === Product Image Preview (on select) === */
.product-img-preview {
  width: 100%;
  display: none;
  margin-top: 10px;
  height: 190px;
  background: transparent;
  border: none;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}
.product-img-preview img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s;
}
.product-img-preview img:hover {
  transform: scale(1.03);
}
.product-img-preview .img-placeholder {
  width: 100%;
  height: 100%;
  background: #edf2f7;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a0aec0;
  font-size: 13px;
}
.checkbox-item.has-img.selected .product-img-preview {
  display: flex;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.btn:active {
  transform: scale(0.96);
}
.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}
.btn-primary:disabled,
.btn-primary.btn-saving {
  opacity: 0.75;
  cursor: wait;
  transform: none;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
  pointer-events: none;
}
.btn-secondary {
  background: #f7fafc;
  color: #4a5568;
  border: 2px solid #e2e8f0;
}
.btn-secondary:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
}
.btn-block {
  width: 100%;
}
.btn-accept {
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: #fff;
  box-shadow: 0 4px 15px rgba(72, 187, 120, 0.35);
}
.btn-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(72, 187, 120, 0.5);
}
.btn-accept:disabled {
  cursor: wait;
  opacity: 0.75;
  transform: none;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(72, 187, 120, 0.25);
}
.btn-ship {
  background: linear-gradient(135deg, #4299e1, #3182ce);
  color: #fff;
  box-shadow: 0 4px 15px rgba(66, 153, 225, 0.35);
}
.btn-ship:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(66, 153, 225, 0.5);
}
.btn-done {
  background: linear-gradient(135deg, #9f7aea, #805ad5);
  color: #fff;
  box-shadow: 0 4px 15px rgba(159, 122, 234, 0.35);
}
.btn-done:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(159, 122, 234, 0.5);
}
.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* === Helper Text === */
.helper-text {
  font-size: 12px;
  color: #a0aec0;
  margin-top: 4px;
}
.note-box {
  background: #fef3cd;
  border: 1px solid #f6e05e;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: #744210;
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.note-box .note-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* === Success Page === */
.success-container {
  text-align: center;
  padding: 60px 40px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.success-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: bounceIn 0.6s ease;
}
@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.success-container h1 {
  font-size: 24px;
  color: #2d3748;
  margin-bottom: 8px;
}
.success-container .order-id {
  font-size: 14px;
  color: #718096;
  margin-bottom: 28px;
}
.success-container .order-id code {
  background: #edf2f7;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
}

/* === Orders Page === */
.orders-header {
  text-align: center;
  padding: 30px 20px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  border-bottom: 3px solid #667eea;
}
.orders-header h1 {
  font-size: 22px;
  color: #2d3748;
}
.orders-body {
  background: #fff;
  border-radius: 0 0 16px 16px;
  padding: 24px 32px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.order-card {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
  transition: border-color 0.2s;
}
.order-card:hover {
  border-color: #667eea;
}
.order-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.order-card-footer {
  margin-top: 10px;
  text-align: right;
}
.view-detail {
  font-size: 13px;
  color: #667eea;
  font-weight: 600;
}

/* === Detail Page === */
.detail-card {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  background: #f7fafc;
}
.detail-meta {
  font-size: 13px;
  color: #718096;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.detail-section {
  margin-bottom: 20px;
}
.detail-section h3 {
  font-size: 16px;
  color: #2d3748;
  margin-bottom: 10px;
}
.detail-table {
  width: 100%;
  font-size: 14px;
  border-collapse: collapse;
}
.detail-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}
.detail-table td:first-child {
  font-weight: 600;
  color: #4a5568;
  width: 180px;
}
.detail-product-group {
  margin-bottom: 10px;
}
.detail-product-group ul {
  padding-left: 20px;
  margin: 4px 0;
}
.detail-product-group ul li {
  font-size: 14px;
  line-height: 1.8;
  color: #4a5568;
}

/* === Summary Grand Total === */
.summary-grand-total {
  margin-top: 20px;
  padding: 16px 20px;
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
}
.summary-total-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: #4a5568;
}
.summary-total-row.grand {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 2px solid #667eea;
}
.summary-total-row.grand strong {
  font-size: 20px;
  color: #667eea;
}

/* === Slip Upload === */
.slip-upload-form {
  margin-top: 8px;
}
.slip-input-wrap {
  margin-bottom: 8px;
}
.slip-preview {
  margin: 10px 0;
}
.slip-preview img {
  max-width: 250px;
  max-height: 300px;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: transform 0.2s;
}
.slip-preview img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* === Price Calculation === */
.price-calc-wrap {
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}
.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 16px;
}
.price-table th,
.price-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}
.price-table th {
  background: #edf2f7;
  font-weight: 600;
  color: #4a5568;
  font-size: 12px;
}
.price-table .price-input {
  width: 80px;
  padding: 6px 8px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  text-align: right;
  font-family: inherit;
}
.price-table .price-input:focus {
  outline: none;
  border-color: #667eea;
}
.item-subtotal {
  font-weight: 600;
  color: #2d3748;
}
.price-summary {
  border-top: 2px solid #e2e8f0;
  padding-top: 14px;
}
.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  gap: 8px;
}
.price-row strong {
  font-size: 16px;
  color: #2d3748;
}
.price-total-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px solid #667eea;
}
.price-total-row strong {
  font-size: 20px;
  color: #667eea;
}

/* === Tracking Page === */
.tracking-card {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
  background: #fff;
}
.tracking-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.tracking-dates {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}
.order-date {
  font-size: 12px;
  color: #718096;
  white-space: nowrap;
}
.order-date-eta {
  color: #2b6cb0;
  font-weight: 600;
}
.tracking-survey-wrap {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
  text-align: center;
}
.tracking-survey-btn {
  width: 100%;
  max-width: 320px;
}
.tracking-survey-done {
  margin: 0 0 10px;
  font-size: 13px;
  color: #276749;
  font-weight: 600;
}
.satisfaction-modal-card {
  max-width: 460px;
  text-align: left;
}
.satisfaction-modal-card h3 {
  text-align: center;
}
.satisfaction-section {
  margin-bottom: 14px;
}
.satisfaction-label {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
}
.satisfaction-choices {
  display: flex;
  gap: 10px;
}
.satisfaction-choice {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #4a5568;
  background: #f7fafc;
}
.satisfaction-choice:has(input:checked) {
  border-color: #667eea;
  background: #edf2ff;
  color: #434190;
  font-weight: 600;
}
.satisfaction-choice input {
  margin: 0;
}
.satisfaction-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  background: #f7fafc;
}
.satisfaction-textarea:focus {
  outline: none;
  border-color: #667eea;
  background: #fff;
}
.tracking-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.tracking-info {
  font-size: 13px;
  color: #718096;
}
.tracking-history-btn {
  width: 100%;
  margin-top: 4px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}
.tracking-survey-wrap + .tracking-survey-wrap {
  margin-top: 8px;
}
.customer-history-modal-card {
  max-width: 560px;
  text-align: left;
}
.customer-history-modal-card h3 {
  text-align: center;
}
.customer-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}
.customer-history-item {
  width: 100%;
  text-align: left;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
  color: #2d3748;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.customer-history-item:hover {
  border-color: #667eea;
  box-shadow: 0 6px 18px rgba(102, 126, 234, 0.12);
  transform: translateY(-1px);
}
.customer-history-main {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
}
.customer-history-status {
  font-size: 12px;
  font-weight: 700;
  color: #5a67d8;
  background: #edf2ff;
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.customer-history-meta {
  font-size: 12px;
  color: #718096;
}
.customer-history-products {
  display: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e0;
  font-size: 13px;
  line-height: 1.6;
  color: #4a5568;
}
.customer-history-item.open .customer-history-products {
  display: block;
}
.customer-history-hint {
  margin-top: 6px;
  font-size: 11px;
  color: #a0aec0;
}
@media (max-width: 600px) {
  .tracking-card-body {
    align-items: flex-start;
    flex-direction: column;
  }
}
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.status-pending { background: #fef3cd; color: #744210; }
.status-preparing { background: #bee3f8; color: #2a4365; }
.status-shipped { background: #c6f6d5; color: #22543d; }
.status-delivered { background: #e9d8fd; color: #44337a; }
.status-cancelled { background: #fed7d7; color: #9b2c2c; }
/* จัดสินค้า — สีสถานะเฉพาะหน้านี้ */
.status-prepare-print { background: #fed7d7; color: #c53030; }
.status-prepare-done { background: #c6f6d5; color: #22543d; }

/* === Prepare page (จัดสินค้า) === */
.prepare-page {
  max-width: 720px;
  margin: 0 auto;
}
.prepare-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.prepare-summary-count {
  font-size: 15px;
  color: #4a5568;
}
.prepare-summary-count strong {
  color: #c05621;
  font-size: 18px;
}
.prepare-summary-chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.prepare-summary-chip--print {
  background: #fed7d7;
  color: #9b2c2c;
}
.prepare-summary-chip--done {
  background: #c6f6d5;
  color: #22543d;
}
.prepare-page-hint {
  font-size: 13px;
  color: #a0aec0;
  margin: 0 0 18px;
}
.prepare-card {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.prepare-card:hover {
  border-color: #ed8936;
  box-shadow: 0 6px 20px rgba(237, 137, 54, 0.15);
}
.prepare-card--prepare-print {
  border-left: 5px solid #fc8181;
}
.prepare-card--prepare-done {
  border-left: 5px solid #48bb78;
  opacity: 0.92;
}
.prepare-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.prepare-order-number {
  font-size: 20px;
  font-weight: 700;
  color: #1a365d;
  letter-spacing: 0.02em;
}
.prepare-customer-name {
  font-size: 17px;
  font-weight: 600;
  color: #2d3748;
  margin-top: 4px;
}
.prepare-status-badge {
  font-size: 12px;
  padding: 6px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}
.prepare-delivery-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(90deg, #fff5eb, #fef3e2);
  border: 1.5px solid #fbd38d;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.prepare-delivery-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.prepare-countdown {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin-left: auto;
  padding: 6px 10px;
  background: #fff;
  border: 1.5px solid #f6ad55;
  border-radius: 8px;
  min-width: 120px;
}
.prepare-countdown-label {
  font-size: 11px;
  font-weight: 600;
  color: #c05621;
  white-space: nowrap;
}
.prepare-countdown-value {
  font-size: 16px;
  font-weight: 700;
  color: #9c4221;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.prepare-countdown--urgent .prepare-countdown-value {
  color: #c53030;
}
.prepare-countdown--overdue {
  border-color: #fc8181;
  background: #fff5f5;
}
.prepare-countdown--overdue .prepare-countdown-value {
  color: #c53030;
}
.prepare-delivery-label {
  font-size: 13px;
  font-weight: 600;
  color: #c05621;
}
.prepare-delivery-date {
  font-size: 20px;
  font-weight: 700;
  color: #9c4221;
}
.prepare-section-label {
  font-size: 12px;
  font-weight: 700;
  color: #a0aec0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.prepare-product-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.prepare-product-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f7fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 0;
}
.prepare-product-emoji {
  font-size: 18px;
  line-height: 1;
}
.prepare-product-name {
  font-size: 15px;
  font-weight: 600;
  color: #2d3748;
}
.prepare-product-qty {
  font-size: 18px;
  font-weight: 700;
  color: #c05621;
  margin-left: 2px;
}
.prepare-product-item--change {
  border-color: #f6ad55;
  background: #fffaf0;
}
.prepare-product-item--free {
  border-color: #90cdf4;
  background: #ebf8ff;
}
.prepare-note {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fffff0;
  border: 1px solid #f6e05e;
  border-radius: 8px;
  font-size: 14px;
  color: #744210;
  line-height: 1.5;
}
.prepare-note-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #d69e2e;
  margin-bottom: 4px;
}
.prepare-shipping-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1.5px dashed #e2e8f0;
}
.prepare-shipping-icon {
  font-size: 20px;
}
.prepare-shipping-text {
  font-size: 15px;
  font-weight: 600;
  color: #2c5282;
}
@media (max-width: 480px) {
  .prepare-card-head {
    flex-direction: column;
    align-items: stretch;
  }
  .prepare-status-badge {
    align-self: flex-start;
  }
  .prepare-order-number {
    font-size: 18px;
  }
  .prepare-delivery-date {
    font-size: 18px;
  }
  .prepare-countdown {
    width: 100%;
    align-items: center;
    margin-left: 0;
  }
  .prepare-product-item {
    flex: 1 1 100%;
  }
}

/* Tracking Steps */
.tracking-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  padding-top: 8px;
}
.tracking-steps::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: #e2e8f0;
  z-index: 0;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 1;
  flex: 1;
}
.step-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e2e8f0;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #e2e8f0;
  transition: all 0.3s;
}
.step.active .step-dot {
  background: #667eea;
  box-shadow: 0 0 0 2px #667eea;
}
.step span {
  font-size: 11px;
  color: #a0aec0;
  text-align: center;
}
.step.active span {
  color: #2d3748;
  font-weight: 600;
}
.step-clickable {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}
.step-clickable:hover .step-dot,
.step-clickable:focus-visible .step-dot {
  transform: scale(1.15);
  box-shadow: 0 0 0 3px #4299e1;
}
.step-clickable:hover span,
.step-clickable:focus-visible span {
  color: #2b6cb0;
  text-decoration: underline;
}
.shipping-slip-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.shipping-slip-modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}
.shipping-slip-modal-card h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: #2d3748;
}
.shipping-slip-image {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  cursor: zoom-in;
  object-fit: contain;
}
.order-card .order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.order-card .order-card-header strong {
  font-size: 15px;
  color: #2d3748;
}
.order-card .order-card-header .order-date {
  font-size: 12px;
  color: #a0aec0;
}
.order-card .order-card-detail {
  font-size: 13px;
  color: #718096;
  line-height: 1.6;
}
.empty-state {
  text-align: center;
  padding: 40px;
  color: #a0aec0;
}
.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* === Dashboard === */
.page-dashboard {
  max-width: 1080px;
}
.orders-header-dashboard {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-bottom: none;
  color: #fff;
  padding: 28px 24px 24px;
}
.orders-header-dashboard h1 {
  color: #fff;
  font-size: 24px;
  margin-bottom: 4px;
}
.orders-header-sub {
  font-size: 14px;
  opacity: 0.9;
  margin: 0;
}

.dashboard-top {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  margin-bottom: 20px;
  align-items: stretch;
}
.stat-card-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 100%;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
}
.stat-hero-icon {
  font-size: 36px;
  line-height: 1;
}
.stat-hero-text .stat-number {
  font-size: 36px;
}
.dashboard-section-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 20px;
}
.dashboard-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.dashboard-section-head h3 {
  margin-bottom: 0;
}
.dashboard-clear-filter {
  font-size: 12px;
  color: #667eea;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #c3dafe;
  white-space: nowrap;
}
.dashboard-clear-filter:hover {
  background: #ebf4ff;
}
.dashboard-count-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #667eea;
  background: #ebf4ff;
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
}

.dashboard-orders-head {
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.dashboard-orders-head h3 {
  margin-bottom: 0;
}
.dashboard-date-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dashboard-date-label {
  font-size: 13px;
  font-weight: 600;
  color: #4a5568;
  white-space: nowrap;
}
.dashboard-date-input {
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 10px;
  background: #fff;
  color: #2d3748;
  min-width: 150px;
}
.dashboard-date-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.dashboard-date-btn {
  font-size: 12px;
  font-weight: 600;
  color: #667eea;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #c3dafe;
  white-space: nowrap;
}
.dashboard-date-btn:hover {
  background: #ebf4ff;
}
.dashboard-date-btn-muted {
  color: #718096;
  border-color: #e2e8f0;
}
.dashboard-date-btn-muted:hover {
  background: #f7fafc;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.stat-card {
  padding: 20px 16px;
  border-radius: 12px;
  text-align: center;
  color: #fff;
}
.stat-card.stat-purple { background: linear-gradient(135deg, #667eea, #764ba2); }
.stat-card.stat-blue { background: linear-gradient(135deg, #4299e1, #3182ce); }
.stat-card.stat-green { background: linear-gradient(135deg, #48bb78, #38a169); }
.stat-card.stat-orange { background: linear-gradient(135deg, #ed8936, #dd6b20); }
.stat-number {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 12px;
  opacity: 0.9;
}

.dashboard-section {
  margin-bottom: 20px;
}
.dashboard-section h3 {
  font-size: 16px;
  color: #2d3748;
  margin-bottom: 14px;
  font-weight: 600;
}

/* Status grid cards */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.status-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.status-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
.status-card.active {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}
.status-card-icon {
  font-size: 22px;
  line-height: 1;
}
.status-card-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  color: #4a5568;
}
.status-card-count {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.status-card-pending { border-top: 3px solid #d69e2e; }
.status-card-pending .status-card-count { color: #b7791f; }
.status-card-preparing { border-top: 3px solid #4299e1; }
.status-card-preparing .status-card-count { color: #2b6cb0; }
.status-card-shipped { border-top: 3px solid #48bb78; }
.status-card-shipped .status-card-count { color: #276749; }
.status-card-delivered { border-top: 3px solid #9f7aea; }
.status-card-delivered .status-card-count { color: #6b46c1; }
.status-card-cancelled { border-top: 3px solid #fc8181; }
.status-card-cancelled .status-card-count { color: #c53030; }

/* Status Overview (legacy) */
.status-overview {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f7fafc;
}

/* Dashboard Table */
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.theme-summary .table-wrap {
  overflow: visible;
}
.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dashboard-table th,
.dashboard-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.dashboard-table th {
  background: #f7fafc;
  font-weight: 600;
  color: #4a5568;
  font-size: 12px;
  text-transform: uppercase;
}
.dashboard-table tr:hover td {
  background: #f0f0ff;
}
.summary-actions-col {
  width: 52px;
  text-align: right;
  padding-right: 8px !important;
  position: relative;
  overflow: visible;
}
.kebab-menu {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}
.kebab-toggle {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  transition: background 0.15s ease;
}
.kebab-toggle:hover,
.kebab-menu.open .kebab-toggle {
  background: #edf2f7;
}
.kebab-toggle span {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #4a5568;
}
.kebab-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 240px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.06);
  padding: 6px 0;
  z-index: 40;
  text-align: left;
}
.kebab-menu.open .kebab-panel {
  display: block;
}
.kebab-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: #2d3748;
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
}
.kebab-item:hover,
.kebab-item:focus-visible {
  background: #f7fafc;
  outline: none;
}
.kebab-icon {
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.kebab-label {
  flex: 1;
  line-height: 1.3;
}
.kebab-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}
.kebab-form {
  margin: 0;
}
.table-link {
  color: #667eea;
  font-weight: 600;
  text-decoration: none;
  font-size: 12px;
}
.table-link:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .dashboard-top {
    grid-template-columns: 1fr;
  }
  .stat-card-hero {
    flex-direction: row;
    padding: 16px 24px;
    gap: 16px;
  }
  .dashboard-orders-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .dashboard-date-filter {
    width: 100%;
  }
  .dashboard-date-input {
    flex: 1;
  }
}

/* === Responsive === */
@media (max-width: 700px) {
  .page {
    margin: 12px auto;
    padding: 0 8px;
  }
  .form-card {
    padding: 20px 14px 28px;
    border-radius: 0 0 12px 12px;
  }
  .header {
    padding: 24px 14px 20px;
    border-radius: 12px 12px 0 0;
  }
  .header h1 {
    font-size: 20px;
  }
  .header p {
    font-size: 12px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .checkbox-group {
    grid-template-columns: 1fr;
  }
  .btn-group {
    flex-direction: column;
  }
  .btn {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
  }
  .section-title h2 {
    font-size: 18px;
  }
  .section-subtitle {
    padding-left: 0;
    margin-top: -8px;
  }
  .form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
  }
  .product-category {
    padding: 14px;
    margin-bottom: 16px;
  }
  .category-title {
    font-size: 14px;
  }
  .success-container {
    padding: 32px 20px;
  }
}

@media (min-width: 701px) {
  .checkbox-group {
    grid-template-columns: 1fr 1fr;
  }
  .form-card {
    padding: 28px 32px 36px;
  }
}

/* === Print === */
@media print {
  body { background: white; }
  .page { margin: 0; padding: 0; }
  .btn, .btn-group { display: none; }
  .form-card { box-shadow: none; }
}

/* === Info Button === */
.btn-info {
  background: #ebf4ff;
  color: #3182ce;
  border: 2px solid #bee3f8;
  margin-bottom: 16px;
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  border-radius: 12px;
}
.btn-info:hover {
  background: #bee3f8;
  border-color: #90cdf4;
}
.btn-info:active {
  transform: scale(0.97);
}

/* === View Image Button === */
.btn-view-img {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.2s;
  margin-left: auto;
  flex-shrink: 0;
}
.btn-view-img:hover {
  background: #e2e8f0;
}

/* === Lightbox === */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}
.lightbox-content {
  background: #fff;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  padding: 20px;
  text-align: center;
  position: relative;
}
.lightbox-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 28px;
  color: #a0aec0;
  cursor: pointer;
}
.lightbox-close:hover {
  color: #e53e3e;
}
.lightbox-img-wrap {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 350px;
  border-radius: 10px;
  object-fit: contain;
}
.lightbox-placeholder {
  padding: 40px;
  font-size: 16px;
  color: #4a5568;
  text-align: center;
  line-height: 2;
}
.lightbox-caption {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #2d3748;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 99999;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  margin-top: 8px;
  margin-bottom: 16px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  z-index: 1;
}
.modal-header h2 {
  font-size: 20px;
  color: #2d3748;
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #a0aec0;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover {
  color: #e53e3e;
}
.modal-body {
  padding: 24px 28px;
}
.modal-section {
  margin-bottom: 28px;
}
.modal-section h3 {
  font-size: 16px;
  color: #2d3748;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid #667eea;
  display: inline-block;
}
.modal-footer {
  padding: 16px 28px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

/* === Modal Table === */
.modal-table-wrap {
  overflow-x: auto;
}
.modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.modal-table th,
.modal-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}
.modal-table th {
  background: #f7fafc;
  font-weight: 600;
  color: #4a5568;
}
.modal-table tr:hover td {
  background: #f0f0ff;
}

/* === Product Images Grid === */
.product-images-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.product-image-card {
  text-align: center;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #f7fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.product-image-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}
.product-image-placeholder {
  font-size: 36px;
  margin-bottom: 6px;
}
.product-image-card p {
  font-size: 13px;
  font-weight: 500;
  color: #2d3748;
  margin: 0;
}

@media (max-width: 600px) {
  .product-images-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .modal-content {
    max-height: 90vh;
  }
  .modal-body {
    padding: 16px 18px;
  }
}

/* === Product Categories === */
.product-category {
  margin-bottom: 20px;
  padding: 16px;
  background: #f8faff;
  border-radius: 14px;
  border: 1px solid #e8ecf4;
}
.category-title {
  font-size: 15px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
  line-height: 1.5;
}

/* === File Input === */
.file-input {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 2px dashed #cbd5e0;
  border-radius: 10px;
  background: #f7fafc;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s;
  font-family: inherit;
  color: #4a5568;
}
.file-input:hover {
  border-color: #667eea;
  background: #f0f0ff;
}

/* === Image Preview === */
.image-preview {
  margin-top: 10px;
  border-radius: 8px;
  overflow: hidden;
}
.image-preview img {
  max-width: 200px;
  max-height: 150px;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  object-fit: cover;
}

/* === Shipping Cards === */
.shipping-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.shipping-card {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  background: #f7fafc;
}
.shipping-card:hover {
  border-color: #667eea;
}
.shipping-card:active {
  transform: scale(0.98);
}
.shipping-card.active {
  border-color: #667eea;
  background: #f0f0ff;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}
.shipping-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
}
.shipping-card-header input[type="checkbox"],
.shipping-card-header input[type="radio"] {
  width: 22px;
  height: 22px;
  accent-color: #667eea;
  cursor: pointer;
  flex-shrink: 0;
}
.shipping-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #2d3748;
}
.shipping-card-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 18px;
  background: #eef2ff;
  border-top: 1px solid transparent;
}
.shipping-card.active .shipping-card-detail {
  max-height: 200px;
  padding: 12px 18px;
  border-top: 1px solid #e2e8f0;
}
.shipping-card-detail ul {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}
.shipping-card-detail ul li {
  font-size: 13px;
  color: #4a5568;
  line-height: 1.8;
}

/* === Order Summary === */
.order-summary {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  background: #f7fafc;
  min-height: 80px;
}
.summary-empty {
  text-align: center;
  color: #a0aec0;
  font-size: 14px;
  padding: 20px 0;
}
.summary-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.summary-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
  font-size: 14px;
}
.summary-table thead th {
  background: #edf2f7;
  color: #2d3748;
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.summary-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
  color: #4a5568;
  vertical-align: top;
}
.summary-table tbody tr:last-child td {
  border-bottom: none;
}
.summary-col-no {
  width: 56px;
  text-align: center;
  font-weight: 600;
  color: #5a67d8;
}
.summary-col-name {
  font-weight: 600;
  color: #2d3748;
  min-width: 120px;
}
.summary-col-pack {
  min-width: 110px;
}
.summary-col-qty {
  width: 72px;
  text-align: center;
  font-weight: 700;
  color: #2b6cb0;
}
.summary-col-price {
  min-width: 120px;
  white-space: nowrap;
}
.summary-unit-price {
  color: #718096;
  font-size: 12px;
}
.summary-line-total {
  margin-top: 2px;
  font-weight: 700;
  color: #2d3748;
}
.summary-total-box {
  margin-top: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: #2d3748;
}
.summary-total-row strong {
  font-size: 18px;
  color: #5a67d8;
  white-space: nowrap;
}
.summary-note {
  margin: 8px 0 0;
  font-size: 13px;
  color: #c05621;
  background: #fffaf0;
  border: 1px solid #fbd38d;
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.5;
}
.summary-shipping {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #4a5568;
}
.shipping-schedule-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 4px 0 18px;
  padding: 16px 20px;
  border: 2px solid #f6ad55;
  border-radius: 14px;
  background: linear-gradient(135deg, #fffaf0, #feebc8);
  color: #9c4221;
  box-shadow: 0 6px 18px rgba(221, 107, 32, 0.18);
  text-align: left;
}
.shipping-schedule-icon {
  font-size: 30px;
  line-height: 1;
}
.shipping-schedule-note strong {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
}
.shipping-schedule-days {
  display: block;
  color: #c05621;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
@media (max-width: 600px) {
  .shipping-schedule-note {
    justify-content: flex-start;
    padding: 14px 16px;
  }
  .shipping-schedule-days {
    font-size: 17px;
  }
}
.summary-content {
  font-size: 14px;
  line-height: 1.8;
}
.summary-section {
  margin-bottom: 6px;
}
.summary-item {
  padding-left: 24px;
  color: #4a5568;
  font-size: 13px;
}
.summary-list {
  padding-left: 24px;
  margin: 6px 0 10px;
  counter-reset: none;
}
.summary-list li {
  font-size: 14px;
  color: #4a5568;
  line-height: 2;
  padding-left: 4px;
}
.summary-total {
  margin-top: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
}

@media (max-width: 600px) {
  .order-summary {
    padding: 12px;
  }
  .summary-table {
    font-size: 13px;
  }
  .summary-table thead th,
  .summary-table tbody td {
    padding: 8px 10px;
  }
}

/* === Price Tag === */
.price-tag {
  color: #e53e3e;
  font-weight: 600;
  font-size: 12px;
  margin-left: 4px;
}

/* === Pack Info (beside product name) === */
.pack-info {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: #718096;
  background: #edf2f7;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* === Home Menu Dashboard === */
body.home-body {
  --home-bg-1: #d8f3e4;
  --home-bg-2: #e8f0ff;
  --home-bg-3: #fff8e8;
  --home-bg-4: #f0e9ff;
  background:
    radial-gradient(ellipse 90% 60% at 8% 12%, rgba(72, 187, 120, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 92% 8%, rgba(102, 126, 234, 0.22), transparent 50%),
    radial-gradient(ellipse 80% 55% at 78% 88%, rgba(237, 137, 54, 0.16), transparent 55%),
    radial-gradient(ellipse 60% 45% at 12% 85%, rgba(56, 178, 172, 0.18), transparent 50%),
    linear-gradient(155deg, var(--home-bg-1) 0%, var(--home-bg-2) 38%, var(--home-bg-3) 72%, var(--home-bg-4) 100%);
  background-size: 140% 140%;
  background-attachment: fixed;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  animation: homeBgDrift 18s ease-in-out infinite alternate;
}
@keyframes homeBgDrift {
  0% { background-position: 0% 40%, 100% 0%, 80% 100%, 0% 100%, 0% 0%; }
  100% { background-position: 20% 0%, 70% 30%, 40% 70%, 30% 80%, 100% 100%; }
}
body.home-body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.45;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(45, 55, 72, 0.08) 1px, transparent 0);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.15) 70%, transparent);
  animation: festPatternShift 22s linear infinite;
}
body.home-body::after {
  content: '';
  position: fixed;
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  right: -12%;
  top: 18%;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.08) 45%, transparent 70%);
  filter: blur(2px);
  animation: homeGlowDrift 8s ease-in-out infinite alternate;
}
@keyframes homeGlowDrift {
  0% { transform: translate(0, 0) scale(1); opacity: 0.55; }
  100% { transform: translate(-12%, 10%) scale(1.18); opacity: 1; }
}
body.home-body > .tab-bar,
body.home-body > .home-page {
  position: relative;
  z-index: 2;
}

/* === แอนิเมชันธีมเทศกาล === */
.home-fest-fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.home-fest-particle {
  position: absolute;
  left: var(--fx-left, 50%);
  font-size: var(--fx-size, 22px);
  line-height: 1;
  opacity: var(--fx-opacity, 0.85);
  color: rgba(45, 55, 72, 0.55);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.12));
  will-change: transform, opacity;
  animation-duration: var(--fx-duration, 8s);
  animation-delay: var(--fx-delay, 0s);
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
  user-select: none;
}
.home-fest-particle--rise {
  bottom: -10%;
  animation-name: festRise;
}
.home-fest-particle--fall {
  top: -10%;
  animation-name: festFall;
}
.home-fest-particle--float {
  top: var(--fx-top, 40%);
  animation-name: festFloat;
}
.home-fest-particle--drift {
  top: var(--fx-top, 30%);
  animation-name: festDrift;
}
.home-fest-particle--bubble {
  bottom: -8%;
  animation-name: festBubble;
}
.home-fest-blob {
  position: absolute;
  left: var(--fx-left, 20%);
  top: var(--fx-top, 30%);
  width: min(340px, 45vw);
  height: min(340px, 45vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 70%);
  transform: scale(var(--fx-scale, 1));
  filter: blur(8px);
  animation: festBlobPulse var(--fx-duration, 14s) ease-in-out var(--fx-delay, 0s) infinite alternate;
  opacity: 0.55;
}
@keyframes festRise {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(0.7); opacity: 0; }
  12% { opacity: var(--fx-opacity, 0.8); }
  100% { transform: translate3d(var(--fx-drift, 20px), -115vh, 0) rotate(var(--fx-rotate, 15deg)) scale(1.1); opacity: 0; }
}
@keyframes festFall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  10% { opacity: var(--fx-opacity, 0.85); }
  100% { transform: translate3d(var(--fx-drift, -20px), 115vh, 0) rotate(var(--fx-rotate, -20deg)); opacity: 0; }
}
@keyframes festFloat {
  0% { transform: translate3d(0, 0, 0) scale(0.85) rotate(0deg); opacity: 0.25; }
  35% { transform: translate3d(var(--fx-drift, 40px), -90px, 0) scale(1.15) rotate(12deg); opacity: var(--fx-opacity, 0.9); }
  70% { transform: translate3d(calc(var(--fx-drift, 40px) * -0.8), 50px, 0) scale(1) rotate(-8deg); opacity: 0.7; }
  100% { transform: translate3d(calc(var(--fx-drift, 40px) * 0.3), -20px, 0) scale(0.9) rotate(0deg); opacity: 0.2; }
}
@keyframes festDrift {
  0% { transform: translate3d(-20vw, 10px, 0) rotate(0deg) scale(0.8); opacity: 0; }
  15% { opacity: var(--fx-opacity, 0.9); }
  50% { transform: translate3d(10vw, -40px, 0) rotate(12deg) scale(1.1); }
  100% { transform: translate3d(45vw, 20px, 0) rotate(var(--fx-rotate, -12deg)) scale(0.95); opacity: 0; }
}
@keyframes festBubble {
  0% { transform: translate3d(0, 0, 0) scale(0.5); opacity: 0; }
  15% { opacity: var(--fx-opacity, 0.75); }
  100% { transform: translate3d(var(--fx-drift, 18px), -110vh, 0) scale(1.2); opacity: 0; }
}
@keyframes festBlobPulse {
  0% { transform: scale(var(--fx-scale, 1)) translate(0, 0); opacity: 0.35; }
  100% { transform: scale(calc(var(--fx-scale, 1) * 1.15)) translate(12px, -16px); opacity: 0.65; }
}

/* ธีมเฉพาะ — สี blob / ความเข้ม */
body.home-fest-newyear .home-fest-blob {
  background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, rgba(255, 82, 82, 0.08) 55%, transparent 70%);
}
body.home-fest-valentine .home-fest-blob {
  background: radial-gradient(circle, rgba(244, 63, 94, 0.28) 0%, rgba(236, 72, 153, 0.08) 55%, transparent 70%);
}
body.home-fest-songkran .home-fest-blob {
  background: radial-gradient(circle, rgba(3, 169, 244, 0.32) 0%, rgba(0, 188, 212, 0.1) 55%, transparent 70%);
}
body.home-fest-mother .home-fest-blob {
  background: radial-gradient(circle, rgba(186, 104, 200, 0.3) 0%, rgba(233, 30, 99, 0.08) 55%, transparent 70%);
}
body.home-fest-halloween .home-fest-blob {
  background: radial-gradient(circle, rgba(255, 145, 0, 0.28) 0%, rgba(103, 58, 183, 0.15) 55%, transparent 70%);
}
body.home-fest-loykrathong .home-fest-blob {
  background: radial-gradient(circle, rgba(255, 193, 7, 0.35) 0%, rgba(63, 81, 181, 0.1) 55%, transparent 70%);
}
body.home-fest-father .home-fest-blob {
  background: radial-gradient(circle, rgba(33, 150, 243, 0.3) 0%, rgba(63, 81, 181, 0.1) 55%, transparent 70%);
}
body.home-fest-christmas .home-fest-blob {
  background: radial-gradient(circle, rgba(76, 175, 80, 0.28) 0%, rgba(244, 67, 54, 0.1) 55%, transparent 70%);
}
body.home-fest-default .home-fest-blob {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, rgba(72, 187, 120, 0.12) 50%, transparent 70%);
}

body.home-body.home-fest-newyear::before,
body.home-body.home-fest-songkran::before,
body.home-body.home-fest-christmas::before,
body.home-body.home-fest-loykrathong::before {
  animation: festPatternShift 18s linear infinite;
}
@keyframes festPatternShift {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 80px 120px, -40px 60px; }
}

.home-festival-badge {
  animation: festBadgeIn 0.55s ease both;
}
@keyframes festBadgeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.home-menu-grid .home-menu-card {
  animation: festCardIn 0.55s ease both;
}
.home-menu-grid .home-menu-card:nth-child(1) { animation-delay: 0.05s; }
.home-menu-grid .home-menu-card:nth-child(2) { animation-delay: 0.1s; }
.home-menu-grid .home-menu-card:nth-child(3) { animation-delay: 0.15s; }
.home-menu-grid .home-menu-card:nth-child(4) { animation-delay: 0.2s; }
.home-menu-grid .home-menu-card:nth-child(5) { animation-delay: 0.25s; }
@keyframes festCardIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .home-fest-particle,
  .home-fest-blob,
  body.home-body,
  body.home-body::before,
  body.home-body::after,
  .home-page::before,
  .home-festival-badge,
  .home-menu-grid .home-menu-card {
    animation: none !important;
  }
  .home-fest-fx { display: none; }
}

/* === ธีมเทศกาลหน้าหลัก === */
body.home-body.home-fest-newyear {
  --home-bg-1: #ffe8a3;
  --home-bg-2: #ffd6e7;
  --home-bg-3: #fff5d6;
  --home-bg-4: #ffe0b2;
  background:
    radial-gradient(ellipse 80% 55% at 15% 10%, rgba(255, 215, 0, 0.45), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 15%, rgba(255, 82, 82, 0.28), transparent 50%),
    radial-gradient(ellipse 75% 50% at 70% 90%, rgba(255, 193, 7, 0.3), transparent 55%),
    linear-gradient(155deg, var(--home-bg-1), var(--home-bg-2) 40%, var(--home-bg-3) 70%, var(--home-bg-4));
}
body.home-body.home-fest-newyear::before {
  background-image:
    radial-gradient(circle at 2px 2px, rgba(255, 193, 7, 0.35) 1.5px, transparent 0);
  background-size: 26px 26px;
  opacity: 0.55;
}

body.home-body.home-fest-valentine {
  --home-bg-1: #ffe4ec;
  --home-bg-2: #ffd1dc;
  --home-bg-3: #fff0f5;
  --home-bg-4: #f8d7e8;
  background:
    radial-gradient(ellipse 80% 55% at 20% 15%, rgba(244, 63, 94, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 20%, rgba(236, 72, 153, 0.22), transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 90%, rgba(251, 113, 133, 0.2), transparent 55%),
    linear-gradient(155deg, var(--home-bg-1), var(--home-bg-2) 45%, var(--home-bg-3));
}
body.home-body.home-fest-valentine::before {
  background-image:
    radial-gradient(circle at 50% 40%, rgba(244, 63, 94, 0.18) 0 4px, transparent 5px);
  background-size: 32px 28px;
  opacity: 0.5;
}

body.home-body.home-fest-songkran {
  --home-bg-1: #c8f1ff;
  --home-bg-2: #b3e5fc;
  --home-bg-3: #e0f7fa;
  --home-bg-4: #bbdefb;
  background:
    radial-gradient(ellipse 85% 55% at 10% 20%, rgba(3, 169, 244, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 10%, rgba(0, 188, 212, 0.28), transparent 50%),
    radial-gradient(ellipse 75% 50% at 60% 90%, rgba(33, 150, 243, 0.22), transparent 55%),
    linear-gradient(160deg, var(--home-bg-1), var(--home-bg-2) 40%, var(--home-bg-3));
}
body.home-body.home-fest-songkran::before {
  background-image:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.55) 0 3px, transparent 4px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,0.4) 0 2px, transparent 3px);
  background-size: 40px 40px, 28px 28px;
  opacity: 0.65;
}

body.home-body.home-fest-labour {
  --home-bg-1: #fff3e0;
  --home-bg-2: #ffe0b2;
  --home-bg-3: #fff8e1;
  --home-bg-4: #ffecb3;
  background:
    radial-gradient(ellipse 80% 55% at 15% 15%, rgba(255, 152, 0, 0.3), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 25%, rgba(255, 87, 34, 0.18), transparent 50%),
    linear-gradient(155deg, var(--home-bg-1), var(--home-bg-2) 50%, var(--home-bg-3));
}

body.home-body.home-fest-mother {
  --home-bg-1: #f3e5f5;
  --home-bg-2: #e1bee7;
  --home-bg-3: #fce4ec;
  --home-bg-4: #f8bbd0;
  background:
    radial-gradient(ellipse 80% 55% at 18% 12%, rgba(156, 39, 176, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 88% 18%, rgba(233, 30, 99, 0.18), transparent 50%),
    radial-gradient(ellipse 70% 50% at 40% 90%, rgba(186, 104, 200, 0.2), transparent 55%),
    linear-gradient(155deg, var(--home-bg-1), var(--home-bg-2) 45%, var(--home-bg-3));
}

body.home-body.home-fest-halloween {
  --home-bg-1: #2d1b4e;
  --home-bg-2: #3d2066;
  --home-bg-3: #1a1028;
  --home-bg-4: #4a148c;
  background:
    radial-gradient(ellipse 80% 55% at 20% 15%, rgba(255, 145, 0, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 20%, rgba(156, 39, 176, 0.35), transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 90%, rgba(255, 87, 34, 0.2), transparent 55%),
    linear-gradient(155deg, var(--home-bg-1), var(--home-bg-2) 45%, var(--home-bg-3));
  color: #f7fafc;
}
body.home-body.home-fest-halloween .home-brand,
body.home-body.home-fest-halloween .home-title,
body.home-body.home-fest-halloween .home-subtitle {
  color: #fff8e7;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
body.home-body.home-fest-halloween::before {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 152, 0, 0.25) 1px, transparent 0);
  background-size: 24px 24px;
  opacity: 0.5;
}

body.home-body.home-fest-loykrathong {
  --home-bg-1: #e3f2fd;
  --home-bg-2: #fff3e0;
  --home-bg-3: #e8eaf6;
  --home-bg-4: #ffe0b2;
  background:
    radial-gradient(ellipse 80% 55% at 20% 20%, rgba(255, 193, 7, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 15%, rgba(63, 81, 181, 0.2), transparent 50%),
    radial-gradient(ellipse 75% 50% at 55% 90%, rgba(255, 152, 0, 0.22), transparent 55%),
    linear-gradient(160deg, var(--home-bg-1), var(--home-bg-2) 45%, var(--home-bg-3));
}
body.home-body.home-fest-loykrathong::before {
  background-image:
    radial-gradient(circle at 50% 50%, rgba(255, 213, 79, 0.45) 0 2px, transparent 3px);
  background-size: 34px 34px;
  opacity: 0.55;
}

body.home-body.home-fest-father {
  --home-bg-1: #e3f2fd;
  --home-bg-2: #bbdefb;
  --home-bg-3: #e8eaf6;
  --home-bg-4: #c5cae9;
  background:
    radial-gradient(ellipse 80% 55% at 15% 15%, rgba(25, 118, 210, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 20%, rgba(63, 81, 181, 0.22), transparent 50%),
    linear-gradient(155deg, var(--home-bg-1), var(--home-bg-2) 45%, var(--home-bg-3));
}

body.home-body.home-fest-christmas {
  --home-bg-1: #e8f5e9;
  --home-bg-2: #ffebee;
  --home-bg-3: #f1f8e9;
  --home-bg-4: #ffcdd2;
  background:
    radial-gradient(ellipse 80% 55% at 15% 15%, rgba(46, 125, 50, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 88% 18%, rgba(198, 40, 40, 0.22), transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 90%, rgba(255, 235, 59, 0.18), transparent 55%),
    linear-gradient(155deg, var(--home-bg-1), var(--home-bg-2) 45%, var(--home-bg-3));
}
body.home-body.home-fest-christmas::before {
  background-image:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.7) 0 1.5px, transparent 2px);
  background-size: 22px 22px;
  opacity: 0.55;
}

.home-festival-badge {
  display: none;
  justify-content: center;
  margin: -12px auto 20px;
  max-width: max-content;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #4a5568;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 14px rgba(45, 55, 72, 0.08);
  backdrop-filter: blur(6px);
}
body.home-body[data-festival-label] .home-festival-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
body.home-body.home-fest-halloween .home-festival-badge {
  color: #fff3e0;
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 152, 0, 0.35);
}

.home-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 20px 48px;
  position: relative;
}
.home-page::before {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  left: -40px;
  top: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(72, 187, 120, 0.2), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
  z-index: -1;
  animation: homeOrbFloat 10s ease-in-out infinite alternate;
}
@keyframes homeOrbFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(24px); }
}
.home-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 32px;
  font-size: 24px;
  font-weight: 700;
  color: #2d3748;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}
.home-brand-logo {
  height: 64px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(45, 55, 72, 0.15));
}

/* พื้นหลังแต่ละเมนู — สอดคล้องกับการ์ดหน้าหลัก */
body.theme-order,
body.theme-orders,
body.theme-summary,
body.theme-prepare,
body.theme-tracking {
  min-height: 100vh;
}
body.theme-order {
  background: linear-gradient(160deg, #e4e0f7 0%, #f5f3ff 45%, #ede9fe 100%);
}
body.theme-orders {
  background: linear-gradient(160deg, #cfe8fb 0%, #ebf8ff 45%, #e0f2fe 100%);
}
body.theme-summary {
  background: linear-gradient(160deg, #b2f5ea 0%, #e6fffa 45%, #d5f5f0 100%);
}
body.theme-prepare {
  background: linear-gradient(160deg, #fee8c8 0%, #fffaf0 45%, #fef3e2 100%);
}
body.theme-tracking {
  background: linear-gradient(160deg, #c6f6d5 0%, #f0fff4 45%, #e0f8ea 100%);
}

.back-home-link {
  display: inline-block;
  margin: 14px 16px 0;
  padding: 12px 22px;
  font-size: 18px;
  font-weight: 600;
  color: #4a5568;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.page-top-actions {
  padding: 0;
}
.page-top-actions .back-home-link {
  margin: 0;
}
.page-top-actions--hamburger-nav {
  justify-content: flex-start;
}
.page-top-actions--hamburger-nav .staff-menu-wrap {
  margin-left: 0;
}
.staff-menu-wrap--nav .staff-menu-toggle {
  width: 52px;
  height: 52px;
  border-radius: 12px;
}
.staff-menu-wrap--nav .staff-menu-toggle span {
  width: 24px;
  height: 3px;
}
.staff-menu-panel a.staff-menu-home {
  font-weight: 600;
  color: #2d3748;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 4px;
  padding-bottom: 10px;
}
.staff-menu-wrap--nav .staff-menu-panel {
  left: 0;
  right: auto;
  min-width: 240px;
}
.page-logout-btn {
  padding: 8px 18px;
  border: 1.5px solid #fc8181;
  border-radius: 8px;
  color: #e53e3e;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: background 0.2s;
  white-space: nowrap;
  margin-left: auto;
}
.page-logout-btn:hover {
  background: #fff5f5;
}
.receipt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 16px 0;
}
.back-home-link:hover {
  color: #2d3748;
  background: #fff;
}
.home-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-bottom: 32px;
  min-height: 40px;
}
.home-header > div {
  text-align: center;
}
.home-title {
  font-size: 28px;
  font-weight: 700;
  color: #1a365d;
  margin: 0 0 6px;
}
.home-subtitle {
  font-size: 15px;
  color: #718096;
  margin: 0;
}
.home-logout-btn {
  position: absolute;
  top: 0;
  right: 0;
  padding: 8px 18px;
  border: 1.5px solid #fc8181;
  border-radius: 8px;
  color: #e53e3e;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background: #fff;
  transition: background 0.2s;
  white-space: nowrap;
}
.home-logout-btn:hover {
  background: #fff5f5;
}
.home-staff-login-btn {
  position: absolute;
  top: 0;
  right: 0;
  padding: 8px 18px;
  border: 1.5px solid #667eea;
  border-radius: 8px;
  color: #5a67d8;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background: #fff;
  transition: background 0.2s;
  white-space: nowrap;
}
.home-staff-login-btn:hover {
  background: #f5f3ff;
}

/* เมนูแฮมเบอร์เกอร์พนักงาน (ซ่อนลิงก์จากบุคคลทั่วไป) */
.staff-menu-wrap {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}
.home-header .staff-menu-wrap {
  position: absolute;
  top: 0;
  right: 0;
  margin-left: 0;
}
.staff-menu-toggle {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  transition: background 0.2s, box-shadow 0.2s;
}
.staff-menu-toggle:hover {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.staff-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #4a5568;
  border-radius: 1px;
}
.staff-menu-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  border: 1px solid #e2e8f0;
  padding: 6px;
  z-index: 300;
}
.staff-menu-panel.open {
  display: block;
}
.staff-menu-panel a {
  display: block;
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s;
}
.staff-menu-panel a:hover {
  background: #f7fafc;
}
.staff-menu-panel a.staff-menu-login {
  color: #5a67d8;
}
.staff-menu-panel a.staff-menu-logout {
  color: #e53e3e;
}

.home-menu-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}
.home-menu-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1.5px solid #e2e8f0;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 220px;
  max-width: 100%;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}
.home-menu-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #cbd5e0;
  opacity: 0.6;
}
.home-menu-card:hover {
  transform: translateY(-4px);
}
.home-menu-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 18px;
  background: #edf2f7;
  transition: transform 0.22s ease;
}
.home-menu-card:hover .home-menu-icon {
  transform: scale(1.06);
}
.home-menu-card h2 {
  font-size: 17px;
  font-weight: 700;
  color: #2d3748;
  margin: 0 0 8px;
}
.home-menu-card p {
  font-size: 13px;
  color: #718096;
  margin: 0;
  line-height: 1.5;
}

/* สั่งซื้อสินค้า — ม่วง */
.home-menu-card--order {
  background: linear-gradient(155deg, #ffffff 0%, #f5f3ff 100%);
  border-color: #c4b5fd;
}
.home-menu-card--order::before { background: linear-gradient(90deg, #667eea, #764ba2); opacity: 1; }
.home-menu-card--order:hover { box-shadow: 0 10px 28px rgba(102, 126, 234, 0.22); border-color: #a78bfa; }
.home-menu-card--order .home-menu-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
}
.home-menu-card--order h2 { color: #5a67d8; }

/* รายการสั่งซื้อ — น้ำเงิน */
.home-menu-card--orders {
  background: linear-gradient(155deg, #ffffff 0%, #ebf8ff 100%);
  border-color: #90cdf4;
}
.home-menu-card--orders::before { background: linear-gradient(90deg, #4299e1, #3182ce); opacity: 1; }
.home-menu-card--orders:hover { box-shadow: 0 10px 28px rgba(66, 153, 225, 0.22); border-color: #63b3ed; }
.home-menu-card--orders .home-menu-icon {
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  box-shadow: 0 4px 14px rgba(66, 153, 225, 0.35);
}
.home-menu-card--orders h2 { color: #2b6cb0; }

/* สรุปรายการ — เขียวมิ้นท์ */
.home-menu-card--summary {
  background: linear-gradient(155deg, #ffffff 0%, #e6fffa 100%);
  border-color: #81e6d9;
}
.home-menu-card--summary::before { background: linear-gradient(90deg, #38b2ac, #319795); opacity: 1; }
.home-menu-card--summary:hover { box-shadow: 0 10px 28px rgba(56, 178, 172, 0.22); border-color: #4fd1c5; }
.home-menu-card--summary .home-menu-icon {
  background: linear-gradient(135deg, #38b2ac 0%, #319795 100%);
  box-shadow: 0 4px 14px rgba(56, 178, 172, 0.35);
}
.home-menu-card--summary h2 { color: #2c7a7b; }

/* จัดสินค้า — ส้ม */
.home-menu-card--prepare {
  background: linear-gradient(155deg, #ffffff 0%, #fffaf0 100%);
  border-color: #fbd38d;
}
.home-menu-card--prepare::before { background: linear-gradient(90deg, #ed8936, #dd6b20); opacity: 1; }
.home-menu-card--prepare:hover { box-shadow: 0 10px 28px rgba(237, 137, 54, 0.22); border-color: #f6ad55; }
.home-menu-card--prepare .home-menu-icon {
  background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
  box-shadow: 0 4px 14px rgba(237, 137, 54, 0.35);
}
.home-menu-card--prepare h2 { color: #c05621; }

/* ติดตามสถานะ — เขียว */
.home-menu-card--tracking {
  background: linear-gradient(155deg, #ffffff 0%, #f0fff4 100%);
  border-color: #9ae6b4;
}
.home-menu-card--tracking::before { background: linear-gradient(90deg, #48bb78, #38a169); opacity: 1; }
.home-menu-card--tracking:hover { box-shadow: 0 10px 28px rgba(72, 187, 120, 0.22); border-color: #68d391; }
.home-menu-card--tracking .home-menu-icon {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  box-shadow: 0 4px 14px rgba(72, 187, 120, 0.35);
}
.home-menu-card--tracking h2 { color: #276749; }
@media (max-width: 600px) {
  .home-header {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-height: 0;
    padding-top: 48px;
  }
  .home-header .staff-menu-wrap {
    position: absolute;
    top: 0;
    right: 0;
  }
  .home-title { font-size: 22px; }
  .home-menu-grid { gap: 14px; }
  .home-menu-card { width: calc(50% - 7px); padding: 20px 16px; }
}
