:root {
  --yellow: #ffe600;
  --blue: #3483fa;
  --blue-hover: #2968c8;
  --green: #00a650;
  --text: rgba(0, 0, 0, .9);
  --muted: rgba(0, 0, 0, .55);
  --line: rgba(0, 0, 0, .1);
  --background: #ededed;
  --white: #fff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: "Proxima Nova", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

.cart-header {
  height: 64px;
  background: var(--yellow);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .1);
}

.cart-header-inner {
  width: min(1184px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
}

.cart-logo { display: block; flex: 0 0 auto; }
.cart-logo img { display: block; width: 134px; height: 34px; object-fit: contain; }

.cart-shell {
  width: min(1184px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.cart-title {
  min-height: 36px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
}

.cart-title h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.3px; }

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

.cart-list,
.cart-summary {
  overflow: hidden;
  background: var(--white);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

.cart-loading,
.cart-empty,
.cart-error {
  min-height: 320px;
  padding: 64px 32px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.cart-empty h2,
.cart-error h2 { margin: 0 0 10px; font-size: 21px; font-weight: 600; }
.cart-empty::before {
  content: "";
  width: 64px;
  height: 64px;
  margin-bottom: 22px;
  background: url('/assets/navigation/cart.svg?v=3') center / 52px 52px no-repeat;
  opacity: .72;
}
.cart-empty p,
.cart-error p,
.cart-loading { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.cart-empty a,
.cart-error button {
  margin-top: 22px;
  padding: 12px 20px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.cart-item {
  min-height: 158px;
  padding: 24px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) minmax(110px, auto);
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid var(--line);
}

.cart-item:last-child { border-bottom: 0; }

.cart-item-image {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 5px;
}

.cart-item-image img { width: 100%; height: 100%; padding: 5px; object-fit: contain; }
.cart-item-info { min-width: 0; }

.cart-item h2 {
  margin: 0 0 9px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
}

.cart-item h2 a { color: var(--text); text-decoration: none; }
.cart-item h2 a:hover { color: var(--blue); }
.cart-item-shipping { display: block; margin-bottom: 18px; color: var(--green); font-size: 13px; font-weight: 600; }

.cart-actions { display: flex; align-items: center; gap: 16px; }

.cart-quantity {
  height: 36px;
  display: inline-grid;
  grid-template-columns: 34px 38px 34px;
  align-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 6px;
}

.cart-quantity button,
.cart-remove {
  border: 0;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
}

.cart-quantity button { height: 100%; padding: 0; font-size: 20px; line-height: 1; }
.cart-quantity button:hover { background: #f5f5f5; }
.cart-quantity button:disabled { color: #aaa; cursor: wait; }
.cart-quantity span { font-size: 14px; text-align: center; }
.cart-remove { padding: 8px 0; font-size: 13px; }
.cart-remove:hover { color: var(--blue-hover); }

.cart-item-price { align-self: start; padding-top: 5px; font-size: 21px; font-weight: 500; white-space: nowrap; }

.cart-summary {
  position: sticky;
  top: 24px;
  padding: 26px 24px 22px;
}

.cart-summary h2 { margin: 0 0 22px; font-size: 20px; font-weight: 600; }

.summary-row,
.summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.summary-row { padding: 9px 0; color: rgba(0, 0, 0, .72); font-size: 14px; }
.summary-shipping strong { color: var(--green); font-weight: 500; }
.summary-total { margin-top: 16px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 18px; }
.summary-total strong { font-size: 24px; font-weight: 500; white-space: nowrap; }

#checkout-button {
  width: 100%;
  min-height: 48px;
  margin-top: 24px;
  padding: 0 18px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

#checkout-button:hover:not(:disabled) { background: var(--blue-hover); }
#checkout-button:disabled { background: #b9cbea; cursor: not-allowed; }

@media (max-width: 900px) {
  .cart-shell { width: min(760px, calc(100% - 32px)); }
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
}

@media (max-width: 600px) {
  .cart-header { height: 58px; }
  .cart-header-inner { width: calc(100% - 24px); }
  .cart-logo img { width: 112px; height: auto; }
  .cart-shell { width: 100%; padding: 22px 10px 40px; }
  .cart-title { min-height: 0; margin: 0 4px 18px; align-items: flex-start; }
  .cart-title h1 { font-size: 22px; }
  .cart-layout { gap: 14px; }
  .cart-item { min-height: 0; padding: 18px 14px; grid-template-columns: 82px minmax(0, 1fr); align-items: start; gap: 14px; }
  .cart-item-image { width: 82px; height: 82px; }
  .cart-item h2 { margin-top: 1px; font-size: 14px; }
  .cart-item-shipping { margin-bottom: 14px; }
  .cart-actions { gap: 12px; flex-wrap: wrap; }
  .cart-item-price { grid-column: 2; padding: 0; font-size: 19px; }
  .cart-summary { padding: 24px 18px 20px; }
  .cart-loading, .cart-empty, .cart-error { min-height: 280px; padding: 50px 22px; }
}

@media (max-width: 360px) {
  .cart-item { grid-template-columns: 70px minmax(0, 1fr); padding-inline: 10px; gap: 10px; }
  .cart-item-image { width: 70px; height: 70px; }
  .cart-actions { align-items: flex-start; flex-direction: column; gap: 4px; }
}
