/*
 * Cser Kiadó app shell — 2.8
 *
 * A mobile-first shopping layer over the editorial reading-room design:
 * same palette, typography and sharp editorial lines, with app-style
 * navigation, sheets, sticky actions and touch-sized controls.
 * The Smart Slider hero section is intentionally left untouched.
 */

:root {
  --app-ink: #192321;
  --app-paper: #ffffff;
  --app-cream: #f6f3ec;
  --app-sand: #e6dfd2;
  --app-teal: #14777a;
  --app-teal-dark: #0c575a;
  --app-teal-tint: #e7f1ef;
  --app-terracotta: #bd6e5e;
  --app-line: rgba(25, 35, 33, 0.12);
  --app-muted: rgba(25, 35, 33, 0.62);
  --app-radius: 4px;
  --app-sheet-radius: 16px;
  --app-tabbar-h: 62px;
  --app-safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-header-offset: 0px;
  --app-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --app-shadow-float: 0 18px 50px -12px rgba(25, 35, 33, 0.32);
}

/* ---------- Global touch and motion polish ---------- */

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--app-header-offset) + 16px);
}

body.cser-app {
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

body.cser-app a,
body.cser-app button,
body.cser-app input[type="submit"],
body.cser-app .button {
  touch-action: manipulation;
}

body.cser-app :focus-visible {
  outline: 2px solid var(--app-teal);
  outline-offset: 2px;
}

body.is-sheet-open {
  overflow: hidden;
}

.skip-link.screen-reader-text:focus {
  position: fixed !important;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.18s;
}

.cser-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cser-icon-button {
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--app-ink);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.cser-icon-button:hover,
.cser-icon-button:active {
  background: rgba(25, 35, 33, 0.06);
}

.cser-sheet-handle {
  display: none;
}

/* ---------- Header ---------- */

.site-header {
  transition: transform 0.28s var(--app-ease), box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 6px 24px -18px rgba(25, 35, 33, 0.45);
}

.cser-nav-sheet-header,
.cser-nav-sheet-footer,
.cser-search-cancel {
  display: none;
}

.header-actions .cart-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.2s var(--app-ease);
}

.cart-btn-primary.is-updated .cart-pill,
.cser-tabbar__item.is-bumped .cser-tabbar-count {
  animation: cser-bump 0.5s var(--app-ease);
}

/* The VAT note under the order total may wrap, so the checkout table never
   grows wider than the screen (the total cell itself stays on one line). */
/* No separate VAT note under totals in the cart, checkout and order pages;
   the shipping address column on the order confirmation lines up with the
   billing one (the checkout's .col-2 spacing hit it too). */
body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot td .includes_tax,
body.woocommerce-cart .cart_totals .includes_tax,
body.woocommerce-order-received .woocommerce-order-details tfoot td .includes_tax,
body.woocommerce-view-order .woocommerce-order-details tfoot td .includes_tax {
  display: none;
}

body.woocommerce-order-received .woocommerce-customer-details .col2-set .col-2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

@keyframes cser-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.45); }
  100% { transform: scale(1); }
}

