/*
 * Duchi Treats — WooCommerce layer (design system 05).
 * Loaded only on Woo pages. Restyles Woo output via tokens; --wc-* vars are
 * aliased to brand in tokens.css to catch plugin defaults.
 */

/* Border-box everything Woo renders — its buttons/inputs ship as content-box,
   so width:100% + padding overflows their containers (the checkout button was
   bursting out of the totals card for exactly this reason). */
.woocommerce, .duchi-cart, .cart-collaterals,
.woocommerce *, .duchi-cart *, .cart-collaterals *,
.woocommerce *::before, .woocommerce *::after { box-sizing: border-box; }

/* ============================================================
 * Product loop / grid (shop archive + [products] shortcode)
 * ============================================================ */

.woocommerce-page-wrap { padding-block: var(--wp--preset--spacing--90) var(--wp--preset--spacing--110); }

ul.products,
ul.products.duchi-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--wp--preset--spacing--60);
}
ul.products::before,
ul.products::after { content: none; } /* kill Woo clearfix */

/* Card sits in the grid; clear Woo's float/width rules */
ul.products li.product,
ul.products li.product-card {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
  clear: none !important;
}

/* The "+ Add" loop button uses our button classes already; ensure full reset */
.product-card .button,
.product-card .add_to_cart_button {
  font-family: var(--wp--preset--font-family--display);
  text-decoration: none;
}
.product-card .added_to_cart { display: none; } /* we use the toast/drawer instead */

/* Loading state on ajax add */
.product-card .add_to_cart_button.loading { opacity: .6; pointer-events: none; }

/* ============================================================
 * Shop archive banner + filter chips (05 §1)
 * ============================================================ */

.shop-archive { background: var(--bg-page); }
.shop-banner { padding-block: var(--wp--preset--spacing--100) var(--wp--preset--spacing--90); text-align: center; }
.shop-banner .eyebrow { margin-bottom: 14px; }
.shop-banner__title { margin: 0; }
.shop-banner__lead { color: var(--text-body); margin-top: 8px; max-width: 460px; margin-inline: auto; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: var(--wp--preset--spacing--80);
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 2px solid var(--border);
  color: var(--text-strong);
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.filter-chip:hover { background: var(--bg-tint); color: var(--action-hover); }
.filter-chip.is-active { background: var(--wp--preset--color--blush); color: var(--action-hover); border-color: transparent; }

.shop-empty { text-align: center; padding: var(--wp--preset--spacing--110) 0; }
.shop-empty__title { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 1.5rem; color: var(--text-strong); }
.shop-empty p { color: var(--text-body); }

/* ============================================================
 * Archive header / result count / ordering
 * ============================================================ */

.woocommerce-result-count {
  color: var(--text-body);
  font-size: .9rem;
  margin: 0;
}
.woocommerce-ordering,
.duchi-ordering { margin: 0; }
.duchi-ordering .select { position: relative; display: inline-block; }

/* Sort = compact brand pill with a CSS chevron (native select, no JS). */
.woocommerce .duchi-ordering select.orderby,
.duchi-ordering select.orderby {
  width: auto;
  min-width: 190px;
  height: 44px;
  margin: 0;
  padding: 0 44px 0 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background-color: var(--bg-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%23D43E72' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-strong);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.woocommerce .duchi-ordering select.orderby:hover { border-color: var(--action); }
.woocommerce .duchi-ordering select.orderby:focus {
  outline: none;
  border-color: var(--action);
  box-shadow: 0 0 0 3px var(--ring-soft);
}

/* result count + sort sit on one row above the grid */
.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: var(--wp--preset--spacing--60);
}
.shop-toolbar .woocommerce-result-count { margin: 0; }

/* ============================================================
 * Pagination — centered pills (kills the default bullet list)
 * ============================================================ */
.woocommerce-pagination {
  margin-top: var(--wp--preset--spacing--90);
  text-align: center;
}
.woocommerce-pagination ul,
.woocommerce-pagination ul.page-numbers {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  border: none;
}
.woocommerce-pagination ul li { margin: 0; border: none; overflow: visible; }
.woocommerce-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--text-strong);
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  transition: border-color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.woocommerce-pagination a.page-numbers:hover {
  border-color: var(--action);
  color: var(--action);
}
.woocommerce-pagination .page-numbers.current {
  background: var(--action);
  border-color: var(--action);
  color: #fff;
}
.woocommerce-pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
}

/* ============================================================
 * Notices (cart added, errors) — brand-styled (05 §7)
 * ============================================================ */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 0 0 var(--wp--preset--spacing--70);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.45;
  list-style: none;
  color: #fff;
  box-shadow: var(--shadow-sm);
}
/* solid colored cards per type */
.woocommerce-message { background: var(--s-success); }
.woocommerce-info    { background: var(--action); }
.woocommerce-error   { background: var(--s-error); }

/* leading status icon (injected by toast.js as .duchi-notice__icon) */
.duchi-notice__icon {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: var(--radius-circle);
  background: rgba(255, 255, 255, .22);
  color: #fff;
}
.duchi-notice__icon .duchi-icon { width: 16px; height: 16px; }

