/*
 * happydrewienko - cart page, mini-cart drawer and the sticky mobile bar.
 *
 * Enqueued by Happydrewienko\Assets on is_cart() || is_checkout() || is_shop() || is_product(),
 * because the drawer lives in the header on every shop page.
 *
 * Colours, radii, shadows and fonts come exclusively from the design tokens in the child theme
 * (assets/css/tokens.css). Every var() carries the token's own value as a fallback so the plugin
 * still renders sanely if the theme stylesheet is missing; no other literal colour appears here.
 *
 * Specificity note: our stylesheet is enqueued at wp_enqueue_scripts priority 5, Storefront's at
 * 10-20, so Storefront's rules come later in the cascade. The handful of long selectors below
 * (".woocommerce table.hd-cart__table.shop_table_responsive ...") exist only to out-specify
 * Storefront's own shop_table_responsive rules. No !important is used anywhere.
 *
 * Mobile first. Target: no horizontal overflow at 360px.
 */

/* ------------------------------------------------------------------ *
 * 1. Drawer shell adjustments
 *
 * assets/css/base.css owns .hd-drawer and .hd-drawer__panel: the fixed
 * overlay, the dim backdrop colour, the open states (.is-open) and the
 * slide transition. Nothing of that is repeated here. cart.css only
 * adapts the panel to a drawer with a fixed header and footer, and gives
 * the click-to-close layer its geometry (base.css paints the dim on
 * .hd-drawer itself, so this element stays transparent).
 *
 * Likewise .hd-visually-hidden, [hidden] { display: none !important },
 * :focus-visible and the reduced-motion rules for the drawer all live in
 * base.css and are deliberately absent below.
 * ------------------------------------------------------------------ */

.hd-drawer__backdrop {
  position: absolute;
  inset: 0;
}

.hd-mini-cart .hd-drawer__panel {
  /* The head and foot are pinned; .hd-mini-cart__form does the scrolling. */
  position: relative;
  z-index: 1;
  padding: 0;
  overflow: hidden;
}

/* Scroll lock while the dialog is open. */
body.hd-drawer-open {
  overflow: hidden;
}

/* ------------------------------------------------------------------ *
 * 2. Mini-cart contents
 * ------------------------------------------------------------------ */

.hd-mini-cart__inner {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  font-family: var(--hd-font-body, system-ui, sans-serif);
  color: var(--hd-text, #122A22);
}

.hd-mini-cart__head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--hd-border, #CFE6DA);
}