@media (min-width: 901px) {
  .site-header.is-scrolled .header-container {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .site-header .brand-logo img,
  .site-header .brand-logo .custom-logo {
    transition: height 0.25s var(--app-ease), max-height 0.25s var(--app-ease);
  }

  .site-header.is-scrolled .brand-logo img,
  .site-header.is-scrolled .brand-logo .custom-logo {
    height: 76px !important;
    max-height: 76px !important;
  }

  .editorial-header-search .search-input-group {
    border-radius: var(--app-radius);
  }
}

/* ---------- Home: chips and shelves ---------- */

.cser-chip-rail {
  width: min(100% - 80px, 1360px);
  margin: 28px auto 0;
}

.cser-chip-rail ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cser-chip {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  background: var(--app-paper);
  color: var(--app-ink);
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cser-chip:hover,
.cser-chip:focus-visible {
  border-color: var(--app-teal);
  background: var(--app-teal-tint);
  color: var(--app-teal-dark);
}

.cser-chip-rail--archive {
  width: auto;
  margin: 0 0 22px;
}

.cser-shelf-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.cser-shelf-all {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--app-teal);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cser-shelf-all:hover {
  color: var(--app-teal-dark);
}

.cser-category-shelf .cser-shelf-footer {
  display: none;
}

/* ---------- Product cards ---------- */

ul.products li.product.editorial-product-card,
.product-card.editorial-product-card {
  position: relative;
}

ul.products li.product.editorial-product-card .editorial-product-thumb,
.product-card.editorial-product-card .editorial-product-thumb {
  position: relative;
  display: block;
  height: auto !important;
  aspect-ratio: 4 / 5;
  padding: 0 !important;
  overflow: hidden;
  border-radius: var(--app-radius);
  background: transparent !important;
}

ul.products li.product.editorial-product-card .editorial-product-thumb .product-image-link,
.product-card.editorial-product-card .editorial-product-thumb .product-image-link {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9% 12%;
}

ul.products li.product.editorial-product-card .editorial-product-thumb img,
.product-card.editorial-product-card .editorial-product-thumb img {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 100% !important;
  object-fit: contain;
  box-shadow: 0 1px 2px rgba(25, 35, 33, 0.12), 0 12px 22px -12px rgba(25, 35, 33, 0.45) !important;
  transition: transform 0.35s var(--app-ease), box-shadow 0.35s var(--app-ease);
}

@media (hover: hover) {
  ul.products li.product.editorial-product-card:hover .editorial-product-thumb img,
  .product-card.editorial-product-card:hover .editorial-product-thumb img {
    transform: translateY(-4px) scale(1.015);
    box-shadow: 0 1px 2px rgba(25, 35, 33, 0.12), 0 22px 30px -14px rgba(25, 35, 33, 0.5) !important;
  }
}

.editorial-product-thumb .quick-preview-btn {
  display: none !important;
}

.cser-card-flag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 2px;
  background: var(--app-terracotta);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  pointer-events: none;
}

.cser-card-flag--muted {
  background: var(--app-ink);
}

.editorial-product-card .editorial-product-author {
  margin-top: 12px !important;
  overflow: hidden;
  font-size: 0.74rem !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

ul.products li.product .editorial-product-title,
.editorial-product-title {
  display: -webkit-box;
  margin-top: 4px !important;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.editorial-product-title a::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
}

.editorial-product-card .product-footer {
  position: relative;
  z-index: 3;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  align-items: flex-end !important;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px !important;
}

.editorial-product-card .product-footer .cser-card-discount {
  display: none;
}

.editorial-product-card .price-box {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  font-size: 1rem !important;
  line-height: 1.2 !important;
}

.editorial-product-card .price-box del {
  order: -1;
  color: var(--app-muted);
  font-size: 0.74rem;
  font-weight: 400;
  opacity: 1;
}

.editorial-product-card .price-box ins {
  color: var(--app-teal);
  text-decoration: none;
}

/* Add-to-cart: compact icon button that turns into a check once added. */
.editorial-product-card .product-footer .button,
ul.products li.product.editorial-product-card .product-footer .button {
  position: relative;
  display: inline-flex !important;
  width: auto !important;
  min-width: 44px;
  height: 44px;
  min-height: 44px !important;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 !important;
  padding: 0 14px !important;
  border: 0 !important;
  border-radius: var(--app-radius) !important;
  background: var(--app-teal) !important;
  color: #fff !important;
  font-family: var(--font-body) !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
  text-transform: none !important;
  transition: background-color 0.15s ease, transform 0.15s var(--app-ease);
}

.editorial-product-card .product-footer .button::before {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  background: currentColor;
  content: "";
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 10V7a4 4 0 0 0-8 0v3M5 8h14l1 13H4z'/%3E%3Cpath d='M12 12.5v5M9.5 15h5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 10V7a4 4 0 0 0-8 0v3M5 8h14l1 13H4z'/%3E%3Cpath d='M12 12.5v5M9.5 15h5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.editorial-product-card .product-footer .button:not(.add_to_cart_button)::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
}

.editorial-product-card .product-footer .button:not(.add_to_cart_button) {
  background: transparent !important;
  color: var(--app-teal) !important;
  box-shadow: inset 0 0 0 1px var(--app-line);
}

.editorial-product-card .product-footer .button:hover {
  background: var(--app-teal-dark) !important;
  color: #fff !important;
}

.editorial-product-card .product-footer .button:active {
  transform: scale(0.94);
}

.editorial-product-card .product-footer .button.loading {
  opacity: 1 !important;
  pointer-events: none;
}

.editorial-product-card .product-footer .button.loading::before {
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  background: none;
  -webkit-mask: none;
  mask: none;
  animation: cser-spin 0.7s linear infinite;
}

.editorial-product-card .product-footer .button.loading::after,
.editorial-product-card .product-footer .button.added::after {
  display: none !important;
}

.editorial-product-card .product-footer .button.added {
  background: var(--app-teal-dark) !important;
}

.editorial-product-card .product-footer .button.added::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

.editorial-product-card .added_to_cart {
  display: none !important;
}

@keyframes cser-spin {
  to { transform: rotate(360deg); }
}

/* ---------- Archive toolbar and load more ---------- */

.cser-loop-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cser-loop-controls .woocommerce-result-count {
  min-width: 0;
  margin: 0 !important;
  text-align: left;
  color: var(--app-muted);
  font-size: 0.82rem;
}

.cser-loop-controls .woocommerce-ordering {
  margin: 0 !important;
}

.cser-loop-controls .woocommerce-ordering select {
  min-height: 40px;
  padding: 0 34px 0 14px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  background-color: var(--app-paper);
  font-size: 0.86rem;
}

.cser-load-more {
  display: flex;
  justify-content: center;
  margin: 48px 0 8px;
}

.cser-load-more__button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  border: 1px solid var(--app-ink);
  border-radius: var(--app-radius);
  background: var(--app-paper);
  color: var(--app-ink);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.cser-load-more__button:hover {
  background: var(--app-ink);
  color: #fff;
}

.cser-load-more__button[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.cser-load-more__count {
  color: inherit;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  opacity: 0.7;
}

.js-load-more .cser-loop-pagination {
  display: none;
}

ul.products li.product.is-appended {
  animation: cser-rise 0.4s var(--app-ease) both;
}

@keyframes cser-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Free-shipping progress ---------- */

.cser-freeship {
  padding: 14px 20px 16px;
  border-bottom: 1px solid var(--app-line);
  background: var(--app-cream);
}

.cser-freeship[hidden] {
  display: none;
}

.cser-freeship__text {
  margin: 0 0 8px;
  font-size: 0.84rem;
  line-height: 1.4;
}

.cser-freeship__text strong {
  color: var(--app-teal-dark);
}

.cser-freeship__bar {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(25, 35, 33, 0.1);
}

.cser-freeship__bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--app-teal);
  transition: width 0.5s var(--app-ease);
}

.cser-freeship.is-complete .cser-freeship__text {
  color: var(--app-teal-dark);
  font-weight: 600;
}

/* ---------- Cart drawer ---------- */

.cser-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(25, 35, 33, 0.42);
  opacity: 0;
  transition: opacity 0.25s ease;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.cser-sheet-backdrop.is-visible {
  opacity: 1;
}

.cser-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 9995;
  display: flex;
  width: min(440px, 100vw);
  flex-direction: column;
  background: var(--app-paper);
  box-shadow: var(--app-shadow-float);
  transform: translateX(104%);
  transition: transform 0.32s var(--app-ease);
}

.cser-cart-drawer[hidden] {
  display: none;
}

.cser-cart-drawer.is-open {
  transform: none;
}

.cser-cart-drawer__header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 12px 14px 20px;
  border-bottom: 1px solid var(--app-line);
}

.cser-cart-drawer__header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.cser-drawer-count {
  display: inline-flex;
  min-width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 12px;
  background: var(--app-teal-tint);
  color: var(--app-teal-dark);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
}

.cser-cart-drawer .widget_shopping_cart_content {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.cser-cart-drawer .woocommerce-mini-cart {
  flex: 1 1 auto;
  margin: 0;
  padding: 4px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}

.cser-cart-drawer .woocommerce-mini-cart-item {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  column-gap: 14px;
  min-height: 112px;
  padding: 16px 36px 16px 0;
  border-bottom: 1px solid var(--app-line);
}

.cser-cart-drawer .woocommerce-mini-cart-item > a:not(.remove) {
  display: contents;
  color: var(--app-ink);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
}

.cser-cart-drawer .woocommerce-mini-cart-item img {
  grid-row: 1 / span 3;
  width: 64px !important;
  height: 92px !important;
  margin: 0 !important;
  object-fit: contain;
  object-position: top;
  background: transparent;
  box-shadow: 0 8px 14px -10px rgba(25, 35, 33, 0.5);
}

.cser-cart-drawer .woocommerce-mini-cart-item .variation {
  grid-column: 2;
  margin: 4px 0 0;
  font-size: 0.78rem;
}

.cser-cart-drawer .woocommerce-mini-cart-item .remove {
  position: absolute;
  top: 10px;
  right: -8px;
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--app-muted) !important;
  font-size: 1.4rem;
  line-height: 1;
}

.cser-cart-drawer .woocommerce-mini-cart-item .remove:hover {
  background: rgba(189, 110, 94, 0.12);
  color: var(--app-terracotta) !important;
}

.cser-cart-drawer .woocommerce-mini-cart-item > .quantity,
.cser-mini-qty {
  grid-column: 2;
  align-self: end;
}

