/* =============================================
   Life2Pharma — Component Styles
   ============================================= */

/* ---- Quantity Stepper ---- */
.qty-stepper {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.qty-stepper button {
  width: 36px; height: 40px; background: var(--bg-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: var(--transition);
}
.qty-stepper button:hover { background: var(--primary); color: #fff; }
.qty-stepper input {
  width: 50px; height: 40px; text-align: center;
  border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  outline: none; font-family: 'Poppins', sans-serif; font-size: 0.9rem; font-weight: 500;
}

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.modal-backdrop.active { opacity: 1; pointer-events: all; }
.modal {
  background: #fff; border-radius: var(--radius-lg); padding: 32px;
  max-width: 500px; width: 90%; max-height: 90vh; overflow-y: auto;
  transform: scale(0.95); transition: transform 0.25s ease;
}
.modal-backdrop.active .modal { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 1.1rem; font-weight: 600; }
.modal-close { width: 30px; height: 30px; border-radius: 50%; background: var(--bg-light); display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.modal-close:hover { background: #f1f1f1; }

/* ---- Alert Box ---- */
.alert {
  padding: 14px 16px; border-radius: var(--radius);
  display: flex; gap: 10px; align-items: flex-start;
  margin-bottom: 16px; font-size: 0.88rem;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-info { background: #e8f4fd; border: 1px solid #b8d9f5; color: #1a6fa6; }
.alert-info svg { color: #1a6fa6; }
.alert-success { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; }
.alert-success svg { color: #155724; }
.alert-warning { background: #fff3cd; border: 1px solid #ffeeba; color: #856404; }
.alert-warning svg { color: #856404; }
.alert-danger { background: #f8d7da; border: 1px solid #f5c6cb; color: #721c24; }
.alert-danger svg { color: #721c24; }

/* ---- Tags / Chips ---- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 20px; font-size: 0.78rem; font-weight: 500;
  background: var(--bg-light); color: var(--text-dark); cursor: pointer;
  border: 1px solid var(--border); transition: var(--transition);
}
.chip:hover, .chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Loading Spinner ---- */
.spinner {
  display: inline-block; width: 24px; height: 24px;
  border: 3px solid rgba(13,115,119,0.2);
  border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,0.8);
  z-index: 5000; display: none; align-items: center; justify-content: center;
}
.loading-overlay.active { display: flex; }

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state svg { width: 64px; height: 64px; color: #d1d5db; margin: 0 auto 16px; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 8px; }
.empty-state p { font-size: 0.88rem; color: var(--text-muted); }

/* ---- Step Indicator ---- */
.steps { display: flex; align-items: center; gap: 0; margin-bottom: 32px; }
.step { display: flex; align-items: center; gap: 10px; flex: 1; }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-light); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 600; flex-shrink: 0;
  transition: var(--transition);
}
.step.active .step-circle { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.done .step-circle { background: #27ae60; border-color: #27ae60; color: #fff; }
.step-label { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }
.step.active .step-label { color: var(--primary); }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0; }
.step.done .step-line { background: #27ae60; }

/* ---- Info Box ---- */
.info-box {
  background: rgba(13,115,119,0.05); border: 1px solid rgba(13,115,119,0.15);
  border-radius: var(--radius); padding: 16px; margin-bottom: 20px;
}
.info-box h4 { font-size: 0.88rem; color: var(--primary); margin-bottom: 6px; }
.info-box p { font-size: 0.82rem; color: var(--text-muted); margin: 0; }

/* ---- Related Products ---- */
.related-products { padding: 48px 0; border-top: 1px solid var(--border); }
.related-products h2 { font-size: 1.4rem; margin-bottom: 24px; }

/* ---- Category Cards (Home) ---- */
.categories-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.categories-scroll::-webkit-scrollbar { height: 4px; }
.categories-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.category-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 50px; white-space: nowrap;
  background: #fff; border: 1px solid var(--border); cursor: pointer;
  font-size: 0.85rem; transition: var(--transition); flex-shrink: 0;
}
.category-pill:hover, .category-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.category-pill svg { width: 15px; height: 15px; }

/* ---- B2B Badge ---- */
.b2b-notice {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; padding: 12px 20px;
  display: flex; align-items: center; justify-content: center;
  gap: 10px; font-size: 0.82rem;
}
.b2b-notice svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---- Sticky Filter Bar (mobile) ---- */
.mobile-filter-bar {
  display: none; position: sticky; top: 72px; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 10px 20px;
}
@media (max-width: 768px) {
  .mobile-filter-bar { display: flex; gap: 10px; overflow-x: auto; }
}

/* ---- Image placeholder ---- */
.img-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #94a3b8;
}
.img-placeholder svg { width: 40px; height: 40px; margin-bottom: 8px; }
.img-placeholder span { font-size: 0.75rem; }

/* ---- Scroll to top ---- */
.scroll-top {
  position: fixed; bottom: 92px; right: 28px; z-index: 998;
  width: 42px; height: 42px; background: #fff; border-radius: 50%;
  box-shadow: var(--shadow-md); display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: var(--transition);
  border: 1px solid var(--border);
}
.scroll-top.visible { opacity: 1; pointer-events: all; }
.scroll-top:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.scroll-top svg { width: 18px; height: 18px; }
