/**
 * LBT Devis – Front-end CSS
 * Clean, unobtrusive design. No AI-looking icons or loud borders.
 */

/* ── Buttons ── */
.lbt-devis-btn-cart,
.lbt-devis-btn-product {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.lbt-devis-btn-cart:hover,
.lbt-devis-btn-product:hover { opacity: 0.88; }

/* ── Note card (cart) ── */
.lbt-devis-note-card {
  margin-top: 0.75rem;
  padding: 1rem;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
}

.lbt-devis-note-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ── Product feedback (AJAX) ── */
.lbt-devis-product-feedback {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
}

.lbt-devis-product-feedback.is-success {
  background: #f0fdf4;
  color: #166534;
}

.lbt-devis-product-feedback.is-error {
  background: #fef2f2;
  color: #991b1b;
}

/* ── Top bar (detail page) ── */
.lbt-devis-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.lbt-devis-topbar__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.lbt-devis-topbar__dates {
  color: #6b7280;
  font-size: 0.875rem;
}

.lbt-devis-topbar__actions {
  display: flex;
  gap: 0.5rem;
}

/* ── Order banner ── */
.lbt-devis-order-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f0fdf4;
  color: #166534;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

/* ── Sections ── */
.lbt-devis-section {
  margin-bottom: 2rem;
}

.lbt-devis-section__title {
  font-weight: 600;
  font-size: 1rem;
  color: #111827;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

/* ── Tables ── */
.lbt-devis-table {
  font-size: 0.9375rem;
}

.lbt-devis-table thead th {
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  background: transparent;
}

.lbt-devis-table tbody tr:hover {
  background: #f9fafb;
}

.lbt-tfoot-row td {
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 0.875rem;
}

.lbt-tfoot-row--saving td {
  color: #15803d;
  font-size: 0.875rem;
}

.lbt-tfoot-row--total td {
  font-weight: 700;
  font-size: 1rem;
  color: #111827;
  border-top: 2px solid #e5e7eb;
}

.lbt-price-highlight {
  font-weight: 600;
}

.lbt-saving {
  color: #15803d;
}

/* ── Decision bar ── */
.lbt-devis-decision-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-radius: 4px;
  margin-bottom: 2rem;
}

.lbt-devis-decision-bar__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Messages ── */
.lbt-devis-messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.lbt-devis-msg {
  padding: 0.75rem 1rem;
  border-radius: 4px;
}

.lbt-devis-msg--customer {
  background: #f0f9ff;
}

.lbt-devis-msg--admin {
  background: #f0fdf4;
}

.lbt-devis-msg--system {
  background: #f9fafb;
  font-size: 0.85rem;
  color: #6b7280;
  font-style: italic;
}

.lbt-devis-msg-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.3rem;
}

.lbt-devis-msg-author {
  font-weight: 600;
  font-size: 0.875rem;
  color: #1f2937;
}

.lbt-devis-msg-date {
  color: #9ca3af;
  font-size: 0.8125rem;
}

.lbt-devis-msg-body {
  font-size: 0.9375rem;
  color: #374151;
  line-height: 1.5;
}

/* ── Reply form ── */
.lbt-devis-reply-form {
  margin-top: 1rem;
}

/* ── Draft banner ── */
.lbt-devis-draft-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #eff6ff;
  color: #1e40af;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

/* ── Action cells ── */
.lbt-actions-cell {
  white-space: nowrap;
}

.lbt-actions-cell .btn + .btn {
  margin-left: 0.25rem;
}

/* ── Product fields ── */
.lbt-devis-product-name {
  font-weight: 500;
  color: #111827;
}

.lbt-devis-product-attr {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-top: 0.1rem;
}

.lbt-product-link {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.lbt-product-link:hover {
  text-decoration: underline;
}

/* ── Status badges – native colour pills ── */
.lbt-badge {
  display: inline-block;
  padding: 0.2em 0.55em;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  border-radius: 3px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.lbt-badge--pending    { background: #fef3c7; color: #92400e; }
.lbt-badge--in_review  { background: #e0f2fe; color: #0369a1; }
.lbt-badge--quoted     { background: #e0e7ff; color: #3730a3; }
.lbt-badge--accepted   { background: #dcfce7; color: #15803d; }
.lbt-badge--rejected   { background: #fee2e2; color: #991b1b; }
.lbt-badge--converted  { background: #f3f4f6; color: #1f2937; }
.lbt-badge--expired    { background: #f3f4f6; color: #6b7280; }

/* ── Customer account menu entry ── */
.lbt-menu-count {
  display: inline-block;
  min-width: 1.25rem;
  height: 1.25rem;
  line-height: 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50%;
  background: #1d4ed8;
  color: #fff;
  padding: 0 0.3rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* ── Cart separator ── */
.lbt-devis-cart-wrapper {
  margin-top: 0.75rem;
}

.lbt-devis-cart-separator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: #9ca3af;
  font-size: 0.8125rem;
}

.lbt-devis-cart-separator::before,
.lbt-devis-cart-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

/* ── Product action row (button + tooltip) ── */
.lbt-devis-product-action-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Info tooltip trigger ── */
.lbt-devis-info-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: #e5e7eb;
  color: #374151;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: help;
  flex-shrink: 0;
  user-select: none;
}

.lbt-devis-info-trigger:focus {
  outline: 2px solid #60a5fa;
  outline-offset: 1px;
}

.lbt-devis-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  width: 16rem;
  padding: 0.6rem 0.75rem;
  background: #1f2937;
  color: #f9fafb;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.5;
  border-radius: 4px;
  pointer-events: none;
  z-index: 100;
  text-align: left;
  white-space: normal;
}

.lbt-devis-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f2937;
}

.lbt-devis-info-trigger:hover .lbt-devis-tooltip,
.lbt-devis-info-trigger:focus .lbt-devis-tooltip {
  display: block;
}

/* ── Listing price=0 CTA ── */
.lbt-devis-listing-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.lbt-devis-listing-price-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #6b7280;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.lbt-devis-btn-listing {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  transition: opacity 0.15s ease;
}

.lbt-devis-btn-listing:hover {
  opacity: 0.88;
}
