/* ==========================================================================
   cart.css — Adorable side cart drawer + full cart page.
   Requires common.css. Rem-based (1rem = 10px), accent red #b91c1c.
   ========================================================================== */

:root { --cart-accent: #b91c1c; }

/* ── Side drawer ──────────────────────────────────────────────────────── */
.side-cart {
  position: fixed;
  inset: 0;
  z-index: 1100;
  visibility: hidden;
  pointer-events: none;
}

.side-cart.is-open { visibility: visible; pointer-events: auto; }

.side-cart__overlay {
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 18, 0.55);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.side-cart.is-open .side-cart__overlay { opacity: 1; }

.side-cart__panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 42rem;
  height: 100%;
  background: #fff;
  box-shadow: -0.4rem 0 2.4rem rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-cart.is-open .side-cart__panel { transform: translateX(0); }

/* Lock background scroll while open */
body.side-cart-open { overflow: hidden; }

/* Head */
.side-cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 2.4rem;
  border-bottom: 1px solid #ececec;
}

.side-cart__title {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 500;
}

.side-cart__count { color: rgba(var(--text-color), 0.5); font-weight: 400; }

.side-cart__close {
  display: inline-flex;
  padding: 0.6rem;
  margin: -0.6rem;
  background: none;
  border: 0;
  color: rgba(var(--text-color), 0.6);
  cursor: pointer;
  transition: color 0.2s ease;
}
.side-cart__close:hover { color: rgb(var(--text-color)); }
.side-cart__close svg { width: 2.2rem; height: 2.2rem; }

/* Body */
.side-cart__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.8rem 2.4rem;
}

.side-cart__items { margin: 0; padding: 0; list-style: none; }

.side-cart__item {
  display: flex;
  gap: 1.4rem;
  padding: 1.8rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.side-cart__item-media {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 8rem;
  height: 8rem;
  background: #f6f6f6;
  border: 1px solid #ececec;
  border-radius: 8px;
  overflow: hidden;
}
.side-cart__item-media img { width: 100%; height: 100%; object-fit: cover; }
.side-cart__item-media svg { width: 3rem; height: 3rem; color: rgba(var(--text-color), 0.25); }

.side-cart__item-info {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.side-cart__item-name {
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.35;
  color: rgb(var(--text-color));
  text-decoration: none;
}
.side-cart__item-name:hover { text-decoration: underline; }

.side-cart__item-unit {
  margin-top: 0.2rem;
  font-size: 1.25rem;
  color: rgba(var(--text-color), 0.55);
}
/* "(inc VAT)"/"(exc VAT)" tag on cart line items */
.side-cart__item-vat,
.cart-page__item-vat {
  color: rgba(var(--text-color), 0.5);
}

.side-cart__item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.9rem;
}

.side-cart__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  overflow: hidden;
}
.side-cart__qty-btn {
  width: 3.2rem;
  height: 3.2rem;
  background: #fff;
  border: 0;
  font-size: 1.7rem;
  color: rgb(var(--text-color));
  cursor: pointer;
  transition: background 0.15s ease;
}
.side-cart__qty-btn:hover { background: rgba(var(--text-color), 0.05); }
.side-cart__qty-num {
  min-width: 3.4rem;
  text-align: center;
  font-size: 1.45rem;
  border-left: 1px solid #d9d9d9;
  border-right: 1px solid #d9d9d9;
  line-height: 3.2rem;
}

.side-cart__item-total { font-size: 1.55rem; font-weight: 600; }

.side-cart__item-remove {
  align-self: flex-start;
  margin-top: 0.6rem;
  padding: 0;
  background: none;
  border: 0;
  font-size: 1.25rem;
  color: rgba(var(--text-color), 0.5);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}
.side-cart__item-remove:hover { color: var(--cart-accent); }

/* Empty state */
.side-cart__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6rem 2rem;
  color: rgba(var(--text-color), 0.6);
}
.side-cart__empty svg { width: 5rem; height: 5rem; margin-bottom: 1.6rem; color: rgba(var(--text-color), 0.3); }
.side-cart__empty p { margin: 0 0 1.6rem; font-size: 1.6rem; }
.side-cart__shop-link {
  font-size: 1.4rem;
  color: rgb(var(--text-color));
  text-underline-offset: 0.3rem;
}

/* Foot */
.side-cart__foot {
  flex: 0 0 auto;
  padding: 2rem 2.4rem 2.4rem;
  border-top: 1px solid #ececec;
}
.side-cart__subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 1.7rem;
  font-weight: 600;
}
.side-cart__subtotal-vat {
  font-size: 1.25rem;
  font-weight: 400;
  color: rgba(var(--text-color), 0.5);
}
.side-cart__note {
  margin: 0.6rem 0 1.6rem;
  font-size: 1.3rem;
  color: rgba(var(--text-color), 0.55);
}
.side-cart__actions { display: flex; gap: 1rem; }