/* error lists (multiple validation errors) stay readable on the red card */
.woocommerce-error li { margin: 0; padding: 3px 0; }
.woocommerce-error li + li { border-top: 1px solid rgba(255, 255, 255, .25); margin-top: 4px; padding-top: 8px; }
.woocommerce .woocommerce-error li a,
.woocommerce-message a,
.woocommerce-info a { color: #fff; text-decoration: underline; }

/* inline action button (e.g. "View cart", "Apply") on a notice → white pill */
.woocommerce-message .button,
.woocommerce-info .button {
  margin-left: auto;
  background: #fff;
  color: var(--text-strong);
  border: none;
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  font-size: .85rem;
  font-weight: 700;
  box-shadow: none;
}
.woocommerce-message .button:hover,
.woocommerce-info .button:hover { background: var(--bg-tint); }

/* ============================================================
 * Single product (05 §2)
 * ============================================================ */

.single-product-main { padding-block: var(--wp--preset--spacing--80) var(--wp--preset--spacing--110); }
.duchi-breadcrumb { color: var(--text-muted); font-size: .85rem; margin-bottom: var(--wp--preset--spacing--60); }
.duchi-breadcrumb a { color: var(--text-body); text-decoration: none; }
.duchi-breadcrumb a:hover { color: var(--action-hover); text-decoration: underline; }
.duchi-breadcrumb .sep { margin: 0 6px; color: var(--text-muted); }

.single-product div.product {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
/* Tabs + related are appended into div.product — drop them below the
   gallery/summary row as full-width blocks instead of into column 2. */
.single-product div.product > .woocommerce-tabs,
.single-product div.product > .related.products,
.single-product div.product > .upsells.products {
  grid-column: 1 / -1;
}

/* Gallery (left) — sits in a rounded blush bed. Force visible even if Woo's
   JS hasn't faded it in (we dropped Woo's layout CSS). */
.single-product .woocommerce-product-gallery {
  margin: 0;
  width: 100% !important;
  float: none !important;
  opacity: 1 !important;
  position: relative;
}
.single-product .woocommerce-product-gallery__wrapper { margin: 0; }
.single-product .woocommerce-product-gallery__image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-tint);
  aspect-ratio: 1 / 1;
}
.single-product .woocommerce-product-gallery__image a,
.single-product .woocommerce-product-gallery__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
}
/* gallery zoom/lightbox trigger button */
.single-product .woocommerce-product-gallery__trigger {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 40px; height: 40px;
  border-radius: var(--radius-circle);
  background: #fff;
  box-shadow: var(--shadow-sm);
  display: grid; place-items: center;
  text-indent: 0;
}
/* gallery thumbnail strip */
.single-product .flex-control-thumbs {
  display: flex;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.single-product .flex-control-thumbs li { width: 72px; }
.single-product .flex-control-thumbs img {
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: .6;
  transition: opacity var(--dur-fast);
}
.single-product .flex-control-thumbs img.flex-active,
.single-product .flex-control-thumbs img:hover { opacity: 1; }

/* Summary (right) */
.single-product .summary.entry-summary { margin: 0; }
.single-product .product_title {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.single-product p.price,
.single-product .summary .price {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800;
  font-size: 1.9rem;
  color: var(--price);
  margin: 0 0 14px;
}
.single-product p.price del { font-size: 1.1rem; }
.single-product .woocommerce-product-details__short-description { color: var(--text-body); margin: 16px 0; }
.single-product .woocommerce-product-rating { margin-bottom: 12px; }

/* Dietary pill-tags row on single */
.single-product .duchi-dietary-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }

/* Add-to-bag: qty stepper on its own row, full-width button below it */
.single-product form.cart {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  margin: 24px 0;
  max-width: 420px;
}
.single-product form.cart .quantity {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
}
.single-product form.cart .quantity .qty {
  width: 48px;
  border: none;
  background: transparent;
  text-align: center;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-strong);
  -moz-appearance: textfield;
  appearance: textfield;
}
.single-product form.cart .quantity .qty::-webkit-outer-spin-button,
.single-product form.cart .quantity .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.single-product .single_add_to_cart_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  font-size: 1.05rem;
  background: var(--action);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 15px 32px;
  cursor: pointer;
  transition: background var(--dur-fast), transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base);
  box-shadow: var(--shadow-md);
}
.single-product .single_add_to_cart_button:hover { background: var(--action-hover); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.single-product .single_add_to_cart_button .duchi-icon { color: #fff; }

/* product meta (sku / category) */
.single-product .product_meta {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px dashed var(--border);
  font-size: .85rem;
  color: var(--text-muted);
}
.single-product .product_meta a { color: var(--text-body); }

/* Product tabs */
.woocommerce-tabs { margin-top: var(--wp--preset--spacing--100); }
.woocommerce-tabs ul.tabs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 24px;
  border-bottom: 2px solid var(--border);
}
.woocommerce-tabs ul.tabs li { margin: 0; }
.woocommerce-tabs ul.tabs li a {
  display: block;
  padding: 12px 22px;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  color: var(--text-body);
  text-decoration: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.woocommerce-tabs ul.tabs li.active a { color: var(--action-hover); background: var(--bg-tint); }
.woocommerce-tabs .woocommerce-Tabs-panel h2 { font-size: 1.3rem; margin-bottom: 12px; }
.woocommerce-tabs .woocommerce-Tabs-panel { color: var(--text-body); }

/* ============================================================
 * Reviews tab + review form
 * ============================================================ */
#reviews .woocommerce-noreviews { color: var(--text-body); margin: 0 0 4px; }
#reviews #comments > h2 { font-size: 1.3rem; margin-bottom: 14px; }

/* existing reviews list */
#reviews ol.commentlist { list-style: none; margin: 0 0 28px; padding: 0; }
#reviews ol.commentlist li {
  margin: 0 0 14px;
  padding: 18px 20px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
}
#reviews ol.commentlist .comment-text { margin: 0; }
#reviews ol.commentlist .meta { font-size: .85rem; color: var(--text-muted); margin-bottom: 6px; }

/* review form card */
#review_form_wrapper {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 32px);
}
#review_form .comment-reply-title {
  display: block;
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.15rem;
  color: var(--text-strong);
  margin-bottom: 18px;
}
#review_form .comment-reply-title a { font-size: .85rem; font-weight: 600; }
#review_form .comment-form-rating label,
#review_form .comment-form-comment label { display: block; font-weight: 600; color: var(--text-strong); margin-bottom: 8px; }
#review_form .comment-form-rating { margin-bottom: 18px; }
#review_form .comment-form-comment { margin-bottom: 18px; }

/* star picker: rebuild Woo's text links into clickable ★ (woocommerce-general
   dequeued, so no star font). DOM order is star-1…star-5 left-to-right.
   CSS `~` only reaches LATER siblings, so we fill all stars gold then dim the
   ones AFTER the hovered/selected one. */
