/* ==========================================================================
   PEPTISSIMA — CART PAGE
   No Shopify source (the source theme uses a cart drawer, not a page) —
   built against woocommerce/cart/cart.php using the theme's existing table,
   button and card language.
   ========================================================================== */

.p-cart {
  background: var(--surface);
  padding: 48px 0 var(--section-y);
}

.p-cart__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.p-cart__empty {
  max-width: 640px;
  padding: 48px 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-alt);
  text-align: center;
  margin: 0 auto;
}

.p-cart__empty .body-text {
  margin: 0;
  font-size: var(--text-md);
}

.p-cart__empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.p-cart .woocommerce-notices-wrapper:not(:empty) {
  margin-bottom: 24px;
}

/* ---- table ---- */
.p-cart__table {
  width: 100%;
  border-collapse: collapse;
}

.p-cart__table thead th {
  text-align: left;
  color: var(--text);
  opacity: 0.5;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.p-cart__col-qty,
.p-cart__col-total {
  text-align: right;
  width: 220px;
}

.p-cart__row td {
  vertical-align: middle;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.p-cart__product {
  display: flex;
  align-items: center;
  gap: 16px;
}

.p-cart__remove {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
}

.p-cart__remove svg {
  width: 15px;
  height: 15px;
}

.p-cart__remove:hover {
  background: var(--red);
}

.p-cart__thumb {
  flex: 0 0 auto;
  display: block;
  width: 88px;
  height: 88px;
  background: var(--surface-alt);
  border-radius: 4px;
  overflow: hidden;
}

.p-cart__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.p-cart__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.p-cart__name {
  color: var(--navy);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--text-base);
}

.p-cart__name:hover {
  color: var(--red);
}

.p-cart__price {
  color: var(--text);
  opacity: 0.6;
  font-size: var(--text-sm);
}

.p-cart__quantity {
  text-align: right;
}

.p-cart__total {
  text-align: right;
  color: var(--navy);
  font-weight: 700;
}

.p-cart__update {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---- quantity stepper ---- */
.p-qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  overflow: hidden;
}

.p-qty-stepper__btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 40px;
  background: var(--surface-alt);
  color: var(--text);
  border: none;
  cursor: pointer;
}

.p-qty-stepper__btn:hover {
  background: var(--line);
}

.p-qty-stepper__btn svg {
  width: 13px;
  height: 13px;
}

.p-qty-stepper__input {
  width: 44px;
  height: 40px;
  border: none;
  border-left: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  text-align: center;
  font-size: var(--text-sm);
  -moz-appearance: textfield;
}

.p-qty-stepper__input::-webkit-outer-spin-button,
.p-qty-stepper__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ---- collaterals / totals ---- */
.p-cart__collaterals {
  display: flex;
  justify-content: flex-end;
  margin-top: 40px;
}

.p-cart__totals {
  width: 100%;
  max-width: 360px;
}

.p-cart__totals-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: var(--navy);
  font-size: var(--text-lg);
}

.p-cart__totals-row strong {
  font-family: var(--font-serif);
}

.p-cart__totals-note {
  margin-top: 6px;
  text-align: right;
}

.p-cart__checkout {
  margin-top: 20px;
}

@media screen and (max-width: 749px) {
  .p-cart {
    padding: 32px 0 48px;
  }

  .p-cart__table thead {
    display: none;
  }

  .p-cart__row td {
    display: block;
    padding: 12px 0;
    border-bottom: none;
  }

  .p-cart__row {
    display: block;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
  }

  .p-cart__quantity,
  .p-cart__total {
    text-align: left;
    padding-left: 48px;
  }

  /* thead is hidden on mobile, so each stacked cell needs its own label —
     the data-title attribute was already there for this (it's also what
     WooCommerce's own responsive cart table convention uses) but nothing
     was rendering it. */
  .p-cart__quantity::before,
  .p-cart__total::before {
    content: attr(data-title);
    display: block;
    color: var(--text);
    opacity: 0.5;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
  }

  .p-cart__total {
    font-size: var(--text-lg);
  }

  .p-cart__collaterals {
    justify-content: stretch;
  }

  .p-cart__totals {
    max-width: none;
  }

  .p-cart__totals-note {
    text-align: left;
  }
}
