/* Quote-list drawer, compare bar + compare window, and the toast.
   The drawer slides in from the left (the far side in RTL), like a cart. */

.drawer, .compare-dialog {
  padding: 0;
  border: 0;
  background: var(--white);
  color: var(--ink);
  overscroll-behavior: contain;
}

.drawer::backdrop, .compare-dialog::backdrop {
  background: rgb(12 36 66 / 0.55);
  overflow: hidden;
  overscroll-behavior: contain;
}

.drawer {
  width: min(28rem, 100%);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto 0 0; /* pinned to the left edge */
}

.drawer[open] {
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease-out;
  @media (prefers-reduced-motion: no-preference) {
    @starting-style { transform: translateX(-100%); }
  }
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--stainless);
}

.drawer-head h2 { font-size: var(--text-h3); }

.drawer-head .dialog-close { position: static; }

.drawer-empty { padding: 1.5rem 1.25rem; color: var(--ink-soft); }
.drawer-empty[hidden], .quote-form[hidden] { display: none; }

.quote-items { list-style: none; margin: 0; padding: 0 1.25rem; overflow-y: auto; flex: 1; }

.quote-item {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.75rem;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--stainless);
}

.quote-item img { width: 3.5rem; height: 3.5rem; object-fit: contain; }
.quote-item-name { font-weight: 600; line-height: 1.3; }
.quote-item-model { font-size: var(--text-small); color: var(--ink-soft); }

.stepper { display: flex; align-items: center; border: 1px solid var(--stainless-dark); border-radius: var(--radius-small); }
.stepper button {
  width: 2.25rem;
  height: 2.5rem;
  border: 0;
  background: none;
  font-size: 1.2rem;
  color: var(--navy);
  cursor: pointer;
}
.stepper button:disabled { color: var(--stainless-dark); cursor: default; }
.stepper output { min-width: 1.5rem; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.quote-remove {
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
}
.quote-remove:hover { background: var(--frost); color: var(--ink); }

.quote-form {
  display: grid;
  gap: 0.6rem;
  padding: 1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--stainless);
  background: var(--frost);
}

.quote-form-note { font-size: var(--text-small); color: var(--ink-soft); }

.quote-form label { display: grid; gap: 0.2rem; font-size: var(--text-small); font-weight: 600; }

.quote-form input {
  min-height: 2.75rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--stainless-dark);
  border-radius: var(--radius-small);
  font: inherit;
  font-weight: 400;
}

.quote-clear { justify-self: center; padding: 0.4rem; border: 0; background: none; color: var(--ink-soft); font: inherit; text-decoration: underline; cursor: pointer; }

/* Compare bar: appears at the bottom once a product is ticked. */
.compare-bar {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  translate: -50% 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-large);
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.3);
}
.compare-bar[hidden] { display: none; }

.compare-thumbs { display: flex; gap: 0.35rem; }
.compare-thumbs img { width: 2.5rem; height: 2.5rem; object-fit: contain; border-radius: 4px; background: var(--white); }

.compare-bar .button-primary { background: var(--white); color: var(--navy); }
.compare-bar .button-primary:disabled { background: transparent; color: #c9d6e4; border-color: #5a7397; cursor: default; }

.compare-clear { padding: 0.4rem; border: 0; background: none; color: #c9d6e4; font: inherit; text-decoration: underline; cursor: pointer; }

/* Compare window */
.compare-dialog { width: min(64rem, 100% - 2rem); max-height: 90dvh; border-radius: var(--radius-large); }

.compare-scroll { overflow-x: auto; padding: 0 1.25rem 1.25rem; }

.compare-table { width: 100%; min-width: 34rem; border-collapse: collapse; }
.compare-table th, .compare-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--stainless); text-align: start; vertical-align: top; }
.compare-table thead th { vertical-align: bottom; font-weight: 600; }
.compare-table thead img { width: 7rem; height: 7rem; object-fit: contain; margin-bottom: 0.4rem; }
.compare-table tbody th { width: 9rem; color: var(--ink-soft); font-weight: 500; font-size: var(--text-small); }
.compare-table tbody tr:nth-child(odd) td, .compare-table tbody tr:nth-child(odd) th { background: var(--frost); }

/* Toast */
.toast {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  translate: -50% 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: calc(100% - 2rem);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-small);
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.3);
}
.toast[hidden] { display: none; }
.toast button { padding: 0.3rem 0.5rem; border: 0; background: none; color: #9fd0f0; font: 600 var(--text-body) / 1 var(--font-body); text-decoration: underline; cursor: pointer; }
.toast button[hidden] { display: none; }

@media (max-width: 52rem) {
  .compare-dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: var(--radius-large) var(--radius-large) 0 0; }
  /* Full-width strip on phones; the corner buttons lift above it while it shows. */
  .compare-bar { inset-inline: 0; bottom: 0; left: 0; translate: none; justify-content: space-between; border-radius: 0; padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom)); }
  body:has(.compare-bar:not([hidden])) :is(.floating-contact, .accessibility) { bottom: 5.25rem; }
  body:has(.compare-bar:not([hidden])) .toast { bottom: 10rem; }
  .quote-item { grid-template-columns: 3rem minmax(0, 1fr) auto; }
  .quote-item .stepper { grid-column: 2; justify-self: start; }
  .quote-remove { grid-row: 1; grid-column: 3; }
}