#review_form p.stars {
  display: inline-flex;
  gap: 4px;
  margin: 0;
  line-height: 1;
}
#review_form p.stars a {
  position: relative;
  width: 1.9rem;
  height: 1.9rem;
  font-size: 0;
  text-decoration: none;
  text-indent: 0;
}
#review_form p.stars a::before {
  content: "\2605";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  color: var(--border);
  transition: color var(--dur-fast);
}
/* selected state (Woo adds .active to the chosen star) — fill up to it */
#review_form p.stars a.active::before { color: #F5B301; }
#review_form p.stars a.active ~ a::before { color: var(--border); }
/* the chosen star + every star BEFORE it are gold; CSS can't reach earlier
   siblings, so paint all gold when one is active, then grey the trailing ones */
#review_form p.stars:has(a.active) a::before { color: #F5B301; }
#review_form p.stars a.active ~ a::before { color: var(--border); }
/* hover preview overrides selection: gold up to hovered, grey after */
#review_form p.stars:hover a::before { color: #F5B301; }
#review_form p.stars a:hover ~ a::before { color: var(--border); }

#review_form textarea#comment,
#review_form textarea {
  width: 100%;
  min-height: 130px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-page);
  padding: 14px 16px;
  font-size: .95rem;
  font-family: var(--wp--preset--font-family--body);
  color: var(--text-strong);
  resize: vertical;
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
#review_form textarea#comment:focus {
  outline: none;
  border-color: var(--action);
  box-shadow: 0 0 0 3px var(--ring-soft);
}
#review_form .form-submit { margin: 0; }
#review_form input#submit,
#review_form .form-submit input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 30px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--action);
  color: #fff;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background var(--dur-fast), transform var(--dur-base) var(--ease-out);
}
#review_form input#submit:hover,
#review_form .form-submit input[type="submit"]:hover { background: var(--action-hover); transform: translateY(-2px); }

/* Related products heading */
.related.products > h2,
.upsells.products > h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin-bottom: var(--wp--preset--spacing--60);
  text-align: center;
}
.related.products,
.upsells.products { margin-top: var(--wp--preset--spacing--100); }

/* ============================================================
 * Cart page (05 §3)
 * ============================================================ */

.woocommerce-cart .wp-block-post-title,
.woocommerce-cart h1.entry-title { margin-bottom: var(--wp--preset--spacing--70); }

/* Owned div-based cart layout (woocommerce/cart/cart.php) */
.duchi-cart {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.duchi-cart__items { min-width: 0; }
.woocommerce-cart-form { margin: 0; }

.duchi-cart__list { display: flex; flex-direction: column; }

.duchi-cart-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 2px dashed var(--border);
}
.duchi-cart-row:first-child { padding-top: 0; }
.duchi-cart-row__thumb img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}
.duchi-cart-row__info { min-width: 0; }
.duchi-cart-row__name {
  margin: 0;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.25;
}
.duchi-cart-row__name a { color: var(--text-strong); text-decoration: none; }
.duchi-cart-row__name a:hover { color: var(--action-hover); }
.duchi-cart-row__price { font-size: .85rem; color: var(--text-muted); }
.duchi-cart-row__subtotal {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800;
  color: var(--price);
  white-space: nowrap;
}

/* qty stepper [− n +] */
.duchi-cart-row__qty .quantity {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 6px;
}
.duchi-cart-row__qty .quantity .qty {
  width: 36px;
  border: none;
  background: transparent;
  text-align: center;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  color: var(--text-strong);
  -moz-appearance: textfield;
  appearance: textfield;
}
.duchi-cart-row__qty .quantity .qty::-webkit-outer-spin-button,
.duchi-cart-row__qty .quantity .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* remove (×) */
.duchi-cart-row__remove a.remove {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: var(--radius-circle);
  background: var(--bg-tint);
  color: var(--action-hover) !important;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.duchi-cart-row__remove a.remove:hover { background: var(--s-error); color: #fff !important; }

/* coupon + actions row */
.duchi-cart__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 22px;
}
/* Coupon = fused pill: bordered rounded shell, borderless input, rose Apply.
   Same .coupon markup on cart + checkout (our form-coupon.php override). */
.coupon {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px;
  max-width: 380px;
  width: 100%;
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.coupon:focus-within { border-color: var(--action); box-shadow: 0 0 0 3px var(--ring-soft); }

.woocommerce .coupon input.input-text,
.coupon .input,
.coupon #coupon_code {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: 42px;
  border: none !important;
  background: transparent;
  box-shadow: none !important;
  padding: 0 8px 0 16px;
  font-size: .95rem;
  margin: 0;
}
.coupon input.input-text:focus,
.coupon #coupon_code:focus { box-shadow: none !important; border: none !important; }

.coupon button[name="apply_coupon"] {
  flex-shrink: 0;
  height: 42px;
  margin: 0;
  padding: 0 22px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--action);
  color: #fff;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: background var(--dur-fast), transform var(--dur-base) var(--ease-out);
}
.coupon button[name="apply_coupon"]:hover { background: var(--action-hover); transform: none; }

.duchi-coupon-hint { font-size: .9rem; color: var(--text-body); margin: 0 0 10px; }
.checkout_coupon { margin-bottom: 20px; }

/* Cart totals card */
.cart-collaterals { width: 100%; min-width: 0; }
.cart-collaterals .cart_totals {
  background: var(--bg-surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--wp--preset--spacing--60);
  position: sticky;
  top: 90px;
}
.cart_totals h2 { font-size: 1.5rem; margin-bottom: 16px; }
.cart_totals table { width: 100%; border-collapse: collapse; }
.cart_totals table th,
.cart_totals table td { padding: 10px 0; border-bottom: 1px solid var(--border); text-align: left; }
.cart_totals .order-total th,
.cart_totals .order-total td { border-bottom: none; padding-top: 16px; }
.cart_totals .order-total .amount {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--price);
}
.wc-proceed-to-checkout { padding-top: 20px; }
.wc-proceed-to-checkout a.checkout-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  font-size: 1.05rem;
  background: var(--action);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 15px 30px;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: background var(--dur-fast), transform var(--dur-base) var(--ease-out);
}
.wc-proceed-to-checkout a.checkout-button:hover { background: var(--action-hover); transform: translateY(-2px); }

