/* ============================================================
   Fahavi — cart page  (fahavi-cart.css)
   Loaded only on is_cart(); depends on tokens in fahavi.css.
   ============================================================ */

/* Page width (Blocksy structure may use either container class).
   Forms read badly over-wide, so the cart caps at --fh-maxw. */
.fahavi-cart .ct-container,
.fahavi-cart .ct-container-full {
  width: min(100% - clamp(32px, 4vw, 64px), var(--fh-maxw));
  max-width: none;
  margin-inline: auto;
}
/* The cart page's entry-content holds only the shortcode wrapper,
   so unlocking the constrained-layout cap is safe page-wide here. */
.fahavi-cart .entry-content > * { max-width: none; }

/* ---- notices (added-to-cart, coupon feedback, errors) ---- */
.fahavi-cart .woocommerce-message,
.fahavi-cart .woocommerce-info,
.fahavi-cart .woocommerce-error {
  border: 1px solid var(--fh-border);
  border-left: 4px solid var(--fh-green-deep);
  background: #fff;
  border-radius: 10px;
  padding: 13px 16px;
  margin: 16px 0 0;
  list-style: none;
  font-size: 14.5px;
  color: var(--fh-ink);
}
.fahavi-cart .woocommerce-error { border-left-color: var(--fh-red); }
.fahavi-cart .woocommerce-info  { border-left-color: var(--fh-navy); }
.fahavi-cart .woocommerce-message .button,
.fahavi-cart .woocommerce-info .button {
  float: right; background: none; border: 0; padding: 0;
  color: var(--fh-navy); font-weight: 700; text-decoration: underline;
}

/* ---- header ---- */
.fh-crt__head { padding: 26px 0 18px; }
.fh-crt__crumb { display: flex; gap: 8px; font-size: 13px; color: var(--fh-muted); }
.fh-crt__crumb a { color: var(--fh-muted); text-decoration: none; }
.fh-crt__crumb a:hover { color: var(--fh-navy); }
.fh-crt__head h1 { margin: 6px 0 2px; font-size: clamp(26px, 3vw, 34px); font-weight: 800; color: var(--fh-ink); }
.fh-crt__count { margin: 0; font-size: 14.5px; color: var(--fh-muted); }

/* ---- layout ---- */
.fh-crt__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 26px;
  align-items: start;
  padding-bottom: 56px;
}

/* ---- item cards ---- */
.fh-crt__items { margin: 0; }
.fh-crt__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.fh-crt__item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto minmax(110px, auto) 32px;
  gap: 16px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius-card);
  padding: 16px 18px;
}
.fh-crt__thumb {
  width: 96px; height: 96px; border-radius: 10px;
  border: 1px solid var(--fh-border); background: #fff;
  display: grid; place-items: center; overflow: hidden;
}
.fh-crt__thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.fh-crt__brand { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fh-muted); }
.fh-crt__name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin: 2px 0 4px; font-size: 15px; font-weight: 600; line-height: 1.35;
  color: var(--fh-ink); text-decoration: none;
}
a.fh-crt__name:hover { color: var(--fh-navy); }
.fh-crt__unit { display: block; font-size: 13px; color: var(--fh-muted); }
.fh-crt__unit em { font-style: normal; }
.fh-crt__stock { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--fh-green-deep); }
.fh-crt__stock::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--fh-green-deep); }

.fh-crt__qty { display: flex; align-items: center; gap: 8px; }
.fh-crt__qbtn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--fh-border); background: #fff; color: var(--fh-ink);
  font-size: 17px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.fh-crt__qbtn:hover { border-color: var(--fh-navy); color: var(--fh-navy); }
.fh-crt__qty input {
  width: 48px; height: 34px; text-align: center; font-weight: 700; color: var(--fh-ink);
  border: 1px solid var(--fh-border); border-radius: 8px;
  -moz-appearance: textfield; appearance: textfield;
}
.fh-crt__qty input::-webkit-outer-spin-button,
.fh-crt__qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.fh-crt__line { font-size: 16.5px; font-weight: 800; color: var(--fh-navy); white-space: nowrap; text-align: right; }
.fh-crt__rm {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--fh-chip-bg); color: var(--fh-muted);
}
.fh-crt__rm svg { width: 15px; height: 15px; }
.fh-crt__rm:hover { background: #FDECEC; color: var(--fh-red); }

.fh-crt__rowactions { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.fh-crt__continue { font-size: 14.5px; font-weight: 600; color: var(--fh-navy); text-decoration: none; }
.fh-crt__continue:hover { text-decoration: underline; }
/* Hidden named submit — quantity JS clicks it; keyboard users can Tab to it. */
.fh-crt__update { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.fh-crt__update:focus {
  position: static; width: auto; height: auto; clip: auto;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--fh-navy);
  background: #fff; color: var(--fh-navy); font-weight: 700;
}

/* ---- order summary ---- */
.fh-crt__sum { position: sticky; top: calc(var(--fh-header-offset, 114px) + 12px); }
.fh-crt__box {
  background: #fff; border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius-card); padding: 22px;
  box-shadow: 0 6px 24px rgba(16, 24, 64, .06);
}
.fh-crt__box h2 { margin: 0 0 10px; font-size: 18px; font-weight: 800; color: var(--fh-ink); }
.fh-crt__totals { margin: 0; }
.fh-crt__row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 14.5px; }
.fh-crt__row dt { font-weight: 500; color: var(--fh-muted); }
.fh-crt__row dd { margin: 0; font-weight: 700; color: var(--fh-ink); text-align: right; }
.fh-crt__delnote { font-weight: 500 !important; color: var(--fh-muted) !important; font-size: 13px; max-width: 200px; }
.fh-crt__row--coupon dd .woocommerce-remove-coupon { display: block; font-size: 12px; color: var(--fh-red); }
.fh-crt__row--total { border-top: 1px solid var(--fh-border); margin-top: 6px; padding-top: 14px; }
.fh-crt__row--total dt { font-size: 16px; font-weight: 800; color: var(--fh-ink); }
.fh-crt__row--total dd { font-size: 20px; font-weight: 800; color: var(--fh-navy); }

.fh-crt__promo { margin: 10px 0 14px; padding: 10px 14px; border: 1px dashed var(--fh-border); border-radius: 10px; }
.fh-crt__promo summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--fh-navy); list-style: none; }
.fh-crt__promo summary::-webkit-details-marker { display: none; }
.fh-crt__promoform { display: flex; gap: 8px; margin-top: 10px; }
.fh-crt__promoform input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; font-size: 14px; border: 1px solid var(--fh-border); border-radius: 8px; }
.fh-crt__promoform button { height: 40px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--fh-navy); color: #fff; font-weight: 700; cursor: pointer; }
.fh-crt__promoform button:hover { background: var(--fh-navy-dark); }

