/* DX Pemesanan Pengiriman - Compact & Modern CSS */

/* ===== VARIABLES ===== */
:root {
  --primary: #1a1a1a; /* Black theme */
  --primary-dark: #2d2d2d;
  --secondary: #646970;
  --success: #1a1a1a; /* Black theme */
  --warning: #f0b849;
  --danger: #d63638;
  --light: #f6f7f7;
  --dark: #1d2327;
  --border: #dcdcde;
  --white: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  --radius: 6px;
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ===== GLOBAL STYLES ===== */
.dx-pemesanan-container,
.dx-pengiriman-container,
.dx-konfirmasi-container {
  max-width: 800px; /* More compact width */
  margin: 20px auto;
  padding: 0 15px;
  font-family: var(--font-main);
  color: var(--dark);
  font-size: 14px;
  line-height: 1.5;
}

/* ===== HEADER STYLES ===== */
.dx-pemesanan-header,
.dx-pengiriman-header,
.dx-konfirmasi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.dx-pemesanan-header h1,
.dx-pengiriman-header h1,
.dx-konfirmasi-header h1 {
  margin: 0;
  color: var(--dark);
  font-size: 20px; /* Smaller header */
  font-weight: 600;
}

.dx-order-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 13px;
}

.dx-order-id {
  color: var(--secondary);
}

.dx-order-id code {
  background: var(--light);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  color: var(--dark);
  border: 1px solid var(--border);
}

.dx-customer-name {
  font-weight: 600;
  color: var(--dark);
}

/* ===== PROGRESS BAR ===== */
.dx-pemesanan-progress,
.dx-pengiriman-progress,
.dx-konfirmasi-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
  padding: 0 10px;
}

.dx-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  min-width: 60px;
}

.dx-step-number {
  width: 28px; /* Smaller circle */
  height: 28px;
  border-radius: 50%;
  background: #f0f0f1;
  color: #a7aaad;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 6px;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.dx-progress-step.completed .dx-step-number {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.dx-progress-step.active .dx-step-number {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.15);
}

.dx-step-text {
  font-size: 12px;
  color: var(--secondary);
  font-weight: 500;
}

.dx-progress-step.completed .dx-step-text,
.dx-progress-step.active .dx-step-text {
  color: var(--dark);
  font-weight: 600;
}

.dx-progress-line {
  flex: 1;
  height: 2px;
  background: #f0f0f1;
  margin: 0 5px;
  position: relative;
  top: -12px; /* Adjust alignment with smaller circles */
  max-width: 80px;
}

/* ===== CARD STYLES ===== */
.dx-customer-card,
.dx-order-items-section,
.dx-order-summary,
.dx-order-summary-card,
.dx-shipping-step,
.dx-confirmation-card,
.dx-payment-methods,
.dx-final-summary {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* Section Headers inside cards */
.dx-customer-card h3,
.dx-section-header h3,
.dx-summary-header h3,
.dx-order-summary-card h3,
.dx-step-header h3,
.dx-payment-methods h3 {
  margin: 0 0 15px 0;
  color: var(--dark);
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--light);
  padding-bottom: 10px;
}

.dx-section-header-small h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: var(--dark);
    border-bottom: 1px solid var(--light);
    padding-bottom: 8px;
}

.dx-icon {
  font-size: 16px;
  opacity: 0.8;
}