/* ============================================================
 * Checkout (05 §4)
 * ============================================================ */

/* 2-column: customer details left, sticky order review right (05 §4) */
.duchi-checkout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.duchi-checkout__details { min-width: 0; }
.duchi-checkout #customer_details { display: flex; flex-direction: column; gap: var(--wp--preset--spacing--60); }
/* the empty shipping-fields block shouldn't add a phantom gap before notes */
.duchi-checkout .woocommerce-shipping-fields:empty { display: none; }
.duchi-checkout .woocommerce-additional-fields { margin-top: 0; }

/* Validation errors injected at the top of the form must span both columns,
   not steal a grid cell (which shoved billing into the right column). */
.duchi-checkout > .woocommerce-NoticeGroup,
.duchi-checkout > .woocommerce-error,
.duchi-checkout > .woocommerce-message,
.duchi-checkout > .woocommerce-info { grid-column: 1 / -1; }

/* Per-field invalid state: red border + soft error halo, brand-styled message */
.woocommerce form .form-row.woocommerce-invalid input.input-text,
.woocommerce form .form-row.woocommerce-invalid select,
.woocommerce form .form-row.woocommerce-invalid textarea { border-color: var(--s-error); }
.woocommerce form .form-row.woocommerce-invalid input.input-text:focus,
.woocommerce form .form-row.woocommerce-invalid select:focus,
.woocommerce form .form-row.woocommerce-invalid textarea:focus { box-shadow: 0 0 0 3px var(--ring-error); }
.woocommerce form .form-row.woocommerce-validated input.input-text,
.woocommerce form .form-row.woocommerce-validated select { border-color: var(--s-success); }

/* Per-field inline message: tight to the input, error-colored, semibold */
.woocommerce form .form-row .checkout-inline-error-message,
.woocommerce form .form-row .wc-block-components-validation-error,
.woocommerce form .form-row > .error {
  margin: 6px 0 0;
  padding: 0 4px;
  color: var(--s-error);
  font-weight: 600;
  font-size: .8rem;
  line-height: 1.35;
}

.woocommerce-billing-fields > h3,
.woocommerce-shipping-fields h3,
.woocommerce-additional-fields h3,
#ship-to-different-address { font-family: var(--wp--preset--font-family--display); font-size: 1.25rem; margin: 0 0 16px; }

/* field rows */
.woocommerce form .form-row { display: flex; flex-direction: column; margin: 0 0 16px; }
.woocommerce form .form-row label { font-weight: 600; font-size: .85rem; color: var(--text-strong); margin-bottom: 6px; }
.woocommerce-billing-fields__field-wrapper,
.woocommerce-shipping-fields__field-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
/* additional info holds only the notes field — single column, full width */
.woocommerce-additional-fields__field-wrapper { display: block; }
.woocommerce form .form-row-wide { grid-column: 1 / -1; }

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0 16px;
  height: 46px;
  line-height: 46px;
  font-family: var(--wp--preset--font-family--body);
  font-size: .95rem;
  color: var(--text-strong);
  background: var(--bg-surface);
  outline: none;
  box-shadow: 0 0 0 0 transparent;
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.woocommerce form .form-row textarea { border-radius: var(--radius-md); height: auto; line-height: 1.5; padding: 12px 16px; min-height: 84px; }
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
  border-color: var(--action);
  box-shadow: 0 0 0 3px var(--ring-soft, rgba(214, 51, 132, 0.22));
}
.woocommerce form .form-row input.input-text::placeholder,
.woocommerce form .form-row textarea::placeholder { color: var(--text-muted); }

/* native <select> fields: strip browser chrome, add our chevron */
.woocommerce form .form-row select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 44px;
  cursor: pointer;
}
.woocommerce form .form-row.duchi-select-row { position: relative; }
.woocommerce form .form-row.duchi-select-row::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 14px;
  width: 18px; height: 18px;
  pointer-events: none;
  background: var(--text-strong);
  -webkit-mask: var(--duchi-chevron-down) center / contain no-repeat;
          mask: var(--duchi-chevron-down) center / contain no-repeat;
}
/* if the row has a label, nudge the chevron to sit on the field, not the label */
.woocommerce form .form-row.duchi-select-row { padding-bottom: 0; }

/* Once JS upgrades the native <select> to a .duchi-select listbox, drop the
   row's CSS chevron (the listbox button draws its own) and let the wrapper
   own the width. */
.woocommerce form .form-row.duchi-select-row:has(.duchi-select)::after { display: none; }
.woocommerce form .form-row .duchi-select { width: 100%; }
.woocommerce form .form-row .duchi-select__button { width: 100%; height: 46px; }

/* Order review card (right, sticky) */
.duchi-checkout__review { min-width: 0; }

/* Receipt paper with scalloped top + bottom edges (05 §5). The whole card —
   heading, line items, total, payment — reads as one torn paper receipt:
   cream circles masked off the top/bottom edges, dashed sides. */
