/* ==========================================================================
   RASA - COMPONENTS & REUSABLE UI
   ========================================================================== */

/* Toast Notification System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 500;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
}
.toast.show {
  transform: translateX(0);
  opacity: 1;
}
.toast-success { border-left: 5px solid var(--success); }
.toast-error { border-left: 5px solid var(--danger); }
.toast-warning { border-left: 5px solid var(--warning); }
.toast-info { border-left: 5px solid var(--secondary); }
.toast-icon { font-size: 1.25rem; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--secondary); }
.toast-message { flex: 1; line-height: 1.35; }
.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
}

/* Modal Dialog System */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.modal-overlay.active {
  display: flex;
  opacity: 1;
}
.modal-window {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}
.modal-overlay.active .modal-window {
  transform: scale(1);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.modal-close-btn:hover {
  background: var(--bg-page);
  color: var(--text-main);
}
.modal-body {
  padding: 1.5rem;
}
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-page);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 4px rgba(15, 118, 110, 0.2);
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}
.btn-secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: #e2e8f0;
}
.btn-accent {
  background: var(--accent);
  color: #0f172a;
  font-weight: 700;
}
.btn-accent:hover {
  background: var(--accent-dark);
  color: #fff;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #b91c1c;
}
.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary-subtle);
}
.btn-block {
  width: 100%;
}
.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
}
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}
.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--text-main);
  background: #fff;
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}
.form-error-text {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 0.25rem;
  display: none;
}
.form-error .form-control {
  border-color: var(--danger);
}
.form-error .form-error-text {
  display: block;
}

/* Skeleton Loaders */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  height: 280px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 0.85rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.skeleton-img { width: 100%; height: 140px; }
.skeleton-text { width: 75%; height: 16px; }
.skeleton-text-sm { width: 50%; height: 12px; }
.skeleton-btn { width: 100%; height: 36px; margin-top: auto; }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  max-width: 480px;
  margin: 0 auto;
}
.empty-state-icon {
  font-size: 3.5rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}
.empty-state h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}
.empty-state p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Order Tracker Progress Stepper */
.order-tracker {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.tracker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.tracker-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 1rem;
}
.tracker-steps::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  height: 4px;
  background: #e2e8f0;
  z-index: 1;
}
.tracker-progress-bar {
  position: absolute;
  top: 18px;
  left: 20px;
  height: 4px;
  background: var(--primary);
  z-index: 2;
  transition: width 0.4s ease;
}
.tracker-step {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 90px;
}
.tracker-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #cbd5e1;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
  transition: var(--transition);
}
.tracker-step.completed .tracker-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.tracker-step.current .tracker-circle {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.2);
}
.tracker-step.cancelled .tracker-circle {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.tracker-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.tracker-step.completed .tracker-title,
.tracker-step.current .tracker-title {
  color: var(--text-main);
  font-weight: 700;
}

/* Badge System */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-placed { background: #fef3c7; color: #b45309; }
.badge-confirmed { background: #e0f2fe; color: #0369a1; }
.badge-packaged { background: #f3e8ff; color: #7e22ce; }
.badge-shipped { background: #ede9fe; color: #6d28d9; }
.badge-out_for_delivery { background: #ffedd5; color: #c2410c; }
.badge-delivered { background: #dcfce7; color: #15803d; }
.badge-cancelled { background: #fee2e2; color: #b91c1c; }

/* Accessibility: Clear Focus States */
:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
}

/* Honeypot Spam Protection Hidden Class */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
}

/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0f172a;
  color: #f8fafc;
  padding: 1.25rem 1.5rem;
  z-index: 9998;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  animation: slideUpCookie 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUpCookie {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.cookie-banner-text {
  flex: 1;
  min-width: 280px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #cbd5e1;
}
.cookie-banner-text a {
  color: #34d399;
  text-decoration: underline;
}
.cookie-banner-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Free Delivery Meter */
.free-delivery-meter {
  background: #e2e8f0;
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.free-delivery-progress {
  background: linear-gradient(90deg, #10b981, #047857);
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}
