/* ==========================================================================
   Cart — page styles (loads after base.css and checkout.css)
   ========================================================================== */

.cart__head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
}

.cart__count {
  flex: none;
  white-space: nowrap;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}

/* --- Line items ---------------------------------------------------------- */
.line {
  border-color: rgba(244, 241, 228, 0.18);
  padding: 22px;
}

.line__top {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.line__thumb {
  position: relative;
  border: 1px solid rgba(244, 241, 228, 0.18);
}
.line__thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(1.08);
}

.line__body { min-width: 0; }

.line__row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
  flex-wrap: wrap;
}

.line__kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.line__title {
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: 0.02em;
  margin: 0;
}

.line__note {
  font-size: 13.5px;
  color: var(--color-text-dim);
  margin: 8px 0 0;
}

.line__prices {
  text-align: right;
  margin-left: auto;
}

.line__price {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 30px;
  line-height: 1;
  white-space: nowrap;
}

.line__currency {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-top: 6px;
}

/* --- Configured spec chips (chip styles live in checkout.css) ----------- */
.line__specs {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

/* --- Quantity stepper ---------------------------------------------------- */
.qty {
  margin-top: 14px;
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(244, 241, 228, 0.18);
  margin-left: auto;
  width: fit-content;
}

.qty__btn {
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.qty__btn:hover { color: var(--color-accent); }

.qty__value {
  min-width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 17px;
  border-left: 1px solid rgba(244, 241, 228, 0.18);
  border-right: 1px solid rgba(244, 241, 228, 0.18);
}

.qty__note {
  font-size: 11.5px;
  color: var(--color-text-dim);
  margin-top: var(--space-2);
}

/* --- Line footer actions ------------------------------------------------- */
.line__actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-divider);
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
.line__actions--right { justify-content: flex-end; }

.line__edit {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

/* The export drew this as a button on both lines. It still is on a recoil pad, but a
   configuration's is a link to the confirmation, so the rule now has to dress an
   anchor too — hence `text-decoration`, which a button never needed. */
.line__remove {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-text-dim);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.line__remove:hover { color: var(--color-accent); }

/* --- Summary extras ------------------------------------------------------ */
.summary__aside {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(244, 241, 228, 0.18);
}
.summary__aside a {
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.summary__aside p {
  font-size: 12.5px;
  color: var(--color-text-dim);
  margin: 8px 0 0;
  line-height: 1.55;
}

/* --- Empty state --------------------------------------------------------- */
.cart-empty {
  position: relative;
  margin-top: 34px;
  border: 1px solid rgba(244, 241, 228, 0.18);
  padding: 64px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cart-empty__title {
  font-size: 28px;
  letter-spacing: 0.02em;
  margin: 20px 0 0;
}

.cart-empty__body {
  font-size: 15px;
  color: var(--color-text-dim);
  margin: 10px 0 26px;
  max-width: 44ch;
  line-height: 1.6;
}

/* --- Removal confirm dialog --------------------------------------------- */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(6, 12, 9, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* The export had this dialog commented out of the document; it is in the document
   now, one per configuration line, and hidden until the server or the script opens
   one. The rule is needed rather than tidy: `display: flex` above outranks the
   `display: none` a browser gives `[hidden]`, so without this a closed dialog would
   cover the cart. */
.dialog-backdrop[hidden] {
  display: none;
}

.dialog {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--color-surface);
  border: 1px solid rgba(244, 241, 228, 0.24);
  padding: 28px;
}

.dialog__title {
  font-size: 24px;
  letter-spacing: 0.02em;
  margin: 0;
}

.dialog__body {
  font-size: 14.5px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 12px 0 26px;
}

.dialog__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 620px) {
  .line__top {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .line__thumb { max-width: 200px; }
  .line__specs { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .cart-empty { padding: 40px 22px; }
}