.cser-mini-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.cser-mini-qty__price {
  font-weight: 700;
}

.cser-mini-qty.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

.cser-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
}

.cser-stepper__btn {
  display: inline-flex;
  width: 38px;
  height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--app-ink);
  font-size: 1.15rem;
  cursor: pointer;
}

.cser-stepper__btn:disabled {
  color: rgba(25, 35, 33, 0.25);
  cursor: default;
}

.cser-stepper__value {
  min-width: 26px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: center;
}

.cser-cart-drawer .woocommerce-mini-cart__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0;
  padding: 16px 20px 6px;
  border-top: 1px solid var(--app-line);
  font-size: 0.95rem;
}

.cser-cart-drawer .woocommerce-mini-cart__total .amount {
  font-size: 1.25rem;
  font-weight: 700;
}

.cser-cart-drawer .woocommerce-mini-cart__buttons {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin: 0;
  padding: 10px 20px calc(18px + var(--app-safe-bottom));
}

.cser-cart-drawer .woocommerce-mini-cart__buttons .button {
  display: inline-flex !important;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  padding: 0 14px !important;
  border: 1px solid var(--app-ink) !important;
  border-radius: var(--app-radius) !important;
  background: var(--app-paper) !important;
  color: var(--app-ink) !important;
  font-family: var(--font-body) !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-align: center;
  text-transform: none !important;
}

.cser-cart-drawer .woocommerce-mini-cart__buttons .button.checkout {
  border-color: var(--app-teal) !important;
  background: var(--app-teal) !important;
  color: #fff !important;
}

.cser-cart-drawer .woocommerce-mini-cart__empty-message {
  margin: auto;
  padding: 48px 28px;
  color: var(--app-muted);
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-style: italic;
  text-align: center;
}

/* ---------- Toasts ---------- */

.cser-toast-region {
  position: fixed;
  right: 16px;
  bottom: calc(20px + var(--app-safe-bottom));
  left: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.cser-toast {
  display: flex;
  width: min(440px, 100%);
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  border-radius: 10px;
  background: var(--app-ink);
  color: #fff;
  box-shadow: var(--app-shadow-float);
  font-size: 0.9rem;
  pointer-events: auto;
  animation: cser-toast-in 0.32s var(--app-ease) both;
}

.cser-toast.is-leaving {
  animation: cser-toast-out 0.22s ease both;
}

.cser-toast img {
  width: 32px;
  height: 46px;
  flex: 0 0 auto;
  object-fit: cover;
}

.cser-toast__icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--app-teal);
}

.cser-toast__icon .cser-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}

.cser-toast__text {
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.3;
}

.cser-toast__text small {
  display: block;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cser-toast__action {
  flex: 0 0 auto;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #9fd9d4;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.cser-toast--error .cser-toast__icon {
  background: var(--app-terracotta);
}

@keyframes cser-toast-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes cser-toast-out {
  to { opacity: 0; transform: translateY(10px); }
}

/* ---------- Sticky buy bar (product page) ---------- */

.cser-buybar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px max(16px, calc((100vw - 1360px) / 2)) calc(10px + var(--app-safe-bottom));
  border-top: 1px solid var(--app-line);
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 -10px 30px -22px rgba(25, 35, 33, 0.5);
  transform: translateY(110%);
  transition: transform 0.3s var(--app-ease);
}

.cser-buybar[hidden] {
  display: none;
}

.cser-buybar:not(.is-visible) {
  visibility: hidden;
  transition: transform 0.3s var(--app-ease), visibility 0s linear 0.3s;
}

.cser-buybar.is-visible {
  transform: none;
}

.cser-buybar__thumb {
  width: 40px;
  height: 58px;
  flex: 0 0 auto;
  object-fit: cover;
  box-shadow: 0 6px 12px -8px rgba(25, 35, 33, 0.6);
}

.cser-buybar__info {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
}

.cser-buybar__title {
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cser-buybar__price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--app-teal);
  font-size: 1rem;
  font-weight: 700;
}

.cser-buybar__price del {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.cser-buybar__price ins {
  text-decoration: none;
}

.cser-buybar .cser-card-discount {
  padding: 2px 6px;
  background: var(--app-terracotta);
  color: #fff;
  font-size: 0.68rem;
}

.cser-buybar__button {
  display: inline-flex;
  min-height: 50px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--app-radius);
  background: var(--app-teal);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s var(--app-ease);
}

.cser-buybar__button:hover {
  background: var(--app-teal-dark);
}

.cser-buybar__button:active {
  transform: scale(0.97);
}

.cser-buybar__button.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

