/* Avis Live Buy List — uses theme-avisbuy tokens from styles.css */

.lb-page {
  padding-bottom: 5.5rem;
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.lb-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.lb-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}

.lb-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.lb-brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--brand-mark-bg, var(--accent));
  color: var(--accent-text, #fff);
}

.lb-brand-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.15;
}

.lb-brand-tag {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.lb-header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lb-header-nav a:not(.btn) {
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
}

.lb-header-cta {
  display: none;
}

@media (min-width: 720px) {
  .lb-header-cta {
    display: inline-flex;
  }
}

.lb-hero {
  padding: 1.5rem 0 1rem;
}

.lb-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.lb-hero-lead {
  margin: 0 0 0.5rem;
  color: var(--muted);
  max-width: 36rem;
  line-height: 1.5;
}

.lb-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.lb-sticky-search {
  position: sticky;
  top: 3.4rem;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0 0.75rem;
}

.lb-search-field input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-body);
}

.lb-search-field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.lb-cats {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.65rem 0 0.15rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.lb-cat {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.lb-cat.is-active {
  background: var(--accent);
  color: var(--accent-text, #fff);
  border-color: var(--accent);
}

.lb-filter-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.75rem 0 1rem;
}

.lb-loading {
  padding: 2rem 0;
  color: var(--muted);
}

/* Desktop table */
.lb-desktop {
  display: none;
}

@media (min-width: 900px) {
  .lb-desktop {
    display: block;
  }
  .lb-mobile {
    display: none !important;
  }
  .lb-page {
    padding-bottom: 2rem;
  }
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.lb-table th,
.lb-table td {
  text-align: left;
  padding: 0.7rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.lb-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.lb-table .money {
  color: var(--money);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lb-table .model-cell {
  font-weight: 600;
}

.lb-table .sub {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}

/* Mobile cards */
.lb-mobile {
  display: grid;
  gap: 0.75rem;
}

.lb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.95rem 1rem;
}

.lb-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.lb-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.lb-card-meta {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.lb-card-price {
  color: var(--money);
  font-weight: 700;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lb-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.lb-card-updated {
  font-size: 0.75rem;
  color: var(--muted);
}

.lb-btn-add {
  flex-shrink: 0;
}

.lb-disclaimer {
  margin: 2rem auto 1.5rem;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--accent-secondary, var(--accent));
  background: var(--surface);
  border-radius: 0 10px 10px 0;
}

.lb-disclaimer p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.lb-safe {
  margin-top: 0.65rem !important;
  color: var(--muted);
  font-size: 0.85rem !important;
}

.lb-footer {
  margin-top: 1rem;
}

/* Drawer */
.lb-drawer[hidden] {
  display: none !important;
}

.lb-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.lb-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.lb-drawer-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(92vh, 720px);
  overflow: auto;
  background: var(--bg);
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  animation: lb-slide-up 0.22s ease-out;
}

@media (min-width: 720px) {
  .lb-drawer-panel {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100% - 2rem));
    border-radius: 14px;
    max-height: min(85vh, 680px);
    animation: none;
  }
}

@keyframes lb-slide-up {
  from {
    transform: translateY(12%);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.lb-drawer-head,
.lb-drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}

.lb-drawer-foot {
  border-bottom: 0;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.lb-drawer-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.lb-drawer-body {
  padding: 1rem;
}

.lb-icon-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
}

.lb-field {
  margin-bottom: 1rem;
}

.lb-field label,
.lb-field-legend {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.lb-field select,
.lb-field input[type='number'],
.lb-field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.lb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.lb-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.lb-chip.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
}

.lb-chip.is-danger.is-active {
  border-color: #ef4444;
  background: color-mix(in srgb, #ef4444 14%, var(--surface));
}

.lb-estimate-box {
  margin-top: 1rem;
  padding: 0.85rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.lb-estimate-box dl {
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.lb-estimate-box dt,
.lb-estimate-box dd {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
}

.lb-estimate-box .adj {
  color: var(--muted);
}

.lb-estimate-box .total {
  font-weight: 700;
  color: var(--money);
  border-top: 1px solid var(--border);
  padding-top: 0.45rem;
  margin-top: 0.25rem;
}

.lb-blocked {
  color: #b91c1c;
  font-size: 0.88rem;
  margin: 0.5rem 0 0;
  line-height: 1.4;
}

/* Offer panel */
.lb-offer-panel[hidden] {
  display: none !important;
}

.lb-offer-panel {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 900px) {
  .lb-offer-panel {
    inset: auto;
    top: 5.5rem;
    right: 1rem;
    bottom: 1rem;
    width: min(360px, calc(100vw - 2rem));
    background: transparent;
    align-items: stretch;
  }
}

.lb-offer-panel-inner {
  width: 100%;
  max-height: 85vh;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
  padding: 1rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

@media (min-width: 900px) {
  .lb-offer-panel-inner {
    border-radius: 12px;
    max-height: none;
    height: 100%;
  }
}

.lb-offer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.lb-offer-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.lb-offer-items {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.lb-offer-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  background: var(--surface);
}

.lb-offer-item h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.lb-offer-item p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.lb-offer-item-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.45rem;
}

.lb-offer-item-actions button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.lb-offer-disc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0 0 0.75rem;
}

.lb-offer-totals {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.lb-offer-totals strong {
  color: var(--money);
}

.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
}

/* Sticky mobile bar */
.lb-mobile-bar[hidden] {
  display: none !important;
}

.lb-mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 0.65rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}

@media (min-width: 900px) {
  .lb-mobile-bar {
    display: none !important;
  }
}

.lb-mobile-bar-btn {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  background: var(--accent);
  color: var(--accent-text, #fff);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: var(--font-body);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
