/* ==========================================================
   Showstopper — Cart page
   Builds on style.css, category.css (page hero, breadcrumb)
   and product.css (qty stepper, carousel, sr-only)
   ========================================================== */

/* ---------- Layout ---------- */
.cart { padding: 30px 0 50px; }
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 22px;
  align-items: start;
}
.cart-title {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: clamp(26px, 2.6vw, 32px);
  margin: 8px 0 20px;
}
.cart-title .count { color: var(--brown); font-variant-numeric: lining-nums; }
.cart-title::after { content: ""; width: 50px; height: 1.5px; background: var(--gold); }

/* ---------- Items table ---------- */
.cart-head,
.cart-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 100px 120px 96px;
  align-items: center;
  column-gap: 12px;
}
.cart-head {
  padding: 10px 16px 10px 0;
  border-radius: 8px;
  background: #f3e7d8;
  font-size: 14px;
  font-weight: 600;
}
.cart-head span:first-child { grid-column: 1 / 3; padding-left: 44px; }
.cart-head .c-price,
.cart-head .c-qty { text-align: center; }
.cart-head .c-total { text-align: right; }

.cart-item {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--line);
  transition: opacity .3s ease, transform .3s ease;
}
.cart-item.is-removing { opacity: 0; transform: translateX(-12px); }
.remove-item {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
  transition: background .2s, color .2s;
}
.remove-item:hover { background: #f6dcd6; color: var(--red); }
.remove-item svg { width: 14px; height: 14px; }

.item-main {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.item-img {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--cream-2);
}
.item-img img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.item-name {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 6px;
}
.item-name a:hover { color: var(--gold); }
.item-meta { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }
.item-wish {
  float: right;
  margin-top: -6px;
  width: 28px;
  height: 28px;
  border: 0;
  background: none;
  color: var(--brown);
  display: grid;
  place-items: center;
  padding: 0;
}
.item-wish svg { width: 19px; height: 19px; }
.item-wish.is-on svg { --heart-fill: currentColor; color: var(--red); }

.item-price,
.item-total { font-size: 15px; font-weight: 600; }
.item-price { text-align: center; }
.item-total { text-align: right; }
.cart-item .qty { height: 34px; margin: 0 auto; }
.cart-item .qty button { width: 32px; }
.cart-item .qty input { width: 26px; }
.cell-label { display: none; }

.cart-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--brown);
}
.back-link span { text-decoration: underline; text-underline-offset: 4px; }
.back-link svg { width: 18px; height: 18px; transform: rotate(180deg); transition: transform .2s; }
.back-link:hover svg { transform: rotate(180deg) translateX(3px); }
.clear-cart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid #d8cab8;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--brown);
  transition: border-color .2s, background .2s;
}
.clear-cart:hover { border-color: var(--red); background: #fdf3f1; }
.clear-cart svg { width: 16px; height: 16px; }

.cart-empty {
  padding: 50px 20px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.cart-empty h3 { font-size: 22px; margin-bottom: 8px; }
.cart-empty p { color: var(--ink-soft); margin-bottom: 22px; }

/* ---------- Order summary ---------- */
.summary {
  position: sticky;
  top: 96px;
  overflow: hidden;
  background: linear-gradient(180deg, #f5ece1, #faf3ea);
  border-radius: 16px;
  padding: 20px 12px 20px;
}
.summary h2 { font-size: 26px; padding: 0 2px 14px; border-bottom: 1px solid var(--line); }
.sum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.sum-row strong { font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.free-tag {
  padding: 1px 8px;
  border-radius: 4px;
  background: #d9ecd5;
  color: #2f6b38;
  font-size: 11px;
  font-weight: 500;
}
.sum-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 18px;
  padding: 12px 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, #f3dcb3, #f6e6c9);
}
.sum-total span { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.sum-total strong { font-size: 19px; font-weight: 600; color: var(--brown); }
.checkout-btn {
  width: 100%;
  justify-content: center;
  height: 46px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
}
.checkout-btn svg { width: 18px; height: 18px; }
.checkout-btn.is-disabled { opacity: .45; pointer-events: none; }

.coupon {
  margin-top: 14px;
  border: 1.5px solid var(--gold);
  border-radius: 8px;
  background: #fff;
}
.coupon summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 14px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--brown);
  cursor: pointer;
}
.coupon summary::-webkit-details-marker { display: none; }
.coupon summary > svg { width: 22px; height: 22px; color: var(--gold); }
.coupon summary .chev { width: 16px; height: 16px; margin-left: auto; color: var(--ink); transition: transform .2s; }
.coupon[open] summary .chev { transform: rotate(180deg); }
.coupon-form { display: flex; gap: 8px; padding: 0 12px 12px; }
.coupon-form input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d8cab8;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  text-transform: uppercase;
}
.coupon-form input:focus { outline: none; border-color: var(--gold); }
.coupon-form button {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
}
.coupon-msg { padding: 0 12px 12px; font-size: 12px; color: var(--muted); }

.assurance { margin-top: 20px; padding: 0 8px; }
.assurance li { display: flex; align-items: center; gap: 16px; }
.assurance li + li { margin-top: 14px; }
.assurance svg { width: 30px; height: 30px; flex: none; color: var(--gold); }
.assurance strong { display: block; font-size: 12.5px; font-weight: 600; }
.assurance span { font-size: 11px; color: var(--ink-soft); }
.summary-sprig {
  position: absolute;
  right: -10px;
  bottom: -14px;
  width: 92px;
  height: 140px;
  color: #a8773f;
  transform: rotate(-30deg) scaleX(-1);
  opacity: .8;
  pointer-events: none;
}

/* ---------- Brand values strip ---------- */
.values { padding: 0 0 50px; }
.values-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 16px 10px;
  border-radius: 18px;
  background: linear-gradient(90deg, #f6ede2, #faf3ea);
}
.values-list li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 8px 12px;
}
.values-list li + li { border-left: 1px solid var(--line); }
.values-list svg { width: 44px; height: 44px; flex: none; color: var(--gold); }
.values-list strong { display: block; font-family: var(--serif); font-size: 17px; font-weight: 500; }
.values-list span { font-size: 13.5px; color: var(--ink-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr); }
  .summary { position: relative; top: 0; max-width: 560px; width: 100%; margin: 0 auto; }
  .values-list { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 8px; }
  .values-list li:nth-child(3) { border-left: 0; }
  .values-list li { justify-content: flex-start; }
}

@media (max-width: 700px) {
  .cart-head { display: none; }
  .cart-item {
    position: relative;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 12px;
    padding: 16px 0;
  }
  .item-main { grid-column: 1 / -1; grid-template-columns: 84px minmax(0, 1fr); padding-right: 34px; }
  .remove-item { position: absolute; top: 12px; right: 0; }
  .item-price, .item-total, .item-qty { text-align: left; }
  .item-total { text-align: right; }
  .item-qty .qty { margin: 0; }
  .item-price { text-align: left; }
  .cell-label { display: block; font-size: 11px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
  .item-qty { justify-self: center; }
  .item-wish { float: none; display: inline-grid; margin: 4px 0 0 -4px; }
}

@media (max-width: 600px) {
  .cart-actions { flex-wrap: wrap; }
  .values-list { grid-template-columns: minmax(0, 1fr); padding: 10px 16px; }
  .values-list li { padding: 12px 0; }
  .values-list li + li { border-left: 0; border-top: 1px solid var(--line); }
}