.duchi-receipt {
  position: sticky;
  top: 90px;
  background: var(--bg-surface);
  padding: var(--wp--preset--spacing--80) var(--wp--preset--spacing--60);
  border-left: 2px dashed var(--border);
  border-right: 2px dashed var(--border);
  --scallop: 13px;
  -webkit-mask:
    radial-gradient(var(--scallop) at 50% 0, transparent 99%, #000) repeat-x 0 0 / calc(var(--scallop) * 2) var(--scallop),
    radial-gradient(var(--scallop) at 50% 100%, transparent 99%, #000) repeat-x 0 100% / calc(var(--scallop) * 2) var(--scallop),
    linear-gradient(#000, #000) no-repeat 0 var(--scallop) / 100% calc(100% - var(--scallop) * 2);
          mask:
    radial-gradient(var(--scallop) at 50% 0, transparent 99%, #000) repeat-x 0 0 / calc(var(--scallop) * 2) var(--scallop),
    radial-gradient(var(--scallop) at 50% 100%, transparent 99%, #000) repeat-x 0 100% / calc(var(--scallop) * 2) var(--scallop),
    linear-gradient(#000, #000) no-repeat 0 var(--scallop) / 100% calc(100% - var(--scallop) * 2);
}
.duchi-receipt #order_review_heading {
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.35rem;
  text-align: center;
  margin: 0 0 4px;
}
/* "receipt" sub-label under the heading, dashed rule beneath */
.duchi-receipt #order_review_heading + #order_review { margin-top: 14px; }
#order_review { background: transparent; }

#order_review .shop_table { width: 100%; border-collapse: collapse; }
#order_review .shop_table thead th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 0 0 10px;
  border-bottom: 2px dashed var(--border);
}
#order_review .shop_table tbody td,
#order_review .shop_table tbody th { padding: 12px 0; border-bottom: 1px dashed var(--border); text-align: left; font-size: .92rem; vertical-align: top; }
#order_review .shop_table td.product-total,
#order_review .shop_table th + td { text-align: right; white-space: nowrap; }
#order_review .cart_item .product-name { color: var(--text-strong); font-weight: 600; }
#order_review .cart_item .product-quantity { color: var(--text-muted); font-weight: 400; }
#order_review tfoot th { font-weight: 600; color: var(--text-body); text-align: left; }
#order_review tfoot td { text-align: right; white-space: nowrap; }
#order_review tfoot tr:not(.order-total) th,
#order_review tfoot tr:not(.order-total) td { border-bottom: 1px dashed var(--border); padding: 12px 0; }
#order_review .order-total th,
#order_review .order-total td {
  border-bottom: none;
  border-top: 2px dashed var(--border);
  padding-top: 14px;
  text-align: right;
}
#order_review .order-total th { font-family: var(--wp--preset--font-family--display); font-size: 1.05rem; text-align: left; color: var(--text-strong); }
#order_review .order-total .amount {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--price);
}
#payment {
  background: transparent;
  margin-top: 22px;
}
#payment ul.payment_methods {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  border: none;
  display: grid;
  gap: 10px;
}

/* Each method = a selectable card. Radio + label on the header row; the
   description/logos box tucks inside. Selected card gets a rose ring + tint. */
#payment ul.payment_methods li.wc_payment_method {
  margin: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--bg-surface);
  transition: border-color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
#payment ul.payment_methods li.wc_payment_method:hover { border-color: var(--action); }
#payment ul.payment_methods li.wc_payment_method:has(input.input-radio:checked) {
  border-color: var(--action);
  background: var(--bg-tint);
  box-shadow: 0 0 0 3px var(--ring-soft);
}

/* Header row: radio + bold label sit on one line */
#payment ul.payment_methods li.wc_payment_method > label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text-strong);
  cursor: pointer;
  margin: 0;
}
#payment ul.payment_methods li.wc_payment_method input.input-radio {
  width: 20px; height: 20px;
  flex-shrink: 0;
  accent-color: var(--action);
  margin: 0;
  cursor: pointer;
}
/* Gateway logos (Paystack etc.) align right on the header row */
#payment ul.payment_methods li.wc_payment_method > label img {
  margin: 0 0 0 auto;
  max-height: 24px;
  width: auto;
}

/* Description box inside the selected card — flush, no floating blob */
#payment div.payment_box {
  background: transparent;
  border: none;
  border-radius: 0;
  margin: 12px 0 0;
  padding: 12px 0 0;
  border-top: 1px dashed var(--border);
  font-size: .88rem;
  color: var(--text-body);
}
#payment div.payment_box::before { display: none; }
#payment div.payment_box p { margin: 0; }
/* Paystack logo strip sits above its blurb */
#payment div.payment_box img { max-height: 28px; width: auto; }
#place_order {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  font-size: 1.05rem;
  background: var(--action);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 15px 30px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background var(--dur-fast), transform var(--dur-base) var(--ease-out);
}
#place_order:hover { background: var(--action-hover); transform: translateY(-2px); }

/* coupon toggle notice */
.woocommerce-form-coupon-toggle { margin-bottom: 20px; }

/* ============================================================
 * Pay for order (order-pay) — brand receipt + payment cards
 * ============================================================ */

.woocommerce-order-pay .woocommerce-page-wrap { max-width: 620px; margin-inline: auto; }
.woocommerce-order-pay .entry-title,
.woocommerce-order-pay h1 { text-align: center; }

/* The order-overview bullet list → clean key/value summary card */
.woocommerce-order-pay ul.order_details {
  list-style: none;
  margin: 0 0 26px;
  padding: 20px 22px;
  background: var(--bg-tint);
  border-radius: var(--radius-md);
  display: grid;
  gap: 10px;
}
.woocommerce-order-pay ul.order_details li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: none;
  font-size: .95rem;
  color: var(--text-body);
  text-transform: none;
}
.woocommerce-order-pay ul.order_details li strong {
  font-weight: 700;
  color: var(--text-strong);
}
/* payment method line → badge */
.woocommerce-order-pay ul.order_details li.woocommerce-order-overview__payment-method strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--wp--preset--color--blush);
  color: var(--action-hover);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: .85rem;
}
/* the "Thank you, click below to pay…" intro line */
.woocommerce-order-pay .woocommerce-thankyou-order-received,
.woocommerce-order-pay > p:first-of-type { text-align: center; color: var(--text-body); }

.duchi-pay-payment__title {
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.15rem;
  color: var(--text-strong);
  margin: 24px 0 12px;
}
.duchi-pay-submit { width: 100%; margin-top: 18px; }
/* cancel link → quiet text button, centered under Pay */
.woocommerce-order-pay a.button.cancel,
.woocommerce-order-pay .cancel {
  display: inline-block;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: .9rem;
  text-decoration: underline;
  padding: 8px;
  margin-top: 4px;
}
.woocommerce-order-pay a.button.cancel:hover { color: var(--s-error); }

/* Gateway receipt form (Paystack etc. inject this on the order-pay overview
   via woocommerce_receipt_{gateway}) — basic HTML by default; brand it. */