.cser-buybar__soldout {
  color: var(--app-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

/* Product page purchase panel: larger, clearer primary action. */
body.cser-app .cser-purchase-panel form.cart .single_add_to_cart_button.button {
  flex: 1 1 auto;
  min-height: 54px !important;
  padding: 0 24px !important;
  border-radius: var(--app-radius) !important;
  font-family: var(--font-body) !important;
  font-size: 0.98rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
}

body.cser-app .cser-purchase-panel .single_add_to_cart_button.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

.cser-purchase-panel .quantity .qty {
  min-height: 54px;
  font-size: 1rem;
}

/* ---------- Tab bar (hidden on desktop) ---------- */

.cser-tabbar {
  display: none;
}

/* =====================================================================
   Tablet and mobile: the app shell
   ===================================================================== */

@media (max-width: 900px) {
  body.cser-app {
    --app-bottom-offset: 0px;
  }

  body.cser-has-tabbar {
    --app-bottom-offset: calc(var(--app-tabbar-h) + var(--app-safe-bottom));
    padding-bottom: var(--app-bottom-offset);
  }

  /* Header: compact bar that slides away while scrolling down. */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    border-bottom: 1px solid var(--app-line);
  }

  body.admin-bar .site-header {
    top: 0;
  }

  .site-header.is-hidden {
    transform: translateY(-100%);
  }

  /* Fixed sheets live inside the header, so it must not be transformed and
     has to sit above the tab bar and backdrop while they are open. */
  body.is-nav-open .site-header,
  body.is-search-open .site-header {
    z-index: 9997;
    transform: none !important;
    transition: none;
  }

  body.is-nav-open .site-header::after {
    position: absolute;
    inset: 0;
    z-index: 9994;
    background: rgba(25, 35, 33, 0.42);
    content: "";
  }

  .site-header .header-container {
    position: relative;
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) 48px !important;
    align-items: center;
    gap: 6px 8px !important;
    width: 100%;
    padding: 6px 12px 10px !important;
  }

  .site-header .mobile-menu-toggle {
    display: inline-flex !important;
    grid-row: 1;
    grid-column: 1;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--app-ink);
  }

  .site-header .mobile-menu-toggle__icon,
  .site-header .mobile-menu-toggle__icon span {
    display: block;
    width: 22px;
  }

  .site-header .mobile-menu-toggle__icon span {
    height: 2px;
    margin: 5px 0;
    border-radius: 1px;
    background: currentColor;
  }

  .site-header .mobile-menu-toggle__icon span:nth-child(2) {
    width: 15px;
  }

  .site-header .mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle__icon span {
    opacity: 1;
    transform: none;
  }

  .site-header .brand-logo {
    grid-row: 1;
    grid-column: 2;
    justify-self: center;
    min-width: 0;
  }

  .site-header .brand-logo img,
  .site-header .brand-logo .custom-logo {
    width: auto !important;
    height: 46px !important;
    max-height: 46px !important;
  }

  .site-header .header-utilities {
    display: contents !important;
  }

  .site-header .header-actions {
    display: flex !important;
    grid-row: 1;
    grid-column: 3;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
  }

  .site-header .header-actions .account-btn-primary {
    display: none !important;
  }

  .site-header .header-actions .icon-btn {
    position: relative;
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px;
  }

  .site-header .header-actions .icon-btn svg {
    width: 23px;
    height: 23px;
  }

  .site-header .header-actions .icon-btn span:not(.cart-pill) {
    display: none;
  }

  .site-header .header-actions .cart-pill {
    position: absolute;
    top: 4px;
    right: 2px;
  }

  /* Search pill in the header; tapping it opens the full-screen search. */
  .site-header .editorial-header-search {
    display: block !important;
    grid-row: 2;
    grid-column: 1 / -1;
    width: 100%;
  }

  .site-header .editorial-header-search .search-input-group {
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 8px;
    padding: 0 6px 0 14px;
    border: 0;
    border-radius: 999px;
    background: #f1efe9;
  }

  .site-header .editorial-header-search .search-input {
    min-width: 0;
    flex: 1 1 auto;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 1rem;
    outline: 0;
  }

  .site-header .editorial-header-search .search-icon-svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    stroke-width: 1.8;
  }

  /* Full-screen search sheet. */
  body.is-search-open .site-header .editorial-header-search {
    position: fixed;
    inset: 0;
    z-index: 9996;
    display: flex !important;
    flex-direction: column;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 0;
    background: var(--app-paper);
    animation: cser-fade-in 0.18s ease both;
  }

  body.is-search-open .site-header .editorial-header-search .search-input-group {
    flex: 0 0 auto;
    padding-right: 4px;
  }

  body.is-search-open .cser-search-cancel {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 0 12px;
    border: 0;
    background: transparent;
    color: var(--app-teal);
    font-size: 0.95rem;
    font-weight: 600;
  }

  body.is-search-open .site-header .search-results-dropdown {
    position: static;
    display: block;
    width: 100%;
    max-height: none;
    flex: 1 1 auto;
    margin: 10px 0 0;
    padding: 0 0 calc(24px + var(--app-safe-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0;
    box-shadow: none;
  }

  body.is-search-open .site-header .search-results-dropdown:not(.active)::before {
    display: block;
    padding: 28px 8px;
    color: var(--app-muted);
    content: attr(data-hint);
    font-family: var(--font-title);
    font-size: 1.2rem;
    font-style: italic;
    text-align: center;
  }

  body.is-search-open .search-result-item {
    min-height: 76px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--app-line);
  }

  /* Navigation as a sheet. */
  .site-header .main-nav {
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 9995;
    display: flex !important;
    width: min(380px, 88vw) !important;
    max-width: none;
    flex-direction: column;
    margin: 0 !important;
    padding: env(safe-area-inset-top, 0px) 0 0;
    border: 0 !important;
    background: var(--app-paper) !important;
    box-shadow: var(--app-shadow-float);
    visibility: hidden;
    transform: translateX(-104%);
    transition: transform 0.32s var(--app-ease), visibility 0s linear 0.32s;
  }

  .site-header .main-nav.is-mobile-open {
    visibility: visible;
    transform: none;
    transition: transform 0.32s var(--app-ease), visibility 0s;
  }

  .cser-nav-sheet-header .cser-sheet-handle {
    display: none;
  }

  .cser-nav-sheet-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: 12px 10px 12px 22px;
    border-bottom: 1px solid var(--app-line);
  }

  .cser-nav-sheet-title {
    font-family: var(--font-title);
    font-size: 1.7rem;
    font-weight: 500;
    letter-spacing: -0.02em;
  }

  .site-header .main-nav .nav-container {
    display: block !important;
    height: auto !important;
    width: auto !important;
    min-width: 0 !important;
    flex: 1 1 auto;
    align-self: stretch;
    margin: 0 !important;
    padding: 6px 0 !important;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .site-header .main-nav .primary-menu {
    display: block !important;
    margin: 0;
    padding: 0;
  }

  .site-header .main-nav .primary-menu > li {
    position: relative;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 52px;
    margin: 0;
    border-bottom: 1px solid var(--app-line);
  }

  .site-header .main-nav .primary-menu > li > a {
    display: flex !important;
    min-height: 54px;
    align-items: center;
    padding: 0 22px !important;
    color: var(--app-ink);
    font-family: var(--font-body) !important;
    font-size: 1.02rem !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  .site-header .main-nav .primary-menu > li:not(.menu-item-has-children) > a {
    grid-column: 1 / -1;
  }

  .site-header .main-nav .primary-menu > li.current-menu-item > a,
  .site-header .main-nav .primary-menu > li.current-menu-ancestor > a {
    color: var(--app-teal);
  }

  .site-header .main-nav .primary-menu .submenu-indicator,
  .site-header .main-nav .primary-menu .menu-item-has-children > a::after {
    display: none !important;
  }

  .site-header .main-nav .submenu-toggle {
    position: static !important;
    display: inline-flex !important;
    width: 52px !important;
    height: 54px !important;
    align-items: center;
    justify-content: center;
  }

  .site-header .main-nav .sub-menu {
    position: static !important;
    grid-column: 1 / -1;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 0 10px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }

  .site-header .main-nav .menu-item-has-children:not(.is-open) > .sub-menu {
    display: none !important;
  }

  .site-header .main-nav .menu-item-has-children.is-open > .sub-menu {
    display: block !important;
  }

  .site-header .main-nav .sub-menu a {
    display: flex !important;
    min-height: 44px;
    align-items: center;
    padding: 0 22px 0 36px !important;
    color: var(--app-muted);
    font-size: 0.95rem !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  .cser-nav-sheet-footer {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 2px;
    padding: 14px 22px calc(18px + var(--app-safe-bottom));
    border-top: 1px solid var(--app-line);
    background: var(--app-cream);
    font-size: 0.9rem;
  }

  .cser-nav-sheet-footer a {
    display: flex;
    min-height: 36px;
    align-items: center;
    color: var(--app-muted);
  }

  .cser-nav-sheet-footer .cser-nav-sheet-cta {
    justify-content: space-between;
    min-height: 52px;
    margin-bottom: 8px;
    padding: 0 16px;
    border-radius: var(--app-radius);
    background: var(--app-teal);
    color: #fff;
    font-weight: 600;
  }

  .cser-nav-sheet-footer .cser-nav-sheet-cta .cser-icon {
    width: 20px;
    height: 20px;
  }

  /* Tab bar */
  .cser-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9100;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: calc(var(--app-tabbar-h) + var(--app-safe-bottom));
    padding: 0 4px var(--app-safe-bottom);
    border-top: 1px solid var(--app-line);
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: saturate(1.6) blur(18px);
    backdrop-filter: saturate(1.6) blur(18px);
  }

  .cser-tabbar__item {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(25, 35, 33, 0.58);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1;
    transition: color 0.15s ease;
  }

  .cser-tabbar__item > span:last-child {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cser-tabbar__item .cser-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.2s var(--app-ease);
  }

  .cser-tabbar__item:active .cser-icon {
    transform: scale(0.88);
  }

  .cser-tabbar__item.is-active {
    color: var(--app-teal);
  }

  .cser-tabbar__item.is-active::before {
    position: absolute;
    top: -1px;
    left: 50%;
    width: 28px;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: var(--app-teal);
    content: "";
    transform: translateX(-50%);
  }

  .cser-tabbar__icon {
    position: relative;
    display: inline-flex;
  }

  .cser-tabbar-count {
    position: absolute;
    top: -7px;
    right: -11px;
    display: inline-flex;
    min-width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 9px;
    background: var(--app-terracotta);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
    box-sizing: border-box;
  }

  .cser-tabbar-count[data-count="0"] {
    display: none;
  }

  /* Cart drawer becomes a bottom sheet. */
  .cser-cart-drawer {
    top: auto;
    right: 0;
    left: 0;
    width: 100%;
    max-height: min(88dvh, 88vh);
    border-radius: var(--app-sheet-radius) var(--app-sheet-radius) 0 0;
    transform: translateY(104%);
  }

  .cser-cart-drawer.is-open {
    transform: none;
  }

  .cser-cart-drawer.is-dragging {
    transition: none;
  }

  .cser-sheet-handle {
    position: absolute;
    top: 6px;
    left: 50%;
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(25, 35, 33, 0.18);
    transform: translateX(-50%);
  }

  .cser-cart-drawer__header {
    padding-top: 18px;
    touch-action: none;
  }

  /* Floating UI sits above the tab bar. */
  .cser-toast-region {
    bottom: calc(var(--app-bottom-offset) + var(--app-safe-bottom) + 12px);
  }

  body.cser-has-tabbar .cser-toast-region {
    bottom: calc(var(--app-bottom-offset) + 12px);
  }

  body.cser-has-tabbar .cser-buybar {
    bottom: var(--app-bottom-offset);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--app-line);
  }

  body.single-product .cser-toast-region {
    bottom: calc(var(--app-bottom-offset) + var(--app-safe-bottom) + 92px);
  }

  /* Home: shelves become swipeable rails. */
  .cser-chip-rail {
    width: auto;
    margin: 18px 0 0;
  }

  .cser-chip-rail ul {
    position: relative;
    flex-wrap: nowrap;
    padding: 0 20px;
    overflow-x: auto;
    scroll-padding: 0 20px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .cser-chip-rail ul::-webkit-scrollbar {
    display: none;
  }

  .cser-chip-rail li {
    scroll-snap-align: start;
  }

  .cser-chip-rail--archive {
    margin: 0 -20px 18px;
  }

  .cser-editorial-home .cser-category-shelf {
    padding: 34px 0 30px !important;
  }

  .cser-editorial-home .cser-shelf-heading {
    align-items: center;
    margin: 0 0 18px !important;
    padding: 0 20px;
  }

  .cser-editorial-home .cser-shelf-heading h2 {
    font-size: clamp(1.9rem, 8vw, 2.6rem) !important;
    line-height: 1.05;
  }

  .cser-editorial-home ul.products.cser-rail {
    position: relative;
    display: grid !important;
    grid-template-columns: none !important;
    grid-auto-columns: calc((100% - 40px - 3 * 14px) / 3.4);
    grid-auto-flow: column;
    gap: 14px !important;
    margin: 0 !important;
    padding: 0 20px 6px !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding: 0 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .cser-editorial-home ul.products.cser-rail::-webkit-scrollbar {
    display: none;
  }

  .cser-editorial-home ul.products.cser-rail > li {
    scroll-snap-align: start;
  }

  /* TOP5 becomes a swipeable ranking rail. */
  .cser-editorial-home .cser-top5 {
    padding: 34px 0 30px;
  }

  .cser-editorial-home .cser-top5__heading {
    margin-bottom: 18px;
    padding: 0 20px;
  }

  .cser-editorial-home .cser-top5__list {
    position: relative;
    display: grid;
    grid-template-columns: none;
    grid-auto-columns: calc((100% - 40px - 3 * 14px) / 3.4);
    grid-auto-flow: column;
    gap: 14px;
    padding: 0 20px 6px;
    overflow-x: auto;
    scroll-padding: 0 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .cser-editorial-home .cser-top5__list::-webkit-scrollbar {
    display: none;
  }

  .cser-editorial-home .cser-top5__item {
    scroll-snap-align: start;
  }

  .cser-editorial-home .cser-top5__art {
    height: auto;
    aspect-ratio: 4 / 5;
    padding: 30px 0 0 24%;
  }

  .cser-editorial-home .cser-top5__rank {
    font-size: clamp(90px, 26vw, 150px);
  }

  .cser-editorial-home .cser-top5__title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.92rem;
    text-align: left;
  }

  .cser-editorial-home .cser-top5__author {
    margin-top: 4px;
    text-align: left;
  }

  /* Archive: sticky toolbar under the (sliding) header. */
  .cser-shop-shell,
  .cser-product-page,
  .cser-content-shell {
    width: auto !important;
    margin-right: 20px !important;
    margin-left: 20px !important;
    padding-top: 24px !important;
  }

  .cser-product-category-archive {
    padding-top: 22px !important;
  }

  .shop-header {
    padding-bottom: 18px !important;
  }

  .cser-product-category-archive .shop-header h1,
  .shop-header h1,
  .page-title-box h1 {
    font-size: clamp(2rem, 9vw, 2.8rem) !important;
    line-height: 1.05;
  }

  .cser-loop-controls {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    min-height: 0 !important;
    position: sticky;
    top: var(--app-header-offset);
    z-index: 50;
    margin: 0 -20px 18px !important;
    padding: 8px 20px !important;
    border-bottom: 1px solid var(--app-line);
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: top 0.28s var(--app-ease);
  }

  .cser-shop-shell ul.products,
  .cser-search-results ul.products,
  .cser-product-after-summary ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 28px 14px !important;
  }

  .cser-load-more__button {
    width: 100%;
    justify-content: center;
  }

  /* Product page: cover on a soft stage, title and price above the fold. */
  .cser-product-layout {
    gap: 18px !important;
  }

  .cser-product-gallery {
    margin: -24px -20px 0;
    padding: 22px 20px 14px;
    background: transparent;
  }

  .cser-product-gallery .woocommerce-product-gallery__image img {
    max-height: min(46vh, 380px) !important;
    box-shadow: 0 2px 4px rgba(25, 35, 33, 0.1), 0 22px 34px -18px rgba(25, 35, 33, 0.55);
  }

  .cser-product-gallery .flex-control-thumbs {
    display: flex !important;
    justify-content: center;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 14px !important;
  }

  .cser-product-gallery .flex-control-thumbs li {
    width: 44px !important;
    flex: 0 0 44px;
  }

  .cser-product-gallery .flex-control-thumbs img {
    padding: 2px !important;
  }

  .cser-product-summary {
    padding-top: 0 !important;
  }

  .cser-product-summary .product_title {
    font-size: clamp(1.8rem, 8vw, 2.4rem) !important;
  }

  .cser-product-after-summary .related.products > h2 {
    font-size: clamp(1.6rem, 7vw, 2.2rem) !important;
  }

  .cser-product-after-summary ul.products {
    position: relative;
    display: grid !important;
    grid-template-columns: none !important;
    grid-auto-columns: calc((100% - 3 * 14px) / 3.4);
    grid-auto-flow: column;
    margin: 0 -20px !important;
    padding: 0 20px 6px !important;
    overflow-x: auto;
    scroll-padding: 0 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .cser-product-after-summary ul.products::-webkit-scrollbar {
    display: none;
  }

  .cser-product-after-summary ul.products > li {
    scroll-snap-align: start;
  }

  /* Forms: 16px text keeps iOS from zooming into fields. */
  body.cser-app input[type="text"],
  body.cser-app input[type="email"],
  body.cser-app input[type="tel"],
  body.cser-app input[type="password"],
  body.cser-app input[type="number"],
  body.cser-app input[type="search"],
  body.cser-app select,
  body.cser-app textarea {
    font-size: 16px !important;
  }

  body.cser-app .woocommerce form .form-row input.input-text,
  body.cser-app .woocommerce form .form-row select,
  body.cser-app .woocommerce form .form-row textarea {
    min-height: 50px;
  }

  /* Touch-sized WooCommerce buttons (login, coupon, account). */
  body.cser-app .woocommerce button.button,
  body.cser-app .woocommerce a.button,
  body.cser-app .woocommerce input.button {
    min-height: 48px;
  }

  /* Footer clears the tab bar. */
  .site-footer {
    padding-bottom: 24px;
  }

  body.cser-focus-flow .site-header .editorial-header-search,
  body.cser-focus-flow .site-header .mobile-menu-toggle {
    display: none !important;
  }

  body.cser-focus-flow .site-header .header-container {
    grid-template-rows: auto;
    padding-bottom: 6px !important;
  }
}

@media (max-width: 640px) {
  .cser-shop-shell ul.products,
  .cser-search-results ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 26px 12px !important;
  }

  .cser-editorial-home ul.products.cser-rail,
  .cser-editorial-home .cser-top5__list {
    grid-auto-columns: calc((100% - 40px - 14px) / 2.25);
  }

  .cser-product-after-summary ul.products {
    grid-auto-columns: calc((100% - 14px) / 2.25);
  }

  /* Icon-only add to cart on narrow cards. */
  .editorial-product-card .product-footer .button,
  ul.products li.product.editorial-product-card .product-footer .button {
    width: 44px !important;
    padding: 0 !important;
    font-size: 0 !important;
  }

  .editorial-product-card .product-footer .button::before {
    width: 22px;
    height: 22px;
  }

  .editorial-product-card .price-box {
    font-size: 0.95rem !important;
  }

  .editorial-product-card .editorial-product-title,
  ul.products li.product .editorial-product-title {
    font-size: 0.95rem !important;
  }

  .cser-loop-controls .woocommerce-result-count {
    font-size: 0.78rem;
  }

  .cser-loop-controls .woocommerce-ordering select {
    width: auto !important;
    min-width: 0 !important;
    max-width: 52vw;
  }

  .cser-header-badges {
    margin-bottom: 0;
  }
}

@media (min-width: 901px) {
  .cser-buybar {
    left: 50%;
    right: auto;
    bottom: 18px;
    width: min(760px, calc(100vw - 48px));
    padding: 10px 10px 10px 14px;
    border: 1px solid var(--app-line);
    border-radius: 12px;
    transform: translate(-50%, 140%);
  }

  .cser-buybar.is-visible {
    transform: translate(-50%, 0);
  }

  .editorial-product-card .product-footer .button:not(.add_to_cart_button) {
    font-size: 0 !important;
    width: 44px !important;
    padding: 0 !important;
  }
}

@keyframes cser-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .cser-cart-drawer,
  .cser-buybar,
  .site-header .main-nav,
  .cser-toast,
  ul.products li.product.is-appended {
    transition: none !important;
    animation: none !important;
  }

  @view-transition {
    navigation: none;
  }
}

