/* rfq_cart.css — RFQ Drawer System */

:root {
  --rfq-accent: #c62828;
  --rfq-dark: #111827;
  --rfq-light: #f9fafb;
  --rfq-border: #e5e7eb;
  --rfq-shadow: 0 24px 50px rgba(15, 23, 42, 0.25);
  --rfq-header-height: 96px;
}

/* ──── Badge ────────────────────────────────────────────────────────────── */

#rfq-nav-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  margin-right: .15rem;
  font-size: 2.5rem;
}

#rfq-cart-badge {
  position: absolute;
  top: .25rem;
  right: .05rem;
  min-width: 18px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--rfq-accent);
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 6px 14px rgba(198, 40, 40, 0.35);
}

#rfq-cart-badge.is-hidden {
  display: none;
}

/* ──── Backdrop ─────────────────────────────────────────────────────────── */

#rfq-cart-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1045;
}

body.rfq-cart-open #rfq-cart-backdrop {
  display: block;
}

/* ──── Drawer Shell ─────────────────────────────────────────────────────── */

body.rfq-cart-open #rfq-cart-drawer {
  transform: translateX(0);
}

#rfq-cart-drawer {
  position: fixed;
  top: 6rem;
  right: 0;
  bottom: 0;
  width: min(440px, 92vw);
  background: #fff;
  border-left: 1px solid var(--rfq-border);
  box-shadow: var(--rfq-shadow);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  z-index: 1046;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ──── Drawer Header (persistent across both panels) ────────────────────── */

.rfq-drawer-header {
  flex-shrink: 0;
  border-bottom: 1px solid var(--rfq-border);
  background: #fff;
  padding: 16px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rfq-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rfq-drawer-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--rfq-dark);
}

.rfq-cart-close {
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
}

.rfq-cart-close:hover {
  color: var(--rfq-dark);
  background: var(--rfq-light);
}

/* ──── Stepper ──────────────────────────────────────────────────────────── */

.rfq-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rfq-step {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.rfq-step--active {
  color: var(--rfq-dark);
}

.rfq-step-arrow {
  font-size: 12px;
  color: #d1d5db;
}

/* ──── Editing Context Bar ──────────────────────────────────────────────── */

.rfq-editing-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #92400e;
}

.rfq-editing-context[hidden] {
  display: none;
}

.rfq-done-editing {
  border: 1px solid #d97706;
  background: #fff;
  color: #92400e;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.rfq-done-editing:hover {
  background: #fef9ee;
}

/* ──── Panels Wrapper ───────────────────────────────────────────────────── */

/* Wraps both panels. overflow:hidden clips the off-screen panel. */

.rfq-panels-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
  display: flex;
}

/* ──── Individual Panels ────────────────────────────────────────────────── */

.rfq-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--rfq-light);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  will-change: transform;
}

/* Items panel rests off-screen to the LEFT when inactive */

/* Active panel sits at center */

.rfq-panel--active {
  transform: translateX(0) !important;
  opacity: 1 !important;
}

/* Contact panel defaults off to the right; override for active above handles it */

/* ──── Panel Body (scrollable content area) ─────────────────────────────── */

.rfq-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ──── Items Panel — Empty State ────────────────────────────────────────── */

.rfq-items-empty {
  text-align: center;
  color: #6b7280;
  padding: 48px 12px;
}

.rfq-items-empty p {
  margin-bottom: 8px;
}

.rfq-hint {
  font-size: 13px;
}

/* ──── Items List ────────────────────────────────────────────────────────── */

.rfq-items-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ──── Cart Item Card ────────────────────────────────────────────────────── */

.rfq-cart-item {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--rfq-border);
  display: grid;
  gap: 10px;
}

.rfq-cart-item-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.rfq-cart-item-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rfq-cart-item-title {
  font-weight: 600;
  color: var(--rfq-dark);
  font-size: 14px;
  line-height: 1.3;
}

.rfq-cart-item-meta {
  font-size: 12px;
  color: #6b7280;
}

.rfq-cart-item-price {
  font-weight: 600;
  color: var(--rfq-accent);
  font-size: 13px;
}

.rfq-cart-item-thumbnail {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--rfq-border);
  flex-shrink: 0;
}

/* ──── Config pill ───────────────────────────────────────────────────────── */