.woocommerce-order-pay #wc-paystack-form,
.woocommerce-order-pay .woocommerce-message,
.woocommerce-order-pay form[id$="-payment-form"] {
  text-align: center;
}
.woocommerce-order-pay #wc-paystack-form p { color: var(--text-body); margin: 0 0 18px; }
.woocommerce-order-pay #wc-paystack-form .button,
.woocommerce-order-pay #wc-paystack-form button[type="submit"],
.woocommerce-order-pay #wc-paystack-form input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 220px;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  font-size: 1.05rem;
  background: var(--action);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 15px 30px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transition: background var(--dur-fast), transform var(--dur-base) var(--ease-out);
}
.woocommerce-order-pay #wc-paystack-form .button:hover,
.woocommerce-order-pay #wc-paystack-form button[type="submit"]:hover { background: var(--action-hover); transform: translateY(-2px); }
/* the cancel link sits right after Pay Now — break it to its own line, quiet it */
.woocommerce-order-pay #wc-paystack-form a.button.cancel {
  display: block;
  width: fit-content;
  margin: 14px auto 0;
  min-width: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
  font-family: var(--wp--preset--font-family--body);
  font-weight: 600;
  font-size: .9rem;
  padding: 6px;
  text-decoration: underline;
}
.woocommerce-order-pay #wc-paystack-form a.button.cancel:hover { color: var(--s-error); transform: none; }

/* ============================================================
 * Order received / thank-you (05 §5) — the warm payoff
 * ============================================================ */

.duchi-order-received {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}
.duchi-order-received__hero,
.duchi-order-failed { margin-bottom: 32px; }
.duchi-order-received__graphic {
  width: 96px; height: 96px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: var(--radius-circle);
  background: var(--wp--preset--color--blush);
  color: var(--wp--preset--color--rose);
  font-size: 2.6rem;
}
.duchi-order-received__title {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--text-strong);
  margin: 0 0 10px;
}
.duchi-order-received__meta { color: var(--text-body); font-size: 1rem; margin: 0; }
.duchi-order-received__meta strong { color: var(--text-strong); }
.duchi-order-received__sub { color: var(--text-body); margin: 0 auto; max-width: 40ch; }
.duchi-order-received__note { color: var(--text-body); margin: 24px auto 0; max-width: 42ch; }
.duchi-order-received__actions {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  margin-top: 24px;
}

/* Receipt variant for the order-details table (reuses .duchi-receipt scallop,
   but static — no sticky/min-width — and left-aligned inside). */
.duchi-receipt--order {
  position: static;
  top: auto;
  text-align: left;
  margin-top: 8px;
}
.duchi-receipt__title {
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.25rem;
  text-align: center;
  margin: 0 0 16px;
  color: var(--text-strong);
}
.duchi-receipt--order .order_details,
.duchi-receipt--order .woocommerce-table--order-details { width: 100%; border-collapse: collapse; background: transparent; }
.duchi-receipt--order .order_details thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); font-weight: 700;
  padding: 0 0 10px; border-bottom: 2px dashed var(--border); text-align: left;
}
.duchi-receipt--order .order_details thead th.woocommerce-table__product-total,
.duchi-receipt--order .order_details thead th.product-total { text-align: right; }
.duchi-receipt--order .order_details tbody td,
.duchi-receipt--order .order_details tbody th {
  padding: 12px 0; border-bottom: 1px dashed var(--border);
  text-align: left; font-size: .92rem; vertical-align: top; font-weight: 400;
}
.duchi-receipt--order .order_details tbody td.woocommerce-table__product-total,
.duchi-receipt--order .order_details tbody td.product-total { text-align: right; white-space: nowrap; }
.duchi-receipt--order .order_details .product-name { color: var(--text-strong); font-weight: 600; }
.duchi-receipt--order .order_details tfoot th { font-weight: 600; color: var(--text-body); text-align: left; }
.duchi-receipt--order .order_details tfoot td { text-align: right; white-space: nowrap; }
.duchi-receipt--order .order_details tfoot tr th,
.duchi-receipt--order .order_details tfoot tr td { border-bottom: 1px dashed var(--border); padding: 12px 0; }
.duchi-receipt--order .order_details tfoot tr.order_total th,
.duchi-receipt--order .order_details tfoot tr.order_total td {
  border-bottom: none; border-top: 2px dashed var(--border); padding-top: 14px;
}
.duchi-receipt--order .order_details tfoot tr.order_total th {
  font-family: var(--wp--preset--font-family--display); font-size: 1.05rem; color: var(--text-strong);
}
.duchi-receipt--order .order_details tfoot tr.order_total .amount {
  font-family: var(--wp--preset--font-family--display); font-weight: 800; font-size: 1.45rem; color: var(--price);
}
/* payment-method row sits last, no underline */
.duchi-receipt--order .order_details tfoot tr.payment_method th,
.duchi-receipt--order .order_details tfoot tr.payment_method td { border-bottom: none; }
/* Hide Woo's "Order again" / downloads / customer-details blocks below the receipt
   on the thank-you page — the brand actions row covers the next steps. */
.duchi-order-received .woocommerce-order-downloads,
.duchi-order-received .woocommerce-customer-details { margin-top: 28px; }
.duchi-order-received .woocommerce-customer-details .woocommerce-column__title {
  font-family: var(--wp--preset--font-family--display); font-size: 1.05rem; color: var(--text-strong);
}

/* ============================================================
 * My account (05 §6)
 * ============================================================ */

.woocommerce-account .woocommerce-MyAccount-navigation ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
.woocommerce-account .woocommerce-MyAccount-navigation li a {
  display: block;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 2px solid var(--border);
  color: var(--text-strong);
  text-decoration: none;
  font-weight: 600;
}
.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
  background: var(--wp--preset--color--blush);
  color: var(--action-hover);
  border-color: transparent;
}

/* Login / Register — full-bleed centered brand card (no chrome, no backdrop) */
/* On the logged-out login screen: hide site header, footer, page title, and
   the page-wrap padding so the auth screen owns the whole viewport. */
body.woocommerce-account:not(.logged-in) .nav-outer,
body.woocommerce-account:not(.logged-in) .site-footer,
body.woocommerce-account:not(.logged-in) .entry-title { display: none; }
body.woocommerce-account:not(.logged-in) .woocommerce-page-wrap,
body.woocommerce-account:not(.logged-in) main.wrap { max-width: none; padding: 0; margin: 0; }

