/* ==========================================================================
   Directed Auto Accessories UAE - Components & Interactive UI
   Cart Drawer, Floating WhatsApp, Modals, Checkout, Toasts & Forms
   ========================================================================== */

/* ==========================================================================
   Secondary Pages Banner
   ========================================================================== */

.page-banner {
  background: linear-gradient(180deg, #090e18 0%, #0c111d 100%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 3.5rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.page-banner::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  height: 100%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
}

.page-banner-content {
  position: relative;
  z-index: 2;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.breadcrumb-nav a:hover {
  color: var(--accent-gold);
}

.breadcrumb-separator {
  color: var(--text-dim);
}

.page-banner-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

.page-banner-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
}

/* ==========================================================================
   Slide-Over Cart Drawer
   ========================================================================== */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  z-index: 1002;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background: var(--bg-primary);
  border-left: 1px solid var(--border-card);
  z-index: 1003;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transition: right var(--transition-smooth);
}

.cart-drawer.active {
  right: 0;
}

.cart-drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-drawer-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.cart-close-btn:hover {
  color: #fff;
}

/* Free Shipping Meter */
.free-shipping-meter {
  padding: 0.85rem 1.5rem;
  background: rgba(24, 34, 56, 0.6);
  border-bottom: 1px solid var(--border-subtle);
}

.shipping-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.5rem;
}

.shipping-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-green));
  width: 0%;
  transition: width 0.4s ease;
}

.shipping-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cart-drawer-items {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-drawer-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.cart-item-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  background: #0f1624;
  flex-shrink: 0;
}

.cart-item-info {
  flex-grow: 1;
}

.cart-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-item-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-gold);
  font-family: 'Outfit', sans-serif;
  margin-bottom: 0.4rem;
}

.cart-qty-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 26px;
  height: 26px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.qty-btn:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.qty-value {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.cart-item-remove {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.cart-item-remove:hover {
  color: var(--accent-red);
}

.empty-cart-state {
  text-align: center;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.empty-cart-icon {
  font-size: 3rem;
  opacity: 0.4;
}

.cart-drawer-footer {
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
}

.cart-subtotal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.cart-subtotal-amount {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  font-family: 'Outfit', sans-serif;
}

.cart-drawer-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ==========================================================================
   Floating WhatsApp Widget
   ========================================================================== */

.whatsapp-floating-widget {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 999;
}

.wa-floating-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25d366;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
  position: relative;
  transition: transform var(--transition-normal);
}

.wa-floating-btn:hover {
  transform: scale(1.08);
}

.wa-icon-svg {
  width: 32px;
  height: 32px;
}

.wa-pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #25d366;
  animation: waPulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes waPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.wa-badge-online {
  position: absolute;
  top: 0;
  right: 0;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* WhatsApp Popup Card */
.wa-popup-card {
  position: absolute;
  bottom: 75px;
  right: 0;
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.96);
  transition: all var(--transition-normal);
  z-index: 1000;
}

.wa-popup-card.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.wa-popup-header {
  background: #0f1c13;
  border-bottom: 1px solid rgba(37, 211, 102, 0.2);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.wa-avatar-wrap {
  position: relative;
}

.wa-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid #0f1c13;
  border-radius: 50%;
}

.wa-header-meta h5 {
  font-size: 0.95rem;
  font-weight: 700;
}

.wa-header-meta span {
  font-size: 0.75rem;
  color: #a7f3d0;
}

.wa-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.wa-popup-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: #0b111a;
}

.wa-bubble {
  background: #182238;
  border: 1px solid var(--border-subtle);
  border-radius: 12px 12px 12px 2px;
  padding: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #e2e8f0;
}

.wa-quick-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.wa-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.wa-chip:hover {
  background: rgba(37, 211, 102, 0.1);
  color: #25d366;
  border-color: rgba(37, 211, 102, 0.3);
}

.wa-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.wa-input-row input {
  flex-grow: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.wa-input-row input:focus {
  border-color: #25d366;
}

.wa-send-btn {
  width: 38px;
  height: 38px;
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.wa-send-btn:hover {
  background: #20ba5a;
}

/* ==========================================================================
   Toast Alerts
   ========================================================================== */

.toast-container {
  position: fixed;
  top: 90px;
  right: 25px;
  z-index: 1004;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast-card {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  animation: slideInToast 0.3s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-card.fade-out {
  opacity: 0;
  transform: translateX(20px);
}

@keyframes slideInToast {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.toast-info .toast-icon {
  background: rgba(6, 182, 212, 0.2);
  color: #06b6d4;
}

.toast-text {
  font-size: 0.85rem;
  color: #f1f5f9;
  line-height: 1.35;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.15rem;
  cursor: pointer;
}

/* ==========================================================================
   Modals (Quick View, etc.)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  z-index: 1005;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: zoomModal 0.25s ease;
}

@keyframes zoomModal {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  z-index: 10;
}

.modal-close-btn:hover {
  background: var(--accent-red);
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem;
}

/* ==========================================================================
   Forms & Controls
   ========================================================================== */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #cbd5e1;
}

.form-control {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 0.92rem;
  transition: all var(--transition-fast);
}

.form-control:focus {
  border-color: var(--accent-gold);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.form-control::placeholder {
  color: var(--text-dim);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Radio Cards (Delivery / Payment options) */
.radio-card-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.radio-card-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.radio-card-label:hover {
  border-color: rgba(245, 158, 11, 0.5);
}

.radio-card-label.selected {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.05);
}

.radio-card-label input[type="radio"] {
  accent-color: var(--accent-gold);
}

.radio-card-body h6 {
  font-size: 0.95rem;
  font-weight: 700;
}

.radio-card-body p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.radio-card-price {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-gold);
}

/* ==========================================================================
   Accordion FAQ
   ========================================================================== */

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-item.active {
  border-color: var(--accent-gold);
}

.faq-question {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  user-select: none;
}

.faq-icon-arrow {
  transition: transform var(--transition-normal);
  color: var(--accent-gold);
}

.faq-item.active .faq-icon-arrow {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1.5rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
}

/* Responsive Modal and Forms */
@media (max-width: 768px) {
  .modal-grid {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .cart-drawer {
    max-width: 100%;
  }
  .wa-popup-card {
    width: calc(100vw - 40px);
    right: -10px;
  }
}