.hd-mini-cart__title {
  margin: 0;
  font-family: var(--hd-font-head, system-ui, sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.hd-mini-cart__count {
  color: var(--hd-text-muted, #45605B);
  font-weight: 400;
}

.hd-mini-cart__close.hd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 6px;
  width: auto;
  min-height: 44px;
  height: 44px;
  padding: 6px 10px;
  background-color: transparent;
  color: var(--hd-text, #122A22);
  border: 1px solid var(--hd-control-border);
  border-radius: var(--hd-radius-sm, 10px);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none;
}

.hd-mini-cart__close.hd-btn:hover {
  background-color: var(--hd-bg, #E4F4EB);
  border-color: var(--hd-border, #CFE6DA);
}

.hd-mini-cart__close-icon {
  display: block;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
}

/* --- list ---------------------------------------------------------- */

.hd-mini-cart__form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.hd-mini-cart__form.is-busy {
  opacity: 0.6;
}

.hd-mini-cart__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hd-mini-cart__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--hd-border, #CFE6DA);
}

.hd-mini-cart__thumb {
  display: block;
  flex: 0 0 auto;
  width: 64px;
  border-radius: var(--hd-radius-sm, 10px);
  overflow: hidden;
  background-color: var(--hd-bg, #E4F4EB);
}

.hd-mini-cart__thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}

/* Preserve the existing thumbnail frames when their source is a larger portrait. */
.hd-cart__table td.product-thumbnail img,
.hd-empty-cart__media img {
  aspect-ratio: 1;
  object-fit: cover;
}

.hd-mini-cart__body {
  flex: 1 1 auto;
  min-width: 0;
}

.hd-mini-cart__name {
  display: block;
  color: var(--hd-text, #122A22);
  font-family: var(--hd-font-head, system-ui, sans-serif);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: break-word;
}

.hd-mini-cart__name:hover {
  color: var(--hd-accent-dark, #1D5C47);
  text-decoration: underline;
}

.hd-mini-cart__meta {
  margin: 0.25rem 0 0;
  color: var(--hd-text-muted, #45605B);
  font-size: 0.85rem;
  line-height: 1.45;
}

/*
 * WooCommerce's cart/cart-item-data.php renders <dl class="variation"> with the colon already
 * inside the <dt>, so nothing is added here. The empty ::after on <dd> is a line break between
 * the inline pairs; the <dd> may contain a <p> depending on the WooCommerce template version.
 */
.hd-mini-cart__meta dl,
.hd-mini-cart__meta p {
  margin: 0;
}

.hd-mini-cart__meta dt {
  display: inline;
  margin: 0;
  font-weight: 700;
}

.hd-mini-cart__meta dd {
  display: inline;
  margin: 0 0 0 0.3rem;
}

.hd-mini-cart__meta dd p {
  display: inline;
  margin: 0;
}

.hd-mini-cart__meta dd::after {
  content: "";
  display: block;
}

.hd-mini-cart__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.55rem;
}

.hd-mini-cart__total {
  margin-left: auto;
  font-weight: 700;
  white-space: nowrap;
}

.hd-mini-cart__remove {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.35rem 0;
  color: var(--hd-text-muted, #45605B);
  font-size: 0.85rem;
  text-decoration: underline;
}

.hd-mini-cart__remove:hover {
  color: var(--hd-error, #9B2C2C);
}

.hd-mini-cart__update {
  margin: 0.9rem 1rem;
}

/* --- quantity stepper ---------------------------------------------- */

.hd-cart__form .product-quantity .quantity {
  display: flex;
  justify-content: center;
}

.woocommerce-cart-form .quantity select.hd-cart-quantity {
  width: 5rem;
  min-height: 44px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--hd-border, #CFE6DA);
  border-radius: var(--hd-radius-sm, 10px);
  background-color: var(--hd-surface, #FFFFFF);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--hd-text) 50%), linear-gradient(135deg, var(--hd-text) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  color: var(--hd-text, #122A22);
  font: inherit;
  text-align: center;
  text-align-last: center;
  cursor: pointer;
}

.woocommerce-cart-form .quantity select.hd-cart-quantity:focus-visible {
  outline: 2px solid var(--hd-primary, #2F6B4F);
  outline-offset: 2px;
}

.hd-cart-qty {
  position: relative;
  display: inline-flex;
  text-align: left;
}

.hd-cart-qty.is-open { z-index: 30; }

.hd-cart__form .hd-cart-qty__trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 5.25rem;
  min-height: 46px;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--hd-control-border);
  border-radius: var(--hd-radius-sm);
  background: var(--hd-surface);
  color: var(--hd-text);
  font: inherit;
  font-weight: 700;
  line-height: 1.3;
  box-shadow: none;
}

.hd-cart__form .hd-cart-qty__trigger::after {
  content: "";
  position: absolute;
  right: 0.85rem;
  display: block;
  flex: 0 0 auto;
  width: 0.45rem;
  height: 0.45rem;
  margin-top: -0.2rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.hd-cart__form .hd-cart-qty__trigger:hover,
.hd-cart__form .hd-cart-qty__trigger[aria-expanded="true"] {
  background: var(--hd-story-surface);
  border-color: var(--hd-accent-dark);
  color: var(--hd-text);
}

.hd-cart__form .hd-cart-qty__options {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 31;
  width: 6rem;
  max-height: min(18rem, 45vh);
  margin: 0;
  padding: 0.3rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  border: 1px solid var(--hd-accent-line);
  border-radius: var(--hd-radius-sm);
  background: var(--hd-surface);
  color: var(--hd-text);
  box-shadow: var(--hd-shadow-lg);
  scrollbar-width: thin;
  scrollbar-color: var(--hd-accent-line) var(--hd-bg);
}

.hd-cart-qty.opens-up .hd-cart-qty__options { top: auto; bottom: calc(100% + 0.4rem); }

.hd-cart-qty__options [role="option"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  font-weight: 650;
  cursor: pointer;
}

.hd-cart-qty__options [role="option"][aria-selected="true"] { background: var(--hd-buy-soft); color: var(--hd-on-buy); }
.hd-cart-qty__options [role="option"][aria-selected="true"]::after { content: "✓"; color: var(--hd-accent-dark); }
.hd-cart-qty__options [role="option"]:hover,
.hd-cart-qty__options [role="option"].is-active { background: var(--hd-accent-dark); color: var(--hd-on-accent); }
.hd-cart-qty__options [role="option"].is-active::after { color: inherit; }
.hd-cart-qty__options [aria-disabled="true"] { opacity: 0.45; cursor: default; }

#hd-mini-cart .hd-qty {
  display: inline-grid;
  grid-template-columns: 44px 44px 44px;
  align-items: center;
  flex: 0 0 auto;
  max-width: 100%;
  background-color: var(--hd-surface, #FFFFFF);
  border: 1px solid var(--hd-border, #CFE6DA);
  border-radius: var(--hd-radius-sm, 10px);
  overflow: hidden;
}

#hd-mini-cart .hd-qty__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding: 0;
  background-color: transparent;
  color: var(--hd-text, #122A22);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

#hd-mini-cart .hd-qty__btn:hover:not([disabled]) {
  background-color: var(--hd-bg, #E4F4EB);
}

#hd-mini-cart .hd-qty__btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

#hd-mini-cart .hd-qty__input {
  width: 44px;
  min-width: 0;
  max-width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 0 0.2rem;
  background-color: transparent;
  color: var(--hd-text, #122A22);
  border: 0;
  border-right: 1px solid var(--hd-border, #CFE6DA);
  border-left: 1px solid var(--hd-border, #CFE6DA);
  border-radius: 0;
  box-shadow: none;
  font-size: 1rem;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}

#hd-mini-cart .hd-qty__input::-webkit-outer-spin-button,
#hd-mini-cart .hd-qty__input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
}

@media (max-width: 420px) {
  .hd-mini-cart__item { gap: 10px; padding-inline: 12px; }
  .hd-mini-cart__thumb { width: 56px; }
}

/* --- footer -------------------------------------------------------- */

.hd-mini-cart__foot {
  flex: 0 0 auto;
  padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
  background-color: var(--hd-bg, #E4F4EB);
  border-top: 1px solid var(--hd-border, #CFE6DA);
}

.hd-mini-cart__subtotal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.hd-mini-cart__subtotal-value {
  font-family: var(--hd-font-head, system-ui, sans-serif);
  font-weight: 700;
  white-space: nowrap;
}

.hd-mini-cart__cta,
.hd-mini-cart__continue,
.hd-mini-cart__empty-cta {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  text-align: center;
}

.hd-mini-cart__cart-link {
  display: block;
  margin-top: 0.75rem;
  color: var(--hd-text-muted, #45605B);
  font-size: 0.9rem;
  text-align: center;
}

.hd-mini-cart__empty {
  flex: 1 1 auto;
  padding: 2rem 1rem;
  overflow-y: auto;
  text-align: center;
}

.hd-mini-cart__empty-text {
  margin: 0 0 1.25rem;
  color: var(--hd-text-muted, #45605B);
}

/* ------------------------------------------------------------------ *
 * 3. Free-shipping progress bar
 * ------------------------------------------------------------------ */

.hd-freeship {
  margin: 0 0 1rem;
}

.hd-freeship--totals {
  margin-bottom: 1.25rem;
}

.hd-freeship__text {
  margin: 0 0 0.4rem;
  color: var(--hd-text-muted, #45605B);
  font-size: 0.9rem;
  line-height: 1.4;
}

.hd-freeship.is-done .hd-freeship__text {
  color: var(--hd-success, #1E6B3E);
  font-weight: 700;
}

.hd-freeship__track {
  height: 10px;
  background-color: var(--hd-border, #CFE6DA);
  border-radius: 999px;
  overflow: hidden;
}

.hd-freeship__fill {
  display: block;
  height: 100%;
  background-color: var(--hd-accent, #1D5C47);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.hd-freeship.is-done .hd-freeship__fill {
  background-color: var(--hd-success, #1E6B3E);
}

/* ------------------------------------------------------------------ *
 * 4. Cart page: item meta and the "Zmień" link
 * ------------------------------------------------------------------ */

.woocommerce .hd-cart__form {
  margin: 0;
}

/* Keep the existing cart layout compact without changing the shop header. */
body.woocommerce-cart .entry-header {
  padding-bottom: 1.5rem;
}

.hd-cart__table td.product-name > a:not(.hd-cart-item__edit) {
  color: var(--hd-text);
  font-weight: 700;
  text-decoration: none;
  line-height: 1.4;
}

.hd-cart__table td.product-name > a:not(.hd-cart-item__edit):hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.hd-cart__table .amount {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hd-cart__table td.product-subtotal {
  font-weight: 700;
}

.woocommerce .hd-cart__table td.product-thumbnail img {
  display: block;
  width: 84px;
  max-width: none;
  height: 84px;
  margin: 0;
  border-radius: var(--hd-radius-sm);
}

/* Paint one rounded surface. Storefront's individual cell backgrounds otherwise create
   square white corners outside the item cards on the mint page background. */
.woocommerce table.hd-cart__table.shop_table_responsive {
  margin: 0;
  border: 1px solid var(--hd-border, #CFE6DA);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--hd-radius, 14px);
  background: var(--hd-surface, #FFFFFF);
}

.woocommerce table.hd-cart__table.shop_table_responsive th,
.woocommerce table.hd-cart__table.shop_table_responsive tr td {
  background: transparent;
}

.woocommerce table.hd-cart__table.shop_table_responsive td.actions {
  padding: 0;
  border: 0;
}

.hd-cart__form .actions .hd-cart-update {
  margin: 0.75rem 0;
}

.woocommerce-cart .cart-collaterals {
  margin-top: 1.25rem;
}

.woocommerce-cart .cart-collaterals .cart_totals.hd-cart__next-step {
  float: none;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.hd-cart__next-step .hd-trust--cart {
  margin: 0 0 1rem;
}

.hd-cart__next-step .wc-proceed-to-checkout {
  margin: 0;
  padding: 0;
}

.woocommerce .hd-cart__next-step .wc-proceed-to-checkout .hd-cart__checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0.85rem 1.25rem;
  border-radius: var(--hd-radius, 14px);
  font-size: 1rem;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 360px) {
  .woocommerce .hd-cart__next-step .wc-proceed-to-checkout .hd-cart__checkout {
    padding-inline: 0.75rem;
    font-size: 0.95rem;
  }

  .woocommerce .hd-cart__next-step .wc-proceed-to-checkout .hd-cart__checkout::after {
    margin-left: 0.5rem;
  }
}

@media (min-width: 769px) {
  .woocommerce table.hd-cart__table.shop_table_responsive thead th {
    padding: 1rem;
    border-bottom: 0;
    background: var(--hd-buy-soft);
    color: var(--hd-text-muted);
    font-size: 0.875rem;
    font-weight: 600;
  }

  .woocommerce table.hd-cart__table thead th:first-child { border-top-left-radius: var(--hd-radius); }
  .woocommerce table.hd-cart__table thead th:last-child { border-top-right-radius: var(--hd-radius); }
  .woocommerce table.hd-cart__table .product-remove { width: 64px; padding-inline: 1rem; }
  .woocommerce table.hd-cart__table .product-thumbnail { width: 116px; padding-inline: 1rem; }
  .woocommerce table.hd-cart__table .product-name { padding-inline: 1rem; }
  .woocommerce table.hd-cart__table .product-price,
  .woocommerce table.hd-cart__table .product-quantity,
  .woocommerce table.hd-cart__table .product-subtotal { width: 15%; }

  .woocommerce table.hd-cart__table.shop_table_responsive .cart_item td {
    border-top: 1px solid var(--hd-border, #CFE6DA);
    border-bottom: 0;
  }

  .woocommerce .hd-cart__next-step .wc-proceed-to-checkout .hd-cart__checkout {
    width: min(100%, 22rem);
    margin-left: auto;
  }
}

@media (min-width: 769px) {
  .woocommerce table.hd-cart__table th.product-price,
  .woocommerce table.hd-cart__table th.product-quantity,
  .woocommerce table.hd-cart__table th.product-subtotal,
  .woocommerce table.hd-cart__table td.product-price,
  .woocommerce table.hd-cart__table td.product-quantity,
  .woocommerce table.hd-cart__table td.product-subtotal {
    text-align: center;
  }

  .woocommerce table.hd-cart__table .cart_item td {
    padding-block: 1rem;
    vertical-align: middle;
  }
}

.hd-cart-item__meta {
  margin: 0.35rem 0 0;
  color: var(--hd-text-muted, #45605B);
  font-size: 0.88rem;
  line-height: 1.5;
}

.hd-cart-item__meta dl,
.hd-cart-item__meta p {
  margin: 0;
}

.hd-cart-item__meta dt {
  display: inline;
  font-weight: 700;
}

.hd-cart-item__meta dd {
  display: inline;
  margin: 0 0 0 0.3rem;
}

.hd-cart-item__meta dd p {
  display: inline;
  margin: 0;
}

.hd-cart-item__meta dd::after {
  content: "";
  display: block;
}

.hd-cart-item__edit {
  display: inline-block;
  min-height: 44px;
  padding: 0.6rem 0;
  color: var(--hd-accent-dark, #1D5C47);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: underline;
}

.hd-cart-item__edit:hover {
  color: var(--hd-text, #122A22);
}

/* ------------------------------------------------------------------ *
 * 5. Coupon disclosure
 * Without JavaScript the toggle stays [hidden] and the field is simply
 * visible, so this whole block only ever applies to enhanced pages.
 * ------------------------------------------------------------------ */

.woocommerce .hd-cart__form table.hd-cart__table .actions .coupon,
.hd-cart__form .coupon.hd-coupon {
  display: block;
  float: none;
  width: min(100%, 32rem);
  margin: 0 auto;
  padding: 1rem 1.15rem;
  text-align: left;
  border: 1px solid var(--hd-border);
  border-radius: var(--hd-radius);
  background: var(--hd-bg);
}

.hd-cart__form .hd-coupon__toggle {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  justify-content: center;
  padding: 0;
  background-color: transparent;
  color: var(--hd-accent-dark);
  border: 0;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
}

.hd-cart__form .hd-coupon__toggle:hover { background: transparent; color: var(--hd-text); }

.hd-coupon__toggle::before {
  content: "+";
  margin-right: 0.4rem;
  font-size: 1.05rem;
  text-decoration: none;
}

.hd-coupon__toggle[aria-expanded="true"]::before {
  content: "\2212"; /* minus sign */
}

.hd-coupon__fields {
  margin-top: 0.7rem;
}

.hd-cart__form .coupon label { display: block; margin: 0 0 0.4rem; color: var(--hd-text); font-size: 0.85rem; font-weight: 650; }
.hd-cart__form .hd-coupon__controls { display: flex; align-items: stretch; gap: 0.5rem; }

.woocommerce .hd-cart__form .coupon #coupon_code {
  float: none;
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--hd-control-border);
  border-radius: var(--hd-radius-sm);
  background: var(--hd-surface);
  color: var(--hd-text);
  font: inherit;
  line-height: 1.3;
}

.woocommerce .hd-cart__form .coupon .hd-coupon__apply {
  flex: 0 0 auto;
  width: auto;
  min-height: 46px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--hd-accent-dark);
  border-radius: var(--hd-radius-sm);
  background: var(--hd-accent-dark);
  color: var(--hd-on-accent);
  font-size: 0.9rem;
  line-height: 1.3;
}

.woocommerce .hd-cart__form .coupon .hd-coupon__apply:hover { background: var(--hd-text); color: var(--hd-on-accent); }
.woocommerce .hd-cart__form .coupon #coupon_code[aria-invalid="true"] { border-color: var(--hd-error); background: #fff8f7; }
.hd-coupon__feedback,
.hd-cart__form .coupon .coupon-error-notice { margin: 0.65rem 0 0; color: var(--hd-error); font-size: 0.85rem; line-height: 1.5; }
.hd-cart-update-status { margin: 0.65rem 0 0; color: var(--hd-text-muted); font-size: 0.85rem; text-align: left; }
.hd-cart-update-status.is-error { color: var(--hd-error); }
.hd-cart-delivery-note { margin: 0.1rem 0 1.2rem; color: var(--hd-text-muted); font-size: 0.85rem; line-height: 1.5; }
.woocommerce .cart_totals .hd-cart-shipping td { padding-block: 0.9rem; text-align: left; }
.woocommerce .cart_totals .hd-cart-shipping td::before { display: none; }
.hd-cart-shipping span { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--hd-accent-dark); font-weight: 700; }
.hd-cart-shipping span::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--hd-buy); }

@media (max-width: 390px) {
  .hd-cart__form .hd-coupon__controls { flex-direction: column; }
  .woocommerce .hd-cart__form .coupon .hd-coupon__apply { width: 100%; }
}

/* ------------------------------------------------------------------ *
 * 6. Empty cart block
 * ------------------------------------------------------------------ */

.hd-empty-cart {
  margin: 1.5rem 0 2rem;
}

.hd-empty-cart__lead {
  margin: 0 0 0.4rem;
  font-family: var(--hd-font-head, system-ui, sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
}

.hd-empty-cart__text {
  margin: 0 0 1.25rem;
  max-width: 46ch;
  color: var(--hd-text-muted, #45605B);
}

/* Surface, border, radius and shadow all come from .hd-card in base.css. */
.hd-empty-cart__card {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 34rem;
}

.hd-empty-cart__media {
  display: block;
  flex: 0 0 auto;
  width: 96px;
  border-radius: var(--hd-radius-sm, 10px);
  overflow: hidden;
}

.hd-empty-cart__media img {
  display: block;
  width: 100%;
  height: auto;
}

.hd-empty-cart__body {
  flex: 1 1 auto;
  min-width: 0;
}

.hd-empty-cart__title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.hd-empty-cart__price {
  margin: 0 0 0.75rem;
  color: var(--hd-text-muted, #45605B);
}

.hd-empty-cart__cta {
  display: inline-block;
}

/* ------------------------------------------------------------------ *
 * 7. Sticky mobile bar (cart page only, below 768px)
 * ------------------------------------------------------------------ */

.hd-cart-sticky {
  display: none;
}

/* ------------------------------------------------------------------ *
 * 8. Mobile: cart rows as cards
 * The data-title attributes come from our woocommerce/cart/cart.php
 * override, which puts one on every cell including remove + thumbnail.
 * ------------------------------------------------------------------ */

@media (max-width: 768px) {

  body.woocommerce-cart #content > .col-full {
    margin-inline: 1rem;
  }

  body.woocommerce-cart .entry-header {
    padding-bottom: 1rem;
  }

  .woocommerce table.hd-cart__table.shop_table_responsive {
    display: block;
    border: 0;
    background: transparent;
  }

  .hd-cart__table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
  }

  .hd-cart__table tbody,
  .hd-cart__table tr,
  .hd-cart__table td {
    display: block;
    width: 100%;
  }

  .hd-cart__table tr.woocommerce-cart-form__cart-item {
    position: relative;
    margin: 0 0 1rem;
    padding: 0.85rem 0.9rem;
    background-color: var(--hd-surface, #FFFFFF);
    border: 1px solid var(--hd-border, #CFE6DA);
    border-radius: var(--hd-radius, 14px);
    box-shadow: var(--hd-shadow, 0 2px 10px rgba(18, 42, 34, 0.07));
  }

  .woocommerce table.hd-cart__table.shop_table_responsive tr td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border: 0;
    text-align: right;
  }

  .woocommerce table.hd-cart__table.shop_table_responsive tr td::before {
    display: block;
    flex: 0 0 auto;
    float: none;
    color: var(--hd-text-muted, #45605B);
    font-size: 0.85rem;
    font-weight: 700;
    text-align: left;
  }

  .woocommerce table.hd-cart__table.shop_table_responsive tr td::after {
    display: none;
  }

  /* The remove control and the thumbnail label themselves, not their value. */
  .woocommerce table.hd-cart__table.shop_table_responsive tr td.product-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: auto;
    padding: 0;
  }

  .woocommerce table.hd-cart__table.shop_table_responsive tr td.product-remove::before,
  .woocommerce table.hd-cart__table.shop_table_responsive tr td.product-thumbnail::before,
  .woocommerce table.hd-cart__table.shop_table_responsive tr td.product-name::before {
    display: none;
    content: none;
  }

  .woocommerce table.hd-cart__table.shop_table_responsive tr td.product-thumbnail {
    display: block;
    width: 84px;
    padding: 0 0 0.5rem;
  }

  .hd-cart__table td.product-thumbnail img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--hd-radius-sm, 10px);
  }

  .woocommerce table.hd-cart__table.shop_table_responsive tr td.product-name {
    display: block;
    padding: 0 0 0.5rem;
    text-align: left;
  }

  .woocommerce table.hd-cart__table.shop_table_responsive tr td.product-subtotal {
    margin-top: 0.5rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--hd-border);
  }

  .hd-cart__table td.product-remove .remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.35rem;
    line-height: 1;
  }

  .woocommerce table.hd-cart__table.shop_table_responsive tr td.actions {
    display: block;
    width: 100%;
    padding: 0;
    text-align: left;
  }

  .hd-cart__table td.actions::before {
    display: none;
    content: none;
  }

  .hd-cart__table td.actions .coupon.hd-coupon {
    float: none;
    width: 100%;
  }

  .hd-cart__table td.actions .button {
    width: 100%;
  }

  .hd-empty-cart__card {
    flex-direction: column;
    align-items: flex-start;
  }

  .hd-empty-cart__media {
    width: 100%;
    max-width: 180px;
  }
}

.hd-cart__next-step .checkout-button::after { display: none; content: none; }

/* ------------------------------------------------------------------ *
 * 9. Reduced motion
 * The global :focus-visible ring and the drawer's own reduced-motion rule
 * both come from assets/css/base.css; only the progress bar is new here.
 * ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {

  .hd-freeship__fill {
    transition: none;
  }
}