/* ===== GRID & DETAILS ===== */
.dx-customer-details,
.dx-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.dx-detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dx-detail-label {
  font-size: 12px;
  color: var(--secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dx-detail-value {
  color: var(--dark);
  font-weight: 500;
  font-size: 14px;
}

/* ===== ORDER ITEMS ===== */
.dx-order-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dx-order-item {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 0.2s;
  display: block;
}

.dx-order-item:hover {
  border-color: var(--primary);
}

.dx-item-header {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--light);
}

.dx-item-title {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.4;
}

.dx-item-sku {
  font-size: 11px;
  color: var(--secondary);
  background: var(--light);
  padding: 2px 8px;
  border-radius: 3px;
  display: inline-block;
}

.dx-item-details {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.dx-item-meta {
  flex: 1;
  min-width: 200px;
  font-size: 13px;
  color: var(--secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dx-meta-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dx-meta-label {
  min-width: 80px;
}

.dx-stock-in {
  color: var(--success);
  font-weight: 500;
}

.dx-stock-out {
  color: var(--danger);
  font-weight: 700;
}

/* Item Controls (Qty & Price) */
.dx-item-controls {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 160px;
}

.dx-quantity-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.dx-qty-minus,
.dx-qty-plus {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--light);
  cursor: pointer;
  font-weight: bold;
  color: var(--dark);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dx-qty-minus:hover,
.dx-qty-plus:hover {
  background: #e5e5e5;
}

.dx-qty-input {
  width: 40px;
  height: 28px;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  -moz-appearance: textfield;
  padding: 0;
}

.dx-qty-input::-webkit-outer-spin-button,
.dx-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.dx-stock-info {
  font-size: 11px;
  color: var(--secondary);
  margin-top: 2px;
}

.dx-item-price {
  text-align: right;
}

.dx-price-label {
  font-size: 11px;
  color: var(--secondary);
}

.dx-price-value {
  font-size: 13px;
  color: var(--secondary);
  text-decoration: line-through;
  display: none; /* Hide unit price to simplify */
}

.dx-subtotal {
  font-weight: 600;
  color: var(--primary);
  font-size: 15px;
}

.dx-item-warning {
  margin-top: 10px;
  padding: 8px 12px;
  background: #fcf0f1;
  border: 1px solid #f5c2c7;
  border-radius: 4px;
  font-size: 12px;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== SUMMARY & TOTALS ===== */
.dx-summary-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--light);
  margin-bottom: 15px;
}

.dx-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.dx-grand-total {
  font-weight: 700;
  font-size: 18px;
  color: var(--dark);
  margin-top: 5px;
}

.dx-grand-total .dx-summary-value {
  color: var(--primary);
}

/* ===== BUTTONS ===== */
.dx-action-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.dx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px; /* Compact padding */
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  min-height: 36px;
}

.dx-btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.dx-btn-primary:hover {
  background: var(--primary-dark);
  color: white;
}

.dx-btn-secondary {
  background: white;
  color: var(--dark);
  border-color: var(--border);
}

.dx-btn-secondary:hover {
  background: var(--light);
  border-color: #c3c4c7;
  color: var(--dark);
}

.dx-btn-success {
  background: var(--success);
  color: white;
}

/* ===== FORMS ===== */
.dx-form-group {
  margin-bottom: 15px;
}

.dx-form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box; /* Fix sizing */
}

.dx-form-control:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 1px var(--primary);
}

.dx-help-text {
  display: block;
  font-size: 11px;
  color: var(--secondary);
  margin-top: 4px;
}

/* ===== SHIPPING SPECIFIC ===== */
.dx-stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
}

.dx-store-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  background: white;
  transition: all 0.2s;
  cursor: pointer;
}

.dx-store-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.dx-store-card.selected {
  border-color: var(--primary);
  background: #f0f7ff;
  box-shadow: 0 0 0 1px var(--primary);
}

.dx-store-header h4 {
  margin: 0 0 5px 0;
  font-size: 14px;
  color: var(--primary);
}

.dx-store-code {
  font-size: 11px;
  background: var(--light);
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--secondary);
}

.dx-store-details {
  margin: 10px 0;
  font-size: 12px;
  color: var(--secondary);
}

.dx-store-details p {
  margin: 3px 0;
}

.dx-btn-select-store {
  width: 100%;
  margin-top: 10px;
  font-size: 12px;
  padding: 6px;
}

/* Selected Store/Address Containers */
.dx-selected-card,
.dx-address-card,
.dx-shipping-card {
  background: #fcfcfc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  margin-top: 10px;
}

.dx-selected-header,
.dx-address-header,
.dx-shipping-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 14px;
}