.fh-crt__checkout,
.fh-crt__wa {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; min-height: 48px; border-radius: var(--fh-radius-btn);
  font-size: 15.5px; font-weight: 700; text-decoration: none;
}
.fh-crt__checkout { background: var(--fh-navy); color: #fff !important; margin-top: 4px; }
.fh-crt__checkout:hover { background: var(--fh-navy-dark); }
.fh-crt__checkout svg { width: 17px; height: 17px; }
.fh-crt__wa { background: #22C55E; color: #fff !important; margin-top: 10px; }
.fh-crt__wa:hover { background: var(--fh-green-deep); }
.fh-crt__wa svg { width: 18px; height: 18px; }

.fh-crt__trust { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--fh-border); display: flex; flex-direction: column; gap: 9px; }
.fh-crt__trust li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--fh-muted); }
.fh-crt__trust svg { width: 16px; height: 16px; flex: none; color: var(--fh-navy); }

/* ---- empty state ---- */
.fh-crt--empty { padding: 40px 0 70px; }
.fh-crt__emptycard {
  max-width: 520px; margin: 0 auto; text-align: center;
  background: #fff; border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius-card); padding: 48px 34px;
}
.fh-crt__emptyicon svg { width: 64px; height: 64px; color: var(--fh-muted); opacity: .5; }
.fh-crt__emptycard h1 { margin: 14px 0 8px; font-size: 26px; font-weight: 800; color: var(--fh-ink); }
.fh-crt__emptycard p { margin: 0 0 22px; font-size: 15px; color: var(--fh-muted); }
.fh-crt__emptyactions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.fh-crt__emptyactions .fh-crt__checkout { width: auto; padding: 0 26px; margin: 0; }
.fh-crt__ghost {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px; border-radius: var(--fh-radius-btn);
  border: 1.5px solid var(--fh-navy); color: var(--fh-navy);
  font-weight: 700; text-decoration: none;
}
.fh-crt__ghost:hover { background: var(--fh-navy); color: #fff; }

/* ---- responsive ---- */
@media (max-width: 1024px) {
  .fh-crt__grid { grid-template-columns: minmax(0, 1fr); }
  .fh-crt__sum { position: static; }
}
@media (max-width: 700px) {
  .fh-crt__item {
    grid-template-columns: 72px minmax(0, 1fr) 32px;
    grid-template-areas:
      "thumb info rm"
      "thumb qty line";
    row-gap: 10px;
    padding: 14px;
  }
  .fh-crt__thumb { grid-area: thumb; width: 72px; height: 72px; align-self: start; }
  .fh-crt__info  { grid-area: info; }
  .fh-crt__rm    { grid-area: rm; align-self: start; }
  .fh-crt__qty   { grid-area: qty; }
  .fh-crt__line  { grid-area: line; align-self: center; }
}
/* Blocksy paints links inside Woo notices white (it expects a colored banner
   background). On our white notice cards that made every error invisible —
   each checkout error is an <a href="#field"> wrapper. Restore readable ink. */
.fahavi-cart .woocommerce-error a,
.fahavi-cart .woocommerce-message a,
.fahavi-cart .woocommerce-info a {
  color: var(--fh-ink);
  text-decoration: none;
}
.fahavi-cart .woocommerce-error a strong { color: var(--fh-red); }
.fahavi-cart .woocommerce-error a:hover { color: var(--fh-red); text-decoration: underline; }
.fahavi-cart .woocommerce-error li,
.fahavi-cart .woocommerce-message li,
.fahavi-cart .woocommerce-info li { margin: 3px 0; }
/* Blocksy's oversized notice icon pseudo-element crowds the card — drop it. */
.fahavi-cart .woocommerce-error::before,
.fahavi-cart .woocommerce-message::before,
.fahavi-cart .woocommerce-info::before { display: none; }