/* ---------- Quantity stepper (native inputs) ---------- */

.quantity.cser-qty {
  display: inline-flex !important;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-paper);
}

.quantity.cser-qty input.qty {
  width: 44px !important;
  min-width: 0;
  min-height: 0 !important;
  height: auto;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-weight: 600;
  text-align: center;
  -moz-appearance: textfield;
}

.quantity.cser-qty input.qty::-webkit-outer-spin-button,
.quantity.cser-qty input.qty::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.cser-qty__btn {
  display: inline-flex;
  width: 40px;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--app-ink);
  font-size: 1.2rem;
  cursor: pointer;
}

.cser-qty__btn:hover {
  background: rgba(25, 35, 33, 0.05);
}

.cser-purchase-panel .quantity.cser-qty {
  min-height: 54px;
}

/* ---------- Cart page ---------- */

.cser-coupon-toggle {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--app-teal);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.woocommerce-cart-form .coupon.is-collapsed {
  display: none !important;
}

body.woocommerce-cart .woocommerce-cart-form .cser-freeship {
  margin-bottom: 18px;
  border: 0;
  border-radius: var(--app-radius);
}

.cser-checkout-bar {
  display: none;
}

@media (max-width: 900px) {
  body.woocommerce-cart.cser-app table.shop_table.cart,
  body.woocommerce-cart.cser-app table.shop_table.cart tbody {
    display: block !important;
    width: 100%;
    border: 0 !important;
  }

  body.woocommerce-cart.cser-app table.shop_table.cart thead {
    display: none !important;
  }

  body.woocommerce-cart.cser-app table.shop_table.cart tr.woocommerce-cart-form__cart-item {
    position: relative;
    display: grid !important;
    grid-template-areas:
      "thumb name name"
      "thumb price price"
      "thumb qty subtotal";
    grid-template-columns: 76px minmax(0, 1fr) auto;
    column-gap: 14px;
    row-gap: 4px;
    padding: 16px 40px 16px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--app-line) !important;
  }

  body.woocommerce-cart.cser-app table.shop_table.cart tr.woocommerce-cart-form__cart-item td {
    display: block !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    text-align: left !important;
  }

  body.woocommerce-cart.cser-app table.shop_table.cart tr.woocommerce-cart-form__cart-item td::before {
    display: none !important;
  }

  body.woocommerce-cart.cser-app table.shop_table.cart td.product-thumbnail {
    grid-area: thumb;
  }

  body.woocommerce-cart.cser-app table.shop_table.cart td.product-thumbnail img {
    width: 76px !important;
    height: 108px !important;
    object-fit: contain;
    object-position: top;
    background: transparent;
    box-shadow: 0 10px 16px -12px rgba(25, 35, 33, 0.55);
  }

  body.woocommerce-cart.cser-app table.shop_table.cart td.product-name {
    grid-area: name;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.3;
  }

  body.woocommerce-cart.cser-app table.shop_table.cart td.product-price {
    grid-area: price;
    color: var(--app-muted);
    font-size: 0.85rem;
  }

  body.woocommerce-cart.cser-app table.shop_table.cart td.product-quantity {
    grid-area: qty;
    align-self: end;
    margin-top: 6px !important;
  }

  body.woocommerce-cart.cser-app table.shop_table.cart td.product-subtotal {
    grid-area: subtotal;
    align-self: center;
    justify-self: end;
    margin-top: 6px !important;
    font-size: 1.02rem;
    font-weight: 700;
  }

  body.woocommerce-cart.cser-app table.shop_table.cart td.product-remove {
    position: absolute !important;
    top: 10px;
    right: -6px;
    width: auto !important;
  }

  body.woocommerce-cart.cser-app table.shop_table.cart td.product-remove a.remove {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    border-radius: 50%;
    color: var(--app-muted) !important;
    font-size: 1.4rem;
  }

  body.woocommerce-cart.cser-app table.shop_table.cart tr:not(.woocommerce-cart-form__cart-item) {
    display: block !important;
  }

  body.woocommerce-cart.cser-app table.shop_table.cart td.actions {
    display: block !important;
    padding: 12px 0 0 !important;
    border: 0 !important;
  }

  body.woocommerce-cart.cser-app table.shop_table.cart td.actions .coupon:not(.is-collapsed) {
    display: flex !important;
    gap: 8px;
    margin: 4px 0 0 !important;
  }

  body.woocommerce-cart.cser-app table.shop_table.cart td.actions .coupon .input-text {
    width: auto !important;
    min-width: 0;
    flex: 1 1 auto;
    margin: 0 !important;
  }

  body.woocommerce-cart.cser-app table.shop_table.cart td.actions .coupon .button {
    width: auto !important;
    margin: 0 !important;
    white-space: nowrap;
  }

  body.woocommerce-cart.cser-app.js-cart-auto [name="update_cart"] {
    display: none !important;
  }

  /* Totals: label / value rows. */
  body.woocommerce-cart.cser-app .cart-collaterals,
  body.woocommerce-cart.cser-app .cart_totals {
    width: 100% !important;
    float: none !important;
  }

  body.woocommerce-cart.cser-app .cart_totals {
    margin-top: 22px;
    padding: 20px !important;
    border-radius: var(--app-radius);
    background: var(--app-cream) !important;
  }

  body.woocommerce-cart.cser-app .cart_totals h2 {
    margin: 0 0 8px !important;
    font-family: var(--font-title) !important;
    font-size: 1.5rem !important;
    font-weight: 500 !important;
  }

  body.woocommerce-cart.cser-app .cart_totals table.shop_table,
  body.woocommerce-cart.cser-app .cart_totals table.shop_table tbody {
    display: block !important;
    width: 100%;
    border: 0 !important;
    background: transparent !important;
  }

  body.woocommerce-cart.cser-app .cart_totals table.shop_table tr {
    display: flex !important;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 16px;
    padding: 12px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--app-line) !important;
  }

  body.woocommerce-cart.cser-app .cart_totals table.shop_table th,
  body.woocommerce-cart.cser-app .cart_totals table.shop_table td {
    display: block !important;
    width: auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    font-family: var(--font-body) !important;
    font-size: 0.92rem !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    text-transform: none !important;
  }

  body.woocommerce-cart.cser-app .cart_totals table.shop_table td::before {
    display: none !important;
  }

  body.woocommerce-cart.cser-app .cart_totals table.shop_table tr.woocommerce-shipping-totals td {
    flex: 1 1 100%;
  }

  body.woocommerce-cart.cser-app .cart_totals table.shop_table tr.order-total {
    border-bottom: 0 !important;
  }

  body.woocommerce-cart.cser-app .cart_totals table.shop_table tr.order-total th,
  body.woocommerce-cart.cser-app .cart_totals table.shop_table tr.order-total td {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
  }

  body.woocommerce-cart.cser-app .cart_totals #shipping_method li {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
  }

  body.woocommerce-cart.cser-app .wc-proceed-to-checkout {
    padding: 8px 0 0 !important;
  }

  body.woocommerce-cart.cser-app .wc-proceed-to-checkout .checkout-button {
    display: flex !important;
    width: 100% !important;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    border-radius: var(--app-radius) !important;
    font-family: var(--font-body) !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  .cser-checkout-bar {
    position: fixed;
    right: 0;
    bottom: var(--app-bottom-offset);
    left: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    border-top: 1px solid var(--app-line);
    border-bottom: 1px solid var(--app-line);
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
  }

  .cser-checkout-bar__total {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
  }

  .cser-checkout-bar__total small {
    color: var(--app-muted);
    font-size: 0.72rem;
  }

  .cser-checkout-bar__total strong {
    font-size: 1.1rem;
  }

  .cser-checkout-bar__button {
    min-height: 50px;
    flex: 1 1 auto;
    padding: 0 16px;
    border: 0;
    border-radius: var(--app-radius);
    background: var(--app-teal);
    color: #fff;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
  }

  body.woocommerce-cart.cser-app .site-footer {
    padding-bottom: 96px;
  }

  body.woocommerce-cart .cser-toast-region {
    bottom: calc(var(--app-bottom-offset) + var(--app-safe-bottom) + 84px);
  }

  body.woocommerce-cart:not(.cser-has-tabbar) .cser-checkout-bar {
    padding-bottom: calc(10px + var(--app-safe-bottom));
  }

  /* Checkout: calmer, card-like sections in the focused flow. */
  body.woocommerce-checkout.cser-app .woocommerce-checkout #payment {
    border-radius: var(--app-radius);
  }

  body.woocommerce-checkout.cser-app .woocommerce-checkout #payment ul.payment_methods li {
    padding: 14px 0 !important;
  }

  body.woocommerce-checkout.cser-app .woocommerce-checkout #payment ul.payment_methods li > label {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    font-weight: 600;
  }

  body.woocommerce-checkout.cser-app #place_order {
    width: 100% !important;
    min-height: 56px;
    border-radius: var(--app-radius) !important;
    font-family: var(--font-body) !important;
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  body.woocommerce-checkout.cser-app .woocommerce-checkout-review-order-table {
    font-size: 0.9rem;
  }
}