.rfq-cart-config {
  background: #f3f4f6;
  border-left: 3px solid var(--rfq-accent);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  color: #374151;
  line-height: 1.4;
}

/* ──── Item Actions row ──────────────────────────────────────────────────── */

.rfq-cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rfq-cart-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.rfq-cart-qty input {
  width: 60px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--rfq-border);
  font-size: 12px;
  text-align: center;
}

.rfq-item-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rfq-btn-configure {
  border: 1px solid var(--rfq-border);
  background: #fff;
  color: var(--rfq-dark);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.rfq-btn-configure:hover {
  background: var(--rfq-light);
  border-color: #9ca3af;
}

.rfq-cart-remove {
  border: none;
  background: none;
  color: #dc2626;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.rfq-cart-remove:hover {
  color: #b91c1c;
}

/* ──── Notes (collapsible) ───────────────────────────────────────────────── */

.rfq-cart-item-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rfq-cart-note-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  padding: 2px 0;
  background: none;
  border: none;
  transition: color 0.15s;
}

.rfq-cart-note-toggle:hover {
  color: var(--rfq-dark);
}

.rfq-note-triangle {
  font-size: 10px;
  color: #9ca3af;
  transition: transform 0.2s ease;
  display: inline-flex;
}

.rfq-cart-note-toggle.is-expanded .rfq-note-triangle {
  transform: rotate(90deg);
}

.rfq-cart-note-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.25s ease;
}

.rfq-cart-note-content.is-expanded {
  max-height: 200px;
  opacity: 1;
}

.rfq-cart-note-content textarea {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--rfq-border);
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
}

.rfq-cart-item-total {
  font-weight: 600;
  color: var(--rfq-dark);
  font-size: 12px;
}

/* ──── Panel Footers ─────────────────────────────────────────────────────── */

.rfq-panel-footer {
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid var(--rfq-border);
  padding: 14px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rfq-subtotal {
  font-weight: 600;
  color: var(--rfq-dark);
  font-size: 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rfq-border);
}

.rfq-footer-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rfq-cart-clear {
  flex: 0 0 auto;
  border: 1px solid var(--rfq-border);
  background: #fff;
  color: #6b7280;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.rfq-cart-clear:hover {
  background: var(--rfq-light);
}

.rfq-btn-continue {
  flex: 1;
  border: none;
  background: var(--rfq-dark);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}

.rfq-btn-continue:hover {
  background: #1f2937;
}

/* Contact panel footer */

.rfq-btn-back {
  flex: 0 0 auto;
  border: 1px solid var(--rfq-border);
  background: #fff;
  color: #6b7280;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.rfq-btn-back:hover {
  background: var(--rfq-light);
}

.rfq-btn-submit {
  flex: 1;
  border: none;
  background: var(--rfq-accent);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}

.rfq-btn-submit:hover {
  background: #b71c1c;
}

/* ──── Contact Panel — Summary Bar ──────────────────────────────────────── */

.rfq-contact-summary {
  border: 1px solid var(--rfq-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  flex-shrink: 0;
}

.rfq-summary-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--rfq-dark);
  transition: background 0.15s;
}

.rfq-summary-toggle-btn:hover {
  background: var(--rfq-light);
}

.rfq-summary-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.rfq-summary-sep {
  color: #d1d5db;
}

.rfq-summary-chevron {
  font-size: 11px;
  color: #9ca3af;
  transition: transform 0.2s;
}

/* Expanded item list — fixed height, scrollable */

.rfq-summary-detail {
  border-top: 1px solid var(--rfq-border);
}

.rfq-summary-detail[hidden] {
  display: none;
}

.rfq-summary-scroll {
  max-height: 220px;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ──── Summary Item (inside the expandable scroll area) ─────────────────── */

/* ──── Contact Form inside drawer ───────────────────────────────────────── */

#rfq-contact-form .form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--rfq-dark);
  margin-bottom: 4px;
}

#rfq-contact-form .form-control {
  font-size: 13px;
  border-radius: 8px;
  border-color: var(--rfq-border);
}

#rfq-contact-form .form-control:focus {
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.2);
}

/* ──── Success State ─────────────────────────────────────────────────────── */

/* ──── Responsive ────────────────────────────────────────────────────────── */