.duchi-auth {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 56px) 16px;
}
.duchi-auth__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  display: grid;
  gap: 20px;
}
.duchi-auth-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(36px, 5vw, 56px) clamp(28px, 6vw, 64px);
  text-align: center;
}
.duchi-auth-card__brand { display: inline-block; margin-bottom: 20px; }
.duchi-auth-card__brand img { width: 150px; height: auto; }
.duchi-auth-card__title {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2rem);
  color: var(--text-strong);
  margin: 0 0 6px;
}
.duchi-auth-card__title--sm { font-size: 1.3rem; }
.duchi-auth-card__sub { color: var(--text-body); margin: 0 0 26px; }
.duchi-auth-card__hint { color: var(--text-muted); font-size: .9rem; text-align: left; margin: 0 0 18px; }

/* form rows — left-aligned labels/inputs inside the centered card */
.duchi-auth-card .form-row { text-align: left; margin-bottom: 18px; display: block; }
.duchi-auth-card .form-row label { display: block; font-weight: 600; font-size: .9rem; color: var(--text-strong); margin-bottom: 6px; }
.woocommerce .duchi-auth-card .form-row input.input-text,
.duchi-auth-card .input-text {
  width: 100%;
  height: 56px;
  line-height: 56px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 16px;
  font-size: 1rem;
  background: var(--bg-surface);
  color: var(--text-strong);
  outline: none;
  box-shadow: 0 0 0 0 transparent;
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.woocommerce .duchi-auth-card .password-input input.input-text { padding-right: 52px; }
.duchi-auth-card .input-text:focus { border-color: var(--action); box-shadow: 0 0 0 3px var(--ring-soft); }

/* Password field: Woo wraps the input in span.password-input and appends the
   reveal button; pin the eye inside the field on the right. */
.duchi-auth-card .password-input { position: relative; display: block; }
.duchi-auth-card .password-input .input-text { padding-right: 52px; }
.duchi-auth-card .show-password-input {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-circle);
  padding: 0;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.duchi-auth-card .show-password-input:hover { color: var(--action); background: var(--bg-tint); }
.duchi-auth-card .show-password-input.display-password { color: var(--action); }

.duchi-auth-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.duchi-auth-card__forgot { font-size: .9rem; font-weight: 600; color: var(--action); text-decoration: none; white-space: nowrap; }
.duchi-auth-card__forgot:hover { text-decoration: underline; }
.duchi-auth-card__submit { width: 100%; justify-content: center; height: 56px; font-size: 1.05rem; }
.duchi-auth-card--register { background: var(--bg-tint); }

/* Remember-me as a sweet toggle switch */
.duchi-auth-card .woocommerce-form-login__rememberme {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
  color: var(--text-body);
  margin: 0;
  cursor: pointer;
  user-select: none;
}
.duchi-auth-card .woocommerce-form-login__rememberme .woocommerce-form__input-checkbox {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  margin: 0;
  border-radius: var(--radius-pill);
  background: var(--border);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out);
}
.duchi-auth-card .woocommerce-form-login__rememberme .woocommerce-form__input-checkbox::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-circle);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform var(--dur-base) var(--ease-out);
}
.duchi-auth-card .woocommerce-form-login__rememberme .woocommerce-form__input-checkbox:checked { background: var(--action); }
.duchi-auth-card .woocommerce-form-login__rememberme .woocommerce-form__input-checkbox:checked::before { transform: translateX(18px); }
.duchi-auth-card .woocommerce-form-login__rememberme .woocommerce-form__input-checkbox:focus-visible { box-shadow: 0 0 0 3px var(--ring-soft); }

/* Dashboard greeting + quick value-cards */
.duchi-account-dash__greeting {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  color: var(--text-strong);
  margin: 0 0 4px;
}
.duchi-account-dash__sub { color: var(--text-body); margin: 0 0 28px; }
.duchi-account-dash__sub a { color: var(--action); font-weight: 600; }

.duchi-account-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.duchi-account-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--40);
  text-decoration: none;
  transition: border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.duchi-account-card:hover {
  border-color: var(--action);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.duchi-account-card__icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-circle);
  background: var(--bg-tint);
  display: grid; place-items: center;
  color: var(--action-hover);
  margin-bottom: 8px;
}
.duchi-account-card__title { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 1.05rem; color: var(--text-strong); }
.duchi-account-card__desc { font-size: .85rem; color: var(--text-body); }

/* Status stock-pill (Processing / Completed / …) */
.duchi-status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: .78rem;
  font-weight: 700;
  background: var(--bg-tint);
  color: var(--text-body);
  white-space: nowrap;
}
.duchi-status-pill--processing { background: rgba(231, 146, 46, .16); color: var(--s-warning); }
.duchi-status-pill--completed { background: rgba(47, 183, 116, .16); color: var(--s-success); }
.duchi-status-pill--on-hold { background: rgba(231, 146, 46, .16); color: var(--s-warning); }
.duchi-status-pill--cancelled,
.duchi-status-pill--failed { background: rgba(224, 68, 91, .14); color: var(--s-error); }
.duchi-status-pill--refunded { background: var(--bg-tint); color: var(--text-muted); }

/* Account orders table — receipt-style dashed rows */
.duchi-orders-table { width: 100%; border-collapse: collapse; }
.duchi-orders-table thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); font-weight: 700;
  padding: 0 14px 10px 0; border-bottom: 2px dashed var(--border); text-align: left;
}
.duchi-orders-table tbody td,
.duchi-orders-table tbody th {
  padding: 16px 14px 16px 0; border-bottom: 1px dashed var(--border);
  text-align: left; font-size: .92rem; font-weight: 400; vertical-align: middle;
}
.duchi-orders-table tbody tr:last-child td,
.duchi-orders-table tbody tr:last-child th { border-bottom: none; }
.duchi-orders-table .woocommerce-orders-table__cell-order-number a { font-weight: 700; color: var(--text-strong); text-decoration: none; }
.duchi-orders-table .woocommerce-orders-table__cell-order-number a:hover { color: var(--action); }
.duchi-orders-table .woocommerce-orders-table__cell-order-actions { text-align: right; white-space: nowrap; }
.duchi-orders-table .woocommerce-orders-table__cell-order-actions .btn { margin-left: 8px; }
.duchi-orders-table .woocommerce-orders-table__cell-order-actions .view { background: var(--bg-surface); border: 2px solid var(--border); color: var(--text-strong); }
.duchi-orders-table .woocommerce-orders-table__cell-order-actions .view:hover { border-color: var(--action); }
.duchi-orders-pagination { display: flex; gap: 10px; margin-top: 22px; }