/* ---------- My account on phones ---------- */

@media (max-width: 900px) {
  /* One flat surface instead of three nested boxes. */
  body.woocommerce-account.logged-in .cser-page-entry > .entry-content,
  body.woocommerce-account.logged-in .woocommerce-MyAccount-navigation,
  body.woocommerce-account.logged-in .woocommerce-MyAccount-content {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  /* Account sections as a swipeable chip row. */
  body.woocommerce-account .woocommerce-MyAccount-navigation {
    margin: 0 0 22px;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation ul {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 2px 0 4px;
    overflow-x: auto;
    list-style: none;
    scrollbar-width: none;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation ul::-webkit-scrollbar {
    display: none;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation li {
    flex: 0 0 auto;
    margin: 0;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation a {
    display: flex;
    min-height: 40px;
    align-items: center;
    padding: 0 16px;
    border: 1px solid var(--app-line);
    border-radius: 999px;
    background: var(--app-paper);
    color: var(--app-ink);
    font-size: 0.92rem;
    font-weight: 500;
    white-space: nowrap;
    overflow-wrap: normal;
    text-decoration: none;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation .is-active a {
    border-color: var(--app-teal);
    background: var(--app-teal);
    color: #fff;
  }

  body.woocommerce-account .woocommerce-MyAccount-content {
    padding: 0;
    overflow-wrap: normal;
  }

  /* Notices with a button (e.g. confirm e-mail): button under the text. */
  body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-info,
  body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-info .button,
  body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-message .button {
    order: 2;
    float: none;
    margin: 0;
  }

  /* Orders, downloads and other account tables become cards. */
  body.woocommerce-account .woocommerce-MyAccount-content table.shop_table_responsive {
    display: block;
    border: 0;
  }

  body.woocommerce-account .woocommerce-MyAccount-content table.shop_table_responsive thead {
    display: none;
  }

  body.woocommerce-account .woocommerce-MyAccount-content table.shop_table_responsive tbody {
    display: grid;
    gap: 12px;
  }

  body.woocommerce-account .woocommerce-MyAccount-content table.shop_table_responsive tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 16px;
    padding: 16px;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    background: var(--app-paper);
  }

  body.woocommerce-account .woocommerce-MyAccount-content table.shop_table_responsive tr > th,
  body.woocommerce-account .woocommerce-MyAccount-content table.shop_table_responsive tr > td {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--app-ink);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    overflow-wrap: normal;
    word-break: normal;
  }

  body.woocommerce-account .woocommerce-MyAccount-content table.shop_table_responsive tr > [data-title]::before {
    content: attr(data-title);
    display: block;
    margin-bottom: 2px;
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  body.woocommerce-account .woocommerce-MyAccount-content table.shop_table_responsive tr > .woocommerce-orders-table__cell-order-number a {
    color: var(--app-teal);
    font-weight: 700;
  }

  body.woocommerce-account .woocommerce-MyAccount-content table.shop_table_responsive tr > [class*="-actions"] {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  body.woocommerce-account .woocommerce-MyAccount-content table.shop_table_responsive tr > [class*="-actions"]::before {
    display: none;
  }

  body.woocommerce-account .woocommerce-MyAccount-content table.shop_table_responsive tr > [class*="-actions"] .button {
    flex: 1 1 auto;
    margin: 0;
    text-align: center;
    white-space: nowrap;
  }
}

/* Order confirmation table fits the phone instead of scrolling sideways. */
@media (max-width: 640px) {
  body.woocommerce-order-received .woocommerce-order-details {
    overflow-x: visible;
  }

  body.woocommerce-order-received .woocommerce-order-details table.order_details {
    width: 100%;
    min-width: 0;
    table-layout: auto;
  }

  body.woocommerce-order-received .woocommerce-order-details table.order_details th,
  body.woocommerce-order-received .woocommerce-order-details table.order_details td {
    padding: 14px 0;
    text-align: left;
  }

  body.woocommerce-order-received .woocommerce-order-details table.order_details td:last-child,
  body.woocommerce-order-received .woocommerce-order-details table.order_details th:last-child:not([scope="row"]) {
    padding-left: 12px;
    text-align: right;
  }

  body.woocommerce-order-received .woocommerce-order-details tfoot th {
    width: 45%;
  }

  body.woocommerce-order-received .woocommerce-order-details tfoot td {
    white-space: normal;
  }
}

/* ---------- Book formats: book / e-book / signed copy ---------- */

.cser-formats {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
}

.cser-format {
  display: flex;
  min-width: 0;
  flex: 1 1 0;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-paper);
  color: var(--app-ink);
  text-decoration: none;
  transition: border-color 0.18s var(--app-ease), box-shadow 0.18s var(--app-ease), background-color 0.18s var(--app-ease);
}

.cser-format:hover {
  border-color: var(--app-teal);
  color: var(--app-ink);
}

.cser-format.is-selected {
  border-color: var(--app-teal);
  background: var(--app-teal-tint);
  box-shadow: inset 0 0 0 1px var(--app-teal);
}

.cser-format__label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cser-format__price {
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cser-format__note {
  overflow: hidden;
  color: var(--app-muted);
  font-size: 0.72rem;
  line-height: 1.3;
  text-overflow: ellipsis;
}

.cser-format.is-unavailable {
  opacity: 0.6;
}

.cser-format.is-unavailable .cser-format__price {
  text-decoration: line-through;
}

@media (max-width: 420px) {
  .cser-format {
    padding: 9px 8px;
  }

  .cser-format__note {
    white-space: normal;
  }
}

/* Card hint: the book also exists as an e-book. */
.cser-card-formats {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 5px;
  margin: 6px 0 0;
  color: var(--app-teal-dark);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
}

.cser-card-formats:hover {
  color: var(--app-teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cser-card-formats__icon {
  flex: 0 0 auto;
}
