:root {
  --cart-line: #e5e5e7;
  --cart-muted: #808086;
  --cart-soft: #f7f7f8;
  --cart-danger: #ff3b30;
}

.cart-page {
  width: 100%;
  min-width: 0;
  min-height: 620px;
  background: #fff;
  padding: 30px 0 76px;
}

.cart-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: #99999f;
  font-size: 12px;
  font-weight: 500;
}

.cart-breadcrumbs a { color: inherit; }
.cart-breadcrumbs a:hover { color: #111; }

.cart-page h1 {
  margin: 0 0 28px;
  color: #0b0b0c;
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 800;
  letter-spacing: -1.4px;
  text-transform: uppercase;
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 354px;
  gap: 26px;
  align-items: start;
}

.cart-products-panel { min-width: 0; }

.cart-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 6px 12px;
}

.cart-page-status {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #d9d9dc;
  border-radius: 10px;
  background: #f7f7f8;
  color: #55555b;
  font-size: 12px;
  line-height: 1.45;
}
.cart-page-status[hidden] { display: none; }
.cart-page-status[data-state="warning"] { border-color: #eed7a4; background: #fff9ea; color: #76540c; }
.cart-page-status[data-state="error"] { border-color: #efc4c0; background: #fff5f4; color: #9d2921; }

.cart-select-all,
.cart-item-select {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  user-select: none;
}

.cart-select-all input,
.cart-item-select input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.cart-select-all > span,
.cart-item-select > span {
  position: relative;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  border: 1px solid #c9c9ce;
  border-radius: 5px;
  background: #fff;
  transition: .18s ease;
}

.cart-item-select > span { width: 18px; height: 18px; flex-basis: 18px; }
.cart-select-all input:checked + span,
.cart-item-select input:checked + span { background: #0c0c0d; border-color: #0c0c0d; }
.cart-select-all input:focus-visible + span,
.cart-item-select input:focus-visible + span { outline: 3px solid rgba(0, 113, 227, .24); outline-offset: 2px; }
.cart-select-all input:checked + span::after,
.cart-item-select input:checked + span::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.cart-select-all strong { font-size: 13px; font-weight: 600; }

.cart-clear {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #4e4e52;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s ease;
}

.cart-clear svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cart-clear:hover { color: var(--cart-danger); }
.cart-clear:disabled { opacity: .35; cursor: default; }

.cart-items { display: grid; gap: 12px; }

.cart-loading,
.cart-empty-state {
  display: grid;
  place-items: center;
  min-height: 310px;
  padding: 48px 24px;
  border: 1px solid var(--cart-line);
  border-radius: 18px;
  color: var(--cart-muted);
  text-align: center;
}

.cart-empty-state svg { width: 52px; height: 52px; margin-bottom: 18px; fill: none; stroke: #111; stroke-width: 1.35; }
.cart-empty-state h2 { margin: 0 0 8px; color: #111; font-size: 22px; }
.cart-empty-state p { max-width: 440px; margin: 0 0 24px; font-size: 13px; line-height: 1.65; }
.cart-empty-state a { display: inline-flex; align-items: center; justify-content: center; min-width: 190px; height: 45px; border-radius: 10px; background: #0b0b0c; color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase; }

.cart-product-card {
  position: relative;
  display: grid;
  grid-template-columns: 28px 176px minmax(0, 1fr) 148px;
  gap: 18px;
  min-height: 216px;
  padding: 19px 20px 19px 16px;
  overflow: hidden;
  border: 1px solid var(--cart-line);
  border-radius: 18px;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.cart-product-card:hover { border-color: #cdcdcf; box-shadow: 0 12px 36px rgba(0,0,0,.045); }
.cart-product-card:not(.is-selected) { opacity: .62; }
.cart-product-card.is-unavailable { opacity: .58; }
.cart-product-unavailable { margin-top: 7px; color: #b23a32; font-size: 11px; font-weight: 650; }
.cart-item-select { align-self: center; justify-self: center; }

.cart-product-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border-radius: 13px;
  background: #fafafa;
}

.cart-product-media img {
  display: block;
  width: 100%;
  height: 174px;
  padding: 8px;
  object-fit: contain;
}

.cart-product-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: calc(100% - 16px);
}

.cart-product-badges .badge { padding: 4px 8px; border-radius: 7px; font-size: 8px; }
.cart-discount-badge { background: var(--cart-danger); }

.cart-product-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 6px 0 2px;
}

.cart-product-code { margin-bottom: 7px; color: #9b9ba0; font-size: 10px; font-weight: 500; }
.cart-product-title { width: fit-content; max-width: 100%; color: #111; font-size: 16px; font-weight: 750; line-height: 1.35; }
.cart-product-title:hover { text-decoration: underline; text-underline-offset: 3px; }

.cart-product-card .compact-specs {
  grid-template-columns: repeat(2, minmax(0, 190px));
  gap: 9px 18px;
  margin: 17px 0 12px;
}

.cart-product-card .spec-item { font-size: 10.5px; }
.cart-product-card .spec-icon { width: 15px; height: 15px; }
.cart-rating-row { display: flex; align-items: center; min-height: 18px; margin-top: auto; }
.cart-rating-row .rating-box { gap: 4px; }

.cart-addons { display: grid; gap: 5px; margin-top: 10px; }
.cart-addon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 410px;
  padding: 6px 9px;
  border-radius: 7px;
  background: var(--cart-soft);
  color: #525256;
  font-size: 9.5px;
  line-height: 1.35;
}
.cart-addon strong { flex: none; color: #111; font-weight: 650; }

.cart-product-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  padding: 4px 0;
}

.cart-remove-item {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #949499;
  cursor: pointer;
  transition: .2s ease;
}

.cart-remove-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.cart-remove-item:hover { background: #fff1f0; color: var(--cart-danger); }

.cart-price-stack { display: flex; flex-direction: column; align-items: flex-end; margin-top: auto; }
.cart-price-old { display: flex; min-height: 14px; align-items: center; justify-content: flex-end; gap: 6px; margin-bottom: 4px; }
.cart-price-old.is-empty { visibility: hidden; }
.cart-price-old del { color: #99999f; font-size: 11px; font-weight: 500; }
.cart-price-old span { color: var(--cart-danger); font-size: 10px; font-weight: 750; }
.cart-price-current { color: #0b0b0c; font-size: 19px; font-weight: 750; white-space: nowrap; }

.cart-qty-control {
  display: grid;
  grid-template-columns: 30px 38px 30px;
  height: 34px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #dedee1;
  border-radius: 8px;
}

.cart-qty-control button,
.cart-qty-control span { display: grid; place-items: center; border: 0; background: #fff; color: #111; font-family: inherit; font-size: 13px; }
.cart-qty-control button { cursor: pointer; }
.cart-qty-control button:hover { background: #f3f3f4; }
.cart-qty-control button:disabled { color: #b8b8bd; cursor: default; }
.cart-qty-control button:focus-visible,
.cart-remove-item:focus-visible,
.cart-clear:focus-visible,
.cart-checkout:focus-visible,
.cart-continue:focus-visible { outline: 3px solid rgba(0, 113, 227, .24); outline-offset: 2px; }
.cart-qty-control span { font-size: 12px; font-weight: 650; }

.cart-sidebar { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 14px; }
.cart-summary-card { position: static; padding: 23px; border: 1px solid var(--cart-line); border-radius: 18px; background: #fff; }
.cart-summary-card h2 { margin: 0 0 24px; font-size: 21px; font-weight: 800; letter-spacing: -.4px; text-transform: uppercase; }
.cart-summary-row { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 20px; color: #66666b; font-size: 12px; }
.cart-summary-row[hidden] { display: none; }
.cart-summary-row strong { color: #111; font-size: 13px; font-weight: 600; }
.cart-summary-row.is-discount strong { color: var(--cart-danger); }
.cart-summary-total { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 21px; border-top: 1px solid var(--cart-line); font-size: 14px; font-weight: 650; }
.cart-summary-total strong { font-size: 23px; font-weight: 800; }
.cart-checkout,
.cart-continue { display: flex; align-items: center; justify-content: center; width: 100%; height: 47px; border-radius: 9px; font-family: inherit; font-size: 11px; font-weight: 750; text-transform: uppercase; }
.cart-checkout { margin-top: 26px; border: 1px solid #0b0b0c; background: #0b0b0c; color: #fff; cursor: pointer; transition: .2s ease; }
.cart-checkout:hover { background: #29292b; }
.cart-checkout:disabled { border-color: #d8d8dc; background: #d8d8dc; cursor: default; }
.cart-continue { margin-top: 9px; border: 1px solid #d4d4d7; color: #111; transition: .2s ease; }
.cart-continue:hover { border-color: #111; }

@media (max-width: 1050px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; }
  .cart-product-card { grid-template-columns: 26px 145px minmax(0, 1fr) 126px; gap: 14px; padding-right: 16px; }
  .cart-product-media img { height: 150px; }
}

@media (max-width: 820px) {
  .cart-page { padding-top: 22px; }
  .cart-layout { grid-template-columns: minmax(0, 1fr); }
  .cart-sidebar { grid-row: auto; }
}

@media (max-width: 767px) {
  .cart-page { min-height: 0; padding: 18px 0 36px; }
  .cart-page > .container { padding-inline: var(--mobile-gutter, 16px); }
  .cart-page :is(.container, .cart-layout, .cart-products-panel, .cart-items, .cart-summary-card, .cart-empty-state, .cart-empty-state > div) { min-width: 0; max-width: 100%; }
  .cart-items, .cart-empty-state, .cart-loading { grid-template-columns: minmax(0, 1fr); }
  .cart-empty-state p { overflow-wrap: anywhere; }
  .cart-empty-state a { min-width: 0; max-width: 100%; height: auto; min-height: 44px; padding: 12px; }
  .cart-breadcrumbs { display: flex; margin-bottom: 16px; font-size: 12px; }
  .cart-page h1 { margin-bottom: 18px; font-size: 32px; line-height: 1.1; letter-spacing: -1px; }
  .cart-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cart-list-toolbar { flex-wrap: wrap; gap: 4px 12px; padding: 0 0 10px; }
  .cart-select-all { gap: 8px; min-height: 40px; }
  .cart-select-all strong { font-size: 12px; font-weight: 500; }
  .cart-clear { min-height: 40px; gap: 6px; font-size: 12px; font-weight: 500; }
  .cart-clear svg { flex: none; width: 17px; height: 17px; }
  .cart-select-all input:indeterminate + span { background: #111; border-color: #111; }
  .cart-select-all input:indeterminate + span::after { content: ''; position: absolute; inset: 8px 4px; height: 2px; background: #fff; }
  .cart-items { gap: 12px; }
  .cart-product-card { grid-template-columns: minmax(0, .85fr) minmax(0, 1.45fr); grid-template-rows: auto auto auto auto auto auto; gap: 8px 12px; min-height: 0; padding: 14px 12px; border-radius: 16px; box-shadow: none; }
  .cart-product-card:hover { box-shadow: none; }
  .cart-item-select { position: absolute; top: 6px; left: 6px; width: 36px; height: 36px; justify-content: center; z-index: 3; }
  .cart-product-media { grid-column: 1; grid-row: 1 / 5; align-self: stretch; margin-top: 28px; border-radius: 10px; }
  .cart-product-media img { width: 100%; height: 100%; min-height: 110px; max-height: 180px; padding: 5px; }
  .cart-product-badges { top: 6px; left: 6px; }
  .cart-product-badges .badge { padding: 4px 6px; font-size: 10px; border-radius: 6px; }
  .cart-product-main, .cart-product-side { display: contents; }
  .cart-product-code { grid-column: 2; grid-row: 1; padding-right: 20px; margin: 0; font-size: 10px; line-height: 1.5; }
  .cart-product-title { grid-column: 2; grid-row: 2; padding-right: 8px; font-size: 13px; line-height: 1.35; font-weight: 750; overflow-wrap: anywhere; }
  .cart-product-card .compact-specs { grid-column: 2; grid-row: 3; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 6px; margin: 2px 0; }
  .cart-product-card .spec-item { display: flex; align-items: flex-start; gap: 4px; min-width: 0; font-size: 10px; line-height: 1.45; }
  .cart-product-card .spec-item span { white-space: normal; overflow-wrap: anywhere; }
  .cart-product-card .spec-icon { flex: none; width: 12px; height: 14px; }
  .cart-remove-item { position: absolute; top: 4px; right: 3px; width: 36px; height: 36px; }
  .cart-price-stack { grid-column: 2; grid-row: 4; align-items: flex-start; align-self: end; margin: 3px 0 0; }
  .cart-price-old { justify-content: flex-start; margin-bottom: 3px; gap: 6px; }
  .cart-price-old.is-empty { display: none; }
  .cart-price-old del, .cart-price-old span { font-size: 11px; }
  .cart-price-current { font-size: 21px; line-height: 1.2; letter-spacing: -.5px; }
  .cart-rating-row { grid-column: 1; grid-row: 5; align-self: center; margin: 4px 0 0; flex-wrap: wrap; }
  .cart-rating-row .rating-box { flex-wrap: wrap; gap: 3px; }
  .cart-rating-row .reviews-count { font-size: 10px; white-space: normal; }
  .cart-qty-control { grid-column: 2; grid-row: 5; justify-self: end; grid-template-columns: 36px 32px 36px; height: 38px; margin: 4px 0 0; border-radius: 9px; }
  .cart-qty-control button { font-size: 17px; }
  .cart-qty-control span { font-size: 13px; }
  .cart-addons { grid-column: 1 / -1; grid-row: 6; margin: 0; }
  .cart-addon { max-width: none; padding: 8px; font-size: 11px; }
  .cart-product-unavailable { grid-column: 1 / -1; grid-row: 7; margin: 0; }
  .cart-summary-card { padding: 18px 14px; border-radius: 16px; }
  .cart-summary-card h2 { margin-bottom: 20px; font-size: 23px; }
  .cart-summary-row { flex-wrap: wrap; margin-bottom: 14px; font-size: 14px; }
  .cart-summary-row strong { font-size: 14px; white-space: nowrap; }
  .cart-summary-total { flex-wrap: wrap; padding-top: 16px; gap: 12px; font-size: 16px; }
  .cart-summary-total strong { font-size: 26px; white-space: nowrap; }
  .cart-checkout, .cart-continue { height: auto; min-height: 48px; padding: 12px 8px; font-size: 12px; line-height: 1.4; text-align: center; border-radius: 10px; }
  .cart-checkout { margin-top: 20px; }
  .cart-continue { margin-top: 9px; }
  .cart-loading, .cart-empty-state { min-height: 260px; padding: 32px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .cart-product-card,
  .cart-product-card *,
  .cart-page-status { scroll-behavior: auto; transition: none; animation: none; }
}