.duchi-account-empty { text-align: center; padding: 40px 8px; display: grid; gap: 8px; justify-items: center; }
.duchi-account-empty__blob {
  width: 84px; height: 84px; display: grid; place-items: center;
  border-radius: var(--radius-circle); background: var(--wp--preset--color--blush);
  font-size: 2.2rem; margin-bottom: 4px;
}
.duchi-account-empty__title { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 1.3rem; color: var(--text-strong); margin: 0; }
.duchi-account-empty__line { color: var(--text-body); margin: 0 0 8px; }

/* ============================================================
 * Responsive
 * ============================================================ */

@media (max-width: 920px) {
  ul.products,
  ul.products.duchi-grid { grid-template-columns: repeat(2, 1fr); }
  .single-product div.product { grid-template-columns: 1fr; }
  .duchi-account-cards { grid-template-columns: repeat(2, 1fr); }
  /* cart: totals drop below the item list */
  .duchi-cart { grid-template-columns: 1fr; }
  .cart-collaterals .cart_totals { position: static; }
}
@media (max-width: 680px) {
  ul.products,
  ul.products.duchi-grid { grid-template-columns: 1fr; }
  .duchi-account-cards { grid-template-columns: repeat(2, 1fr); }
  .single-product-main { padding-block: var(--wp--preset--spacing--50) var(--wp--preset--spacing--90); }
  .duchi-breadcrumb { margin-bottom: var(--wp--preset--spacing--50); }

  /* tighten the heading top-space + side padding on cart/checkout/account */
  .woocommerce-page-wrap {
    padding-block: var(--wp--preset--spacing--50) var(--wp--preset--spacing--90);
    padding-inline: 5px;
  }
  .woocommerce-cart h1.entry-title,
  .woocommerce-cart .wp-block-post-title { margin-bottom: var(--wp--preset--spacing--60); }

  /* Cart row → card: thumb left, details stack right, remove pinned top-right */
  .duchi-cart-row {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb info subtotal"
      "thumb qty  remove";
    column-gap: 14px;
    row-gap: 12px;
    align-items: center;
    padding: 16px 0;
  }
  .duchi-cart-row__thumb { grid-area: thumb; align-self: start; }
  .duchi-cart-row__thumb img { width: 64px; height: 64px; }
  .duchi-cart-row__info { grid-area: info; }
  .duchi-cart-row__subtotal { grid-area: subtotal; justify-self: end; align-self: start; font-size: 1.05rem; }
  .duchi-cart-row__qty { grid-area: qty; justify-self: start; }
  .duchi-cart-row__remove { grid-area: remove; justify-self: end; }

  /* coupon + action buttons go full-width, stacked */
  .duchi-cart__actions { flex-direction: column; align-items: stretch; }
  .coupon { max-width: none; }
  .duchi-cart__actions .button,
  .duchi-cart__actions a.btn { width: 100%; text-align: center; justify-content: center; }

  /* ---- Checkout: single column, order summary as a top accordion ---- */
  .duchi-checkout { grid-template-columns: 1fr; gap: var(--wp--preset--spacing--50); }
  .duchi-checkout__review { order: -1; }
  .duchi-receipt {
    position: static;
    padding: 0;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    -webkit-mask: none;
            mask: none;
    margin-bottom: var(--wp--preset--spacing--70);
  }

  /* tappable summary header: label + chevron on the left, total on the right */
  .duchi-receipt #order_review_heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 16px 18px;
    text-align: left;
    font-size: 1.05rem;
    cursor: pointer;
    user-select: none;
  }
  .duchi-summary__label { display: inline-flex; align-items: center; gap: 8px; }
  .duchi-summary__chevron { display: inline-flex; transition: transform var(--dur-base) var(--ease-out); color: var(--action); }
  .duchi-receipt.summary-open .duchi-summary__chevron { transform: rotate(180deg); }
  .duchi-summary__total {
    font-family: var(--wp--preset--font-family--display);
    font-weight: 800;
    color: var(--price);
  }

  /* collapsed by default: hide the line-item/totals table; payment stays */
  .duchi-receipt #order_review_heading + #order_review { margin-top: 0; }
  #order_review .woocommerce-checkout-review-order-table { display: none; }
  .duchi-receipt.summary-open #order_review .woocommerce-checkout-review-order-table {
    display: table;
    width: 100%;
    margin: 0;
    border-top: 1.5px dashed var(--border);
  }
  /* inset the rows to match the 18px header padding */
  .duchi-receipt.summary-open #order_review .shop_table th:first-child,
  .duchi-receipt.summary-open #order_review .shop_table td:first-child { padding-left: 18px; }
  .duchi-receipt.summary-open #order_review .shop_table th:last-child,
  .duchi-receipt.summary-open #order_review .shop_table td:last-child { padding-right: 18px; }
  /* payment moved by JS to the end of the page — last thing, full width */
  .duchi-checkout__payment-host { order: 99; margin-top: 0; }
  .duchi-checkout__payment-host #payment { padding: 0; background: transparent; }
  /* notes is the last field above payment — drop its trailing margin on mobile */
  .duchi-checkout .woocommerce-additional-fields .form-row:last-child { margin-bottom: 0; }

  /* cart-added notice: drop the View-cart button onto its own row */
  .woocommerce-message,
  .woocommerce-info { flex-wrap: wrap; }
  .woocommerce-message .button,
  .woocommerce-info .button {
    margin-left: 0;
    margin-top: 4px;
    flex-basis: 100%;
    text-align: center;
  }
}
