/* Smart Order CSS - Standalone Version */
:root {
  /* Design Tokens - Sesuaikan dengan tema Anda */
  --primary-color: #d946ef; /* Akila Pink */
  --primary-color-hover: #c026d3;
  --border-radius: 12px;
  --font-family: 'Inter', sans-serif;
  
  /* Internal Variables */
  --so-bg-overlay: rgba(0, 0, 0, 0.5);
  --so-drawer-width: 400px;
  --so-z-index: 9999;
}

/* Reset for Drawer Context */
#smart-order-root {
  font-family: var(--font-family);
  box-sizing: border-box;
}

#smart-order-root * {
  box-sizing: border-box;
}

/* Overlay */
.so-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--so-bg-overlay);
  z-index: var(--so-z-index);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.so-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Drawer */
.so-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: var(--so-drawer-width);
  height: 100%;
  background: white;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  z-index: calc(var(--so-z-index) + 1);
}

.so-overlay.open .so-drawer {
  right: 0;
}

/* Header */
.so-header {
  padding: 20px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
}

.so-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: #111827;
}

.so-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.so-close:hover {
  background: #f3f4f6;
  color: #111827;
}

/* Body */
.so-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #fff;
}

/* Product Summary */
.so-product-summary {
  background: #f9fafb;
  padding: 12px;
  border-radius: var(--border-radius);
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid #e5e7eb;
}

.so-product-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  background: #e5e7eb;
}

.so-product-info {
  flex: 1;
}

.so-product-info h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
}

.so-product-info p {
  margin: 0;
  font-size: 13px;
  color: var(--primary-color);
  font-weight: 600;
  font-family: monospace;
}

/* Form Elements */
.so-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #9ca3af;
  margin: 24px 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.so-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.so-form-group {
  margin-bottom: 16px;
}

.so-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.so-input, .so-textarea, .so-select {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-family);
  transition: all 0.2s;
  background: #fff;
}

.so-input:focus, .so-textarea:focus, .so-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.1);
}

/* Pastikan input date & time memiliki kursor pointer */
.so-input[type="date"],
.so-input[type="time"] {
    cursor: pointer;
    position: relative;
    min-height: 45px; /* Standar kenyamanan sentuhan jari */
}

/* Hilangkan bintik putih atau styling aneh browser di beberapa device */
.so-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 5px;
    filter: invert(0.5); /* Supaya ikon sedikit lebih terlihat lembut */
}

.so-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Radio Group for Delivery */
.so-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.so-radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.so-radio-label:hover {
  background: #f9fafb;
}

.so-radio-label:has(input:checked) {
  border-color: var(--primary-color);
  background: #fdf2f8; /* Light pink */
  color: var(--primary-color);
  font-weight: 500;
}

.so-radio-input {
  accent-color: var(--primary-color);
  width: 16px;
  height: 16px;
}

/* Footer */
.so-footer {
  padding: 20px;
  border-top: 1px solid #f3f4f6;
  background: #fff;
}

.so-submit-btn {
  width: 100%;
  padding: 14px;
  background: #25D366; /* WhatsApp Green */
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, transform 0.1s;
}

.so-submit-btn:hover {
  background: #22c55e;
  transform: translateY(-1px);
}

.so-submit-btn:active {
  transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .so-drawer {
    max-width: 100%;
  }
  .so-product-summary {
    flex-direction: row;
  }
}