/* Loading & Error States */
.dx-loading-state,
.dx-error-state,
.dx-no-stores {
  text-align: center;
  padding: 30px;
  background: var(--light);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.dx-error-state {
  background: #fcf0f1;
  color: var(--danger);
  border: 1px solid #f5c2c7;
}

.dx-error-icon {
  font-size: 24px;
  margin-bottom: 10px;
}

.dx-loading-spinner-large {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Shipping Options List */
.dx-shipping-header-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  padding: 10px 12px;
  background: var(--light);
  font-weight: 600;
  font-size: 13px;
  color: var(--secondary);
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
}

.dx-shipping-option {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  background: white;
  margin-bottom: 0;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.dx-shipping-option:not(:last-child) {
    border-bottom: none;
}

.dx-shipping-option:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
}

.dx-shipping-option:hover {
  background: var(--light);
}

.dx-shipping-option.selected {
  border-color: var(--primary);
  background: #f0f7ff;
  position: relative;
  z-index: 1;
}

.dx-btn-change-store {
  width: auto !important;
  max-width: 120px;
  min-width: 80px;
  padding: 4px 12px;
}

/* Autocomplete Dropdown Styling */
.ui-autocomplete {
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  background: white;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  padding: 0;
  z-index: 9999;
  width: auto !important;
  min-width: 300px;
}

.ui-menu-item {
  padding: 0;
  list-style: none;
}

.ui-menu-item .city-option {
  padding: 8px 12px;
  border-bottom: 1px solid var(--light);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.ui-menu-item:last-child .city-option {
    border-bottom: none;
}

.ui-menu-item:hover .city-option,
.ui-state-active .city-option {
  background-color: #f0f7ff;
  color: var(--dark);
}

.city-main {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
}

.city-detail {
    font-size: 12px;
    color: var(--secondary);
}

.dx-badge-cheapest {
  background-color: var(--success);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  text-transform: uppercase;
  font-weight: 600;
  display: inline-block;
  vertical-align: middle;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .dx-order-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .dx-item-controls {
    align-items: flex-start;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    border-top: 1px solid var(--light);
    padding-top: 10px;
  }
  
  .dx-action-buttons {
    flex-direction: column;
  }
  
  .dx-btn {
    width: 100%;
  }
  
  /* Exception for change button */
  .dx-btn-change-store {
      width: auto;
  }
  
  .dx-progress-step {
    min-width: auto;
    flex: 1;
  }
  
  .dx-step-text {
    display: none; /* Hide text on very small screens if needed */
  }
  
  .dx-progress-step.active .dx-step-text {
    display: block; /* Show only active step text */
    font-size: 11px;
    position: absolute;
    bottom: -20px;
    width: 100px;
    text-align: center;
  }
  
  .dx-shipping-header-grid {
      display: none; /* Hide table header on mobile */
  }
  
  .dx-shipping-option {
    grid-template-columns: 1fr auto;
    gap: 5px;
    border-bottom: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    margin-bottom: 8px;
  }
  
  .dx-shipping-service {
      grid-column: 1 / -1;
  }
  
  .dx-shipping-estimate {
      color: var(--secondary);
      font-size: 12px;
  }
  
  .dx-shipping-price {
      text-align: right;
      font-weight: 600;
  }
}
/* ===== MODAL ===== */
.dx-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dx-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.dx-modal-content {
  position: relative;
  background: white;
  width: 90%;
  max-width: 500px;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  z-index: 10001;
  animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.dx-modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}

.dx-modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--dark);
}

.dx-modal-body {
  padding: 20px;
  overflow-y: auto;
}

.dx-terms-list-modal {
  padding-left: 20px;
  margin: 0;
}

.dx-terms-list-modal li {
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--secondary);
  line-height: 1.5;
}

.dx-modal-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border);
  background-color: #f9f9f9;
  border-radius: 0 0 var(--radius) var(--radius);
}

.dx-btn-block {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* ===== TOTAL AMOUNT HIGHLIGHT ===== */
.dx-total-highlight {
  background-color: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
}

.dx-total-highlight p {
  margin: 0 0 5px 0;
  font-size: 14px;
  color: #555;
}

.dx-total-highlight .dx-total-amount {
  font-size: 24px;
  font-weight: 700;
  color: #1565c0;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.dx-copy-btn {
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  color: #333;
  transition: all 0.2s;
  font-weight: normal;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}

.dx-copy-btn:hover {
  background: #e0e0e0;
  border-color: #bbb;
}
.dx-payment-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 25px;
}

.dx-payment-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 15px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  height: 100%;
  background: white;
  box-sizing: border-box;
}

.dx-payment-option:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.dx-payment-option.active {
  border-color: var(--primary);
  background-color: #f0f7ff;
  box-shadow: 0 0 0 1px var(--primary);
}

.dx-payment-icon {
  margin-right: 0;
  margin-bottom: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dx-payment-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.dx-payment-info h4 {
  font-size: 12px;
  margin: 0;
  color: var(--dark);
  font-weight: 600;
  line-height: 1.3;
}

/* Hide unused elements in new design */
.dx-payment-option .dx-payment-select,
.dx-payment-option p {
  display: none;
}

/* ===== EWALLET LAYOUT ===== */
.dx-ewallet-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Align left as per typical instruction layout, or center? User asked for "bottom", implied vertical stack. Let's keep it clean. */
  margin-bottom: 15px;
}

.dx-ewallet-logo {
  max-height: 50px;
  width: auto;
  margin-bottom: 8px; /* Space between logo and name */
  object-fit: contain;
}

/* ===== QRIS LAYOUT (Top-Bottom) ===== */
.dx-qris-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  gap: 20px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.dx-qris-code {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  background: white;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.dx-qris-image {
  width: 100%;
}

.dx-qris-image img.dx-qr-code {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.dx-qris-info {
  width: 100%;
}

.dx-qris-info p {
  margin-bottom: 8px;
}