.side-cart__btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 5rem;
  padding: 0 1.6rem;
  font-size: 1.45rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.side-cart__btn--outline {
  background: #fff;
  border: 1px solid #d9d9d9;
  color: rgb(var(--text-color));
}
.side-cart__btn--outline:hover { border-color: rgb(var(--text-color)); }
.side-cart__btn--solid {
  background: rgb(var(--text-color));
  border: 1px solid rgb(var(--text-color));
  color: #fff;
}
.side-cart__btn--solid:hover { background: #000; }

/* ── Header cart action (count badge) ─────────────────────────────────── */
.site-header-two__cart { 
  position: relative; 
  background-color: rgba(0,0,0, 0.05);
}
.site-header-two__cart-count {
  position: absolute;
  top: -0.4rem;
  right: -0.6rem;
  min-width: 1.8rem;
  height: 1.8rem;
  padding: 0 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cart-accent);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 999px;
}
.site-header-two__cart-count[hidden] { display: none; }

/* ── Full cart page (/cart) ───────────────────────────────────────────── */
.cart-page { padding: 3rem 0 6rem; }
.cart-page__title { margin: 0 0 2.4rem; font-size: 2.8rem; font-weight: 500; }

.cart-page__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 900px) {
  .cart-page__layout { grid-template-columns: 1fr 34rem; gap: 4rem; align-items: start; }
}

.cart-page__items { margin: 0; padding: 0; list-style: none; border-top: 1px solid #ececec; }
.cart-page__item {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 1.8rem;
  padding: 2.2rem 0;
  border-bottom: 1px solid #ececec;
}
.cart-page__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 10rem;
  height: 10rem;
  background: #f6f6f6;
  border: 1px solid #ececec;
  border-radius: 8px;
  overflow: hidden;
}
.cart-page__media img { width: 100%; height: 100%; object-fit: cover; }
.cart-page__media svg { width: 3.6rem; height: 3.6rem; color: rgba(var(--text-color), 0.25); }

.cart-page__info { display: flex; flex-direction: column; }
.cart-page__name { font-size: 1.7rem; font-weight: 500; color: rgb(var(--text-color)); text-decoration: none; }
.cart-page__name:hover { text-decoration: underline; }
.cart-page__unit { margin-top: 0.3rem; font-size: 1.35rem; color: rgba(var(--text-color), 0.55); }
.cart-page__item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1.4rem;
}
.cart-page__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  overflow: hidden;
}
.cart-page__qty-btn {
  width: 3.6rem; height: 3.6rem; background: #fff; border: 0;
  font-size: 1.8rem; cursor: pointer; color: rgb(var(--text-color));
}
.cart-page__qty-btn:hover { background: rgba(var(--text-color), 0.05); }
.cart-page__qty-num {
  min-width: 3.8rem; text-align: center; font-size: 1.5rem; line-height: 3.6rem;
  border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9;
}
.cart-page__item-total { font-size: 1.8rem; font-weight: 600; }
.cart-page__remove {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 1.35rem; color: rgba(var(--text-color), 0.5); text-decoration: underline;
}
.cart-page__remove:hover { color: var(--cart-accent); }

.cart-page__summary {
  padding: 2.4rem;
  background: #faf7f5;
  border: 1px solid #f0e6e2;
  border-radius: 12px;
}
@media (min-width: 900px) { .cart-page__summary { position: sticky; top: 2rem; } }
.cart-page__summary-title { margin: 0 0 1.6rem; font-size: 1.9rem; font-weight: 500; }
.cart-page__summary-row {
  display: flex; justify-content: space-between;
  font-size: 1.5rem; padding: 0.6rem 0;
}
.cart-page__summary-row--total {
  margin-top: 1rem; padding-top: 1.4rem;
  border-top: 1px solid #e6d9d3;
  font-size: 1.8rem; font-weight: 600;
}
.cart-page__checkout {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: 5.4rem; margin-top: 1.8rem;
  background: rgb(var(--text-color)); color: #fff;
  font-size: 1.5rem; font-weight: 500; text-decoration: none; border-radius: 8px;
  transition: background 0.2s ease;
}
.cart-page__checkout:hover { background: #000; }

.cart-page__empty {
  text-align: center; padding: 6rem 2rem; color: rgba(var(--text-color), 0.6);
}
.cart-page__empty p { font-size: 1.7rem; margin: 0 0 2rem; }
.cart-page__empty-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 5rem; padding: 0 2.4rem;
  background: rgb(var(--text-color)); color: #fff;
  text-decoration: none; border-radius: 8px; font-size: 1.5rem;
}
