/*
 * Commerce flows — native Figma fidelity layer.
 *
 * This stylesheet intentionally styles the existing WordPress DOM only. No
 * section/screen raster, opacity swap, or disabled interactive control is
 * used here: cart rows, inputs, radio controls, checkout totals and modal
 * actions remain the real application elements.
 */

/* The composition Figma frames keep an add-flavor link as the final grid
 * tile; it navigates to the existing editor and remains keyboard accessible. */
body.is-set-composition .sv-add-flavor-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 130.5px;
}

body.is-set-composition .sv-add-flavor-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 80px;
  background: linear-gradient(93.77deg, #fff6ed 15.549%, #f5e8db 90.822%);
  box-shadow: -4px -4px 4px #fff, 4px 4px 8px #d6bfa7;
  color: #401c0c;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .03em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform .2s ease;
}

body.is-set-composition .sv-add-flavor-link:hover { transform: scale(1.02); }

body.is-set-composition .sv-add-flavor-link:focus-visible {
  outline: 2px solid #b01e2b;
  outline-offset: 3px;
}

/* Editor-mapped artwork includes its own oval shadow; avoid duplicating it.
 * The tile clip also removed the baked shadow's lower and right edge. */
body.is-set-composition .sv-flavor { overflow: visible; }
body.is-set-composition .sv-flavor__photo img { filter: none; }

/* Match the editor's normalized phone/tablet artwork slots. Desktop source
 * assets carry their own per-flavor Figma width and height in the template. */
@media (min-width: 431px) and (max-width: 860px) ,  (width > 430px) and (max-width: 860px) {
  body.tablet-flow.is-set-composition .set-composition-page .sv-flavor__photo { width: min(176px,100%); height: 60px; }
}

@media (max-width: 430px) {
  body.phone-flow.is-set-composition .set-composition-page .sv-flavor__photo { width: min(182px,94%); height: 62px; }
}

body.is-edit-set .es-save-error {
  margin: 12px auto 0;
  color: #b01e2b;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

body.page-template-page-cart .ct-error {
  margin: 0 0 12px;
  color: #b01e2b;
  font-size: 14px;
  line-height: 1.4;
}

/* 770:40921 — the custom-set edit link sits below the weight on desktop. */
@media (min-width: 861px) ,  (width > 860px) {
  body.is-set-composition .sv-product__bottom { flex-wrap: wrap; row-gap: 4px; }
  body.is-set-composition .sv-product__edit { flex-basis: 100%; font-size: 9px; }
}

/* Keep the desktop stage viewport-height-aware so Done anchors on short sets. */
@media (min-width: 861px) and (max-width: 1199px) ,  (width > 860px) and (max-width: 1199px) ,  (min-width: 861px) and (width < 1200px) {
  body.is-edit-set .es-stage {
    display: flex;
    flex-direction: column;
    min-height: calc(100svh * (1200px / 100vw) - 322px);
  }

  body.is-edit-set .es-grid {
    flex: 1 0 auto;
    align-content: start;
  }
}

@media (min-width: 1200px) {
  body.is-edit-set .es-stage {
    display: flex;
    flex-direction: column;
    min-height: calc(100svh - 322px);
  }

  body.is-edit-set .es-grid {
    flex: 1 0 auto;
    align-content: start;
  }
}

@media (max-width: 430px) {
  body.phone-flow.is-set-composition .sv-product__edit { margin-top: 10px; }

  body.phone-flow.is-set-composition .sv-add-flavor-tile {
    grid-column: 1 / -1;
    box-sizing: border-box;
    width: 100%;
    height: 100px;
    min-height: 100px;
    padding: 32px 12px 22px;
  }

  body.phone-flow.is-set-composition .sv-add-flavor-link {
    box-sizing: border-box;
    width: 100%;
    min-height: 46px;
    height: 46px;
    padding: 0 16px;
    letter-spacing: .03em;
    background: linear-gradient(119.2deg, #fff6ed 15.549%, #f5e8db 90.822%);
    box-shadow: inset -4px -4px 10px #fff, inset 2px 2px 11px rgba(231, 205, 177, .9), 4px 4px 12px rgba(214, 191, 167, .45);
  }
}

/* The corresponding Figma frames are standalone application screens. */
body.page-template-page-cart .site-footer,
body.page-template-page-checkout .site-footer,
body.page-template-page-order-accepted .site-footer {
  display: none;
}

/* Figma uses a width-specific break for the checkout packaging option:
 * after "упаковку" at desktop and phone widths. */
body.page-template-page-checkout .co-packaging-copy { min-width: 0; }
body.page-template-page-checkout .co-packaging-break--after-second { display: none; }

/* 736:27928 — desktop checkout form. Its 574px card uses asymmetric 54px / 62px
 * horizontal insets, leaving the authored 458px field column. Keep the layout
 * on the existing 1200px canvas through the 861–1199 zoom band. */
@media (min-width: 861px) ,  (width > 860px) {
  /* Match the Figma soft-card treatment on desktop. The global checkout rule
   * currently uses a steep gradient and a broad shadow, which makes these
   * surfaces read almost flat beside the authored inset highlights. */
  body.page-template-page-checkout .co-col-main > .co-card,
  body.page-template-page-checkout .co-summary {
    background: linear-gradient(93.47deg, #fff6ed 15.549%, #f5e8db 90.822%);
    box-shadow:
      inset -4px -4px 10px #fff,
      inset 2px 2px 11px rgba(231, 205, 177, .9),
      4px 4px 12px rgba(214, 191, 167, .45);
  }

  body.page-template-page-checkout .co-col-main > .co-card:nth-child(-n+2) { padding: 54px 62px 54px 54px; }
  body.page-template-page-checkout .co-col-main > .co-card:nth-child(3) { padding: 54px; }
  body.page-template-page-checkout .co-summary { padding: 54px; }
  body.page-template-page-checkout .co-card__title {
    margin-bottom: 36px;
    line-height: 32px;
  }
  body.page-template-page-checkout .co-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 16px;
  }
  body.page-template-page-checkout .co-field { gap: 12px; }
  body.page-template-page-checkout .co-field__label { line-height: 16px; }
  body.page-template-page-checkout .co-input {
    height: 40px;
    padding: 0 20px;
    font-size: 12px;
    line-height: 16px;
  }
  body.page-template-page-checkout .co-select-wrap::after { right: 16px; }
  body.page-template-page-checkout .co-hint {
    width: 303px;
    margin: -6px 0 0;
    padding: 0 4px;
    box-sizing: border-box;
    font-size: 10px;
    line-height: 12px;
  }
}

/* 736:28103 — desktop order summary. The native summary has three separators;
 * the live markup has two, so the delivery block supplies the middle rule.
 * A 1px CSS border uses 1px of layout where Figma's vector rule uses none;
 * the 27px lower margin preserves the authored 28px visual interval. */
@media (min-width: 861px) ,  (width > 860px) {
  body.page-template-page-checkout .co-summary .co-card__title {
    font-size: 28px;
    line-height: 32px;
    letter-spacing: 1.68px;
  }

  body.page-template-page-checkout .co-summary .co-promo {
    box-sizing: border-box;
    height: 42px;
    padding: 0 20px;
    font-size: 10px;
    line-height: 14px;
    letter-spacing: 0.3px;
  }

  body.page-template-page-checkout .co-summary .co-items { gap: 12px; }
  body.page-template-page-checkout .co-summary .co-items li {
    font-size: 12px;
    line-height: 14px;
  }
  body.page-template-page-checkout .co-summary .co-items b {
    font-size: 12px;
    line-height: 14px;
  }

  body.page-template-page-checkout .co-summary .co-divider { margin: 28px 0 27px; }
  body.page-template-page-checkout .co-summary .co-mid { gap: 0; }
  body.page-template-page-checkout .co-summary .co-totals { gap: 12px; }
  body.page-template-page-checkout .co-summary .co-totals__row {
    font-size: 12px;
    line-height: 16px;
  }

  body.page-template-page-checkout .co-summary .co-ship {
    gap: 12px;
    position: relative;
    margin-top: 56px;
  }
  body.page-template-page-checkout .co-summary .co-ship::before {
    content: "";
    position: absolute;
    top: -28px;
    left: 0;
    right: 0;
    border-top: 1px solid rgba(157, 31, 42, 0.35);
  }
  body.page-template-page-checkout .co-summary .co-ship__row {
    font-size: 12px;
    line-height: 16px;
  }
  body.page-template-page-checkout .co-summary .co-ship__row .co-radio {
    font-size: 12px;
    line-height: 16px;
  }
  body.page-template-page-checkout .co-summary .co-radio__dot {
    width: 13px;
    height: 13px;
    flex-basis: 13px;
  }

  body.page-template-page-checkout .co-summary .co-final {
    margin-bottom: 36px;
    font-size: 14px;
    line-height: 16px;
  }
  body.page-template-page-checkout .co-summary .co-consent {
    gap: 14px;
    margin-bottom: 27px;
    font-size: 12px;
    line-height: 14px;
  }
  body.page-template-page-checkout .co-summary .co-consent > span:last-child {
    width: 307px;
    line-height: 14px;
  }
  body.page-template-page-checkout .co-summary .co-submit {
    height: 46px;
    font-size: 12px;
    line-height: 14px;
    letter-spacing: 0.36px;
  }
}

/* The compact Figma header is shared by commerce flow screens. Its amount
 * and item badge are still populated by assets/js/cart.js. */
@media (max-width: 860px) {
  body.page-template-page-cart .site-header,
  body.page-template-page-checkout .site-header,
  body.page-template-page-order-accepted .site-header {
    top: 20px;
    padding: 0 12px 0 20px;
  }

  body.page-template-page-cart .header-inner,
  body.page-template-page-checkout .header-inner,
  body.page-template-page-order-accepted .header-inner {
    height: 45px;
    padding: 0;
    gap: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  body.page-template-page-cart .header-logo,
  body.page-template-page-checkout .header-logo,
  body.page-template-page-order-accepted .header-logo,
  body.page-template-page-cart .socials,
  body.page-template-page-checkout .socials,
  body.page-template-page-order-accepted .socials {
    display: none;
  }

  body.page-template-page-cart .header-right,
  body.page-template-page-checkout .header-right,
  body.page-template-page-order-accepted .header-right {
    gap: 14px;
    margin-left: auto;
  }

  body.page-template-page-cart .cart-btn,
  body.page-template-page-checkout .cart-btn,
  body.page-template-page-order-accepted .cart-btn {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    width: 145px;
    height: 45px;
    padding: 0;
    gap: 0;
    border: 0;
    background: #8f7564;
    color: #fff6eb;
    box-shadow: 0 4px 8px rgba(64, 28, 12, .2);
  }

  body.page-template-page-cart .cart-icon-wrap,
  body.page-template-page-checkout .cart-icon-wrap,
  body.page-template-page-order-accepted .cart-icon-wrap {
    width: 45px;
    height: 45px;
    background: #fff6eb;
  }

  body.page-template-page-cart .cart-icon-wrap svg path,
  body.page-template-page-cart .cart-icon-wrap svg circle,
  body.page-template-page-checkout .cart-icon-wrap svg path,
  body.page-template-page-checkout .cart-icon-wrap svg circle,
  body.page-template-page-order-accepted .cart-icon-wrap svg path,
  body.page-template-page-order-accepted .cart-icon-wrap svg circle {
    stroke: #b01e2b !important;
  }

  body.page-template-page-cart .cart-icon-wrap svg circle,
  body.page-template-page-checkout .cart-icon-wrap svg circle,
  body.page-template-page-order-accepted .cart-icon-wrap svg circle {
    fill: #b01e2b !important;
  }

  body.page-template-page-cart .cart-price,
  body.page-template-page-checkout .cart-price,
  body.page-template-page-order-accepted .cart-price {
    display: block;
    flex: 1;
    color: #fff6eb;
    font-size: 16px;
    line-height: 1;
    text-align: center;
  }

  body.page-template-page-cart .cart-count,
  body.page-template-page-checkout .cart-count,
  body.page-template-page-order-accepted .cart-count {
    top: 34px;
    right: -7px;
    left: auto;
    width: 18px;
    height: 18px;
    border: 1px solid #fff6eb;
    background: #b01e2b;
    color: #fff6eb;
  }

  body.page-template-page-cart .nav-burger,
  body.page-template-page-checkout .nav-burger,
  body.page-template-page-order-accepted .nav-burger {
    width: 44px;
    height: 44px;
    box-shadow: 0 4px 8px rgba(64, 28, 12, .18);
  }
}

/* 742:741 — cart/tablet. */
@media (min-width: 431px) and (max-width: 860px) ,  (width > 430px) and (max-width: 860px) {
  body.page-template-page-cart .site-header,
  body.page-template-page-checkout .site-header,
  body.page-template-page-order-accepted .site-header {
    padding-right: 20px;
  }

  body.page-template-page-cart .cart-page {
    min-height: 700px;
    padding: 35px 0 42px;
  }

  body.page-template-page-cart .cart-page .container {
    width: 860px;
    max-width: none;
    padding: 0 50px;
  }

  body.page-template-page-cart .ct-back {
    margin-bottom: 30px;
    font-size: 13px;
  }

  body.page-template-page-cart .ct-title {
    margin-bottom: 32px;
  }

  body.page-template-page-cart .ct-body {
    row-gap: 34px;
  }

  body.page-template-page-cart .ct-checkout {
    height: 46px;
  }
}

/* 742:635 — cart/mobile. */
@media (max-width: 430px) {
  body.page-template-page-cart .cart-page {
    min-height: 950px;
    padding: 94px 0 20px;
  }

  body.page-template-page-cart .cart-page .container {
    padding: 0 20px;
  }

  body.page-template-page-cart .ct-back {
    margin-bottom: 30px;
  }

  body.page-template-page-cart .ct-title {
    margin-bottom: 40px;
  }

  body.page-template-page-cart .ct-body {
    row-gap: 44px;
  }

  body.page-template-page-cart .ct-promo {
    margin-top: 58px;
  }

  body.page-template-page-cart .ct-summary__title {
    margin-bottom: 24px;
  }

  body.page-template-page-cart .ct-checkout {
    margin-top: 32px;
  }
}

/* 736:29736 / 736:28992 — checkout pickup. The markup also supports the
 * delivery and scheduled-delivery states; their visibility is controlled by
 * the existing radio handlers, not by this fidelity layer. */
@media (min-width: 431px) and (max-width: 860px) ,  (width > 430px) and (max-width: 860px) {
  body.page-template-page-checkout .checkout-page {
    padding: 35px 0 48px;
  }

  body.page-template-page-checkout .checkout-page .container {
    width: 860px;
    max-width: none;
    padding: 0 50px;
  }

  body.page-template-page-checkout .co-back {
    margin-bottom: 34px;
  }

  body.page-template-page-checkout .co-steps {
    margin-bottom: 78px;
  }

  body.page-template-page-checkout .co-notes {
    gap: 10px;
    margin-bottom: 34px;
  }

  body.page-template-page-checkout .co-notes li {
    gap: 14px;
    font-size: 14px;
  }

  body.page-template-page-checkout .co-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  body.page-template-page-checkout .co-col-main {
    gap: 22px;
  }

  body.page-template-page-checkout .co-card {
    border-radius: 30px;
    padding: 54px 52px;
  }

  body.page-template-page-checkout .co-card__title {
    margin-bottom: 32px;
    font-size: 30px;
  }

  body.page-template-page-checkout .co-summary {
    padding: 52px;
  }
}

@media (max-width: 430px) {
  body.page-template-page-checkout .checkout-page {
    padding: 76px 0 20px;
  }

  body.page-template-page-checkout .checkout-page .container {
    width: 430px;
    max-width: none;
    padding: 0;
  }

  body.page-template-page-checkout .co-back {
    margin: 0 20px 24px;
    font-size: 13px;
  }

  body.page-template-page-checkout .co-steps {
    width: auto;
    margin: 0 30px 58px;
  }

  body.page-template-page-checkout .co-steps__line {
    margin: 0 10px;
  }

  body.page-template-page-checkout .co-step__dot {
    width: 44px;
    height: 44px;
  }

  body.page-template-page-checkout .co-step__label {
    top: calc(100% + 10px);
    font-size: 9px;
    letter-spacing: 0;
  }

  body.page-template-page-checkout .co-notes {
    gap: 9px;
    margin: 0 20px 30px;
  }

  body.page-template-page-checkout .co-notes li {
    gap: 12px;
    font-size: 13px;
    line-height: 16px;
  }

  body.page-template-page-checkout .co-star {
    width: 18px;
    height: 18px;
  }

  body.page-template-page-checkout .co-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  body.page-template-page-checkout .co-col-main {
    gap: 18px;
  }

  body.page-template-page-checkout .co-card,
  body.page-template-page-checkout .co-summary {
    width: 430px;
    padding: 36px 38px 38px;
    border-radius: 30px;
  }

  body.page-template-page-checkout .co-card__title {
    margin-bottom: 28px;
    font-size: 24px;
    line-height: 28px;
    letter-spacing: 1.44px;
  }

  body.page-template-page-checkout .co-fields {
    gap: 18px;
  }

  body.page-template-page-checkout .co-field {
    gap: 8px;
  }

  body.page-template-page-checkout .co-field__label,
  body.page-template-page-checkout .co-radio {
    font-size: 13px;
  }

  body.page-template-page-checkout .co-input {
    height: 40px;
    padding: 0 16px;
  }

  body.page-template-page-checkout .co-field--note {
    margin-top: 22px;
  }

  body.page-template-page-checkout .co-radios {
    gap: 10px;
  }

  body.page-template-page-checkout .co-pay__row {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }

  body.page-template-page-checkout .co-pay__logos {
    margin-left: auto;
    gap: 8px;
  }

  body.page-template-page-checkout .co-logo-mc { width: 42px; height: 32px; }
  body.page-template-page-checkout .co-logo-visa { width: 52px; height: 20px; }
  body.page-template-page-checkout .co-logo-pk { width: 64px; height: 20px; }

  body.page-template-page-checkout .co-pay__hint {
    margin: 8px 0 0 27px;
    font-size: 10px;
    line-height: 12px;
  }

  body.page-template-page-checkout .co-divider {
    margin: 20px 0;
  }

  body.page-template-page-checkout .co-cert {
    margin-top: 16px;
  }

  body.page-template-page-checkout .co-cert__input,
  body.page-template-page-checkout .co-promo,
  body.page-template-page-checkout .co-cert__ok {
    height: 48px;
  }

  body.page-template-page-checkout .co-summary .co-card__title {
    margin-bottom: 28px;
  }

  body.page-template-page-checkout .co-promo {
    margin-bottom: 24px;
  }

  body.page-template-page-checkout .co-items {
    gap: 12px;
  }

  body.page-template-page-checkout .co-items li {
    gap: 12px;
    font-size: 12px;
    line-height: 15px;
  }

  body.page-template-page-checkout .co-items b,
  body.page-template-page-checkout .co-totals__row,
  body.page-template-page-checkout .co-ship__row {
    font-size: 13px;
  }

  body.page-template-page-checkout .co-mid {
    gap: 20px;
  }

  body.page-template-page-checkout .co-totals,
  body.page-template-page-checkout .co-ship {
    gap: 10px;
  }

  body.page-template-page-checkout .co-final {
    margin-bottom: 22px;
    font-size: 14px;
  }

  body.page-template-page-checkout .co-consent {
    gap: 10px;
    margin-bottom: 20px;
    font-size: 11px;
    line-height: 13px;
  }

  body.page-template-page-checkout .co-submit {
    height: 56px;
    font-size: 13px;
  }

  /* This is the real calendar/time picker. It remains visible only when the
   * buyer chooses «Ко времени», as controlled by page-checkout.php. */
  body.page-template-page-checkout .co-scheduler {
    width: 100%;
    padding: 10px;
  }

  body.page-template-page-checkout .co-cal__grid {
    grid-template-columns: repeat(7, minmax(30px, 1fr));
  }
}

/* 850:14890 — after-20:30 popup/mobile. The close button, Escape handler,
 * backdrop click and map links are existing functional controls. */
@media (max-width: 430px) {
  #co-after-hours.sm-overlay {
    align-items: flex-start;
    justify-content: flex-start;
  }

  #co-after-hours .co-afterhours-panel {
    position: absolute;
    top: 95px;
    left: 0;
    width: 430px;
    max-width: none;
    height: 760px;
    max-height: none;
    padding: 60px 25px 28px;
    overflow: hidden;
    border-radius: 30px;
    background: linear-gradient(160deg, #fff6ec 0%, #f5e4d1 100%);
  }

  #co-after-hours .sm-close {
    top: 32px;
    right: 32px;
  }

  #co-after-hours .co-afterhours-panel__title {
    margin: 0 auto 8px;
    font-size: 32px;
    line-height: 36px;
    letter-spacing: 1.92px;
  }

  #co-after-hours .co-afterhours-panel__lead {
    width: 304px;
    margin: 0 auto 30px;
    font-size: 14px;
    line-height: 17px;
  }

  #co-after-hours .co-afterhours-panel__sub {
    width: 304px;
    margin: 0 auto 18px;
    font-size: 14px;
    line-height: 17px;
  }

  #co-after-hours .co-afterhours-loc {
    position: relative;
    display: block;
    width: 380px;
    height: 177px;
    margin: 0 0 8px;
    padding: 28px 10px 10px;
    border-radius: 30px;
  }

  #co-after-hours .co-afterhours-loc__left {
    align-items: flex-start;
    gap: 14px;
    padding-left: 22px;
  }

  #co-after-hours .co-afterhours-loc__icon {
    width: 44px;
    height: 44px;
  }

  #co-after-hours .co-afterhours-loc__title {
    font-size: 18px;
    line-height: 22px;
    letter-spacing: .54px;
  }

  #co-after-hours .co-afterhours-loc__sub {
    font-size: 14px;
    line-height: 17px;
  }

  #co-after-hours .co-afterhours-loc__map {
    position: absolute;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    height: 56px;
    padding: 0;
    font-size: 14px;
  }

  #co-after-hours .co-afterhours-panel__thanks {
    margin: 22px 0 0;
    font-size: 14px;
    line-height: 18px;
  }
}

/* 850:13797 — success/mobile. The content remains real text and links; the
 * photo, paper, gift and sticker are individual decorative assets already in
 * the template, never a captured screen. */
@media (max-width: 430px) {
  body.page-template-page-order-accepted .oa-page,
  body.page-template-page-order-accepted .oa-hero {
    height: 810px;
    min-height: 810px;
  }

  body.page-template-page-order-accepted .oa-hero {
    padding: 0;
    background-size: 430px 810px;
    background-position: center top;
  }
}

/* Keep keyboard focus visible on every new/overridden real control. */
body.page-template-page-checkout .co-afterhours-loc__map:focus-visible,
body.page-template-page-cart .ct-checkout:focus-visible,
body.page-template-page-checkout .co-submit:focus-visible {
  outline: 3px solid #401c0c;
  outline-offset: 3px;
}

/* `main.style.css` assigns display values to these blocks, which otherwise
 * defeats the semantic `hidden` state set by the checkout's real radio and
 * input handlers. Keep every variant native: the DOM state, not a visual
 * substitute, determines what is shown. */
body.page-template-page-checkout .co-field--address[hidden],
body.page-template-page-checkout .co-scheduler[hidden],
body.page-template-page-checkout .co-cert[hidden],
body.page-template-page-checkout .co-cert__ok[hidden],
body.page-template-page-checkout #co-after-hours[hidden] {
  display: none !important;
}

/* Keep the certificate destination in the order-success header while fitting
 * every existing link and social action inside the compact desktop pill. */
@media (min-width: 861px) and (max-width: 1100px) ,  (width > 860px) and (max-width: 1100px) {
  body.page-template-page-order-accepted .site-header { padding-inline: 20px; }
  body.page-template-page-order-accepted .header-inner { padding-inline: 10px; gap: 10px; }
  body.page-template-page-order-accepted .header-logo img { height: 14px; }
  body.page-template-page-order-accepted .header-nav { min-width: 0; }
  body.page-template-page-order-accepted .nav-menu {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    justify-content: center;
    gap: 6px 8px;
    width: auto;
  }
  body.page-template-page-order-accepted .nav-menu a {
    width: auto;
    height: auto;
    font-size: clamp(11px, calc(1vw + 2px), 13px);
    line-height: 1.1;
    letter-spacing: 0;
  }
}

@media (min-width: 1101px) and (max-width: 1199px) ,  (min-width: 1101px) and (width < 1200px) {
  body.page-template-page-order-accepted .site-header { padding-inline: 20px; }
  body.page-template-page-order-accepted .header-inner { padding-inline: 10px; gap: 10px; }
  body.page-template-page-order-accepted .header-logo img { height: 14px; }
  body.page-template-page-order-accepted .header-nav { min-width: 0; }
  body.page-template-page-order-accepted .nav-menu { gap: 5px; }
  body.page-template-page-order-accepted .nav-menu a {
    width: auto;
    height: auto;
    font-size: clamp(10px, calc(1.01vw - 1.11px), 11px);
    line-height: 1.1;
    letter-spacing: 0;
  }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  body.page-template-page-order-accepted .site-header { padding-inline: 20px; }
  body.page-template-page-order-accepted .header-inner {
    padding-inline: clamp(10px, calc(10px + (100vw - 1200px) * .1181), 27px);
    gap: clamp(10px, calc(10px + (100vw - 1200px) * .1806), 36px);
  }
  body.page-template-page-order-accepted .header-logo img { height: 14px; }
  body.page-template-page-order-accepted .header-nav { min-width: 0; }
  body.page-template-page-order-accepted .nav-menu { gap: clamp(5px, calc(5px + (100vw - 1200px) * .1389), 25px); }
  body.page-template-page-order-accepted .nav-menu a {
    width: auto;
    height: auto;
    line-height: 1.1;
    letter-spacing: 0;
  }
}

/* Native fluid layouts are opt-in through body.fluid-flow. Keep the authored
 * 430px, 860px and 1200px frames intact; these rules cover only the gaps where
 * the former fixed 1200px canvas was being scaled or clipped. */
@media (min-width: 861px) and (max-width: 1199px) ,  (width > 860px) and (max-width: 1199px) ,  (min-width: 861px) and (width < 1200px) {
  body.fluid-flow.page-template-page-cart .cart-page,
  body.fluid-flow.page-template-page-checkout .checkout-page {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  body.fluid-flow.page-template-page-cart .ct-wrap,
  body.fluid-flow.page-template-page-checkout .co-wrap {
    width: 100%;
    max-width: 1200px;
    min-width: 0;
    padding-inline: clamp(24px, 6.667vw, 80px);
    box-sizing: border-box;
  }

  body.fluid-flow.page-template-page-cart .cart-page { padding-block: 106px 64px; }
  body.fluid-flow.page-template-page-cart .ct-body {
    grid-template-columns: minmax(0, 1fr) minmax(280px, min(420px, 36vw));
    gap: clamp(24px, 4vw, 48px);
    align-items: start;
  }
  body.fluid-flow.page-template-page-cart .ct-left,
  body.fluid-flow.page-template-page-cart .ct-summary { min-width: 0; }
  body.fluid-flow.page-template-page-cart .ct-summary { position: sticky; top: 100px; }
  body.fluid-flow.page-template-page-cart .ct-item__info {
    height: auto;
    min-height: 84px;
    justify-content: flex-start;
    gap: 4px;
  }
  body.fluid-flow.page-template-page-cart .ct-item__title { overflow-wrap: anywhere; }
  body.fluid-flow.page-template-page-cart .ct-empty { padding-inline: clamp(24px, 4vw, 48px); }

  body.fluid-flow.page-template-page-checkout .checkout-page { padding-block: 106px 64px; }
  body.fluid-flow.page-template-page-checkout .co-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  body.fluid-flow.page-template-page-checkout .co-col-main { min-width: 0; gap: 24px; }
  body.fluid-flow.page-template-page-checkout .co-card,
  body.fluid-flow.page-template-page-checkout .co-summary {
    width: 100%;
    min-width: 0;
    padding: clamp(24px, 4.5vw, 54px);
    box-sizing: border-box;
  }
  body.fluid-flow.page-template-page-checkout .co-summary { position: static; }
  body.fluid-flow.page-template-page-checkout .co-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.fluid-flow.page-template-page-checkout .co-field,
  body.fluid-flow.page-template-page-checkout .co-input,
  body.fluid-flow.page-template-page-checkout .co-cert__input,
  body.fluid-flow.page-template-page-checkout .co-promo { min-width: 0; }
  body.fluid-flow.page-template-page-checkout .co-input,
  body.fluid-flow.page-template-page-checkout .co-cert__input,
  body.fluid-flow.page-template-page-checkout .co-promo { font-size: 16px; }
  body.fluid-flow.page-template-page-checkout .co-scheduler { max-width: 100%; }
  body.fluid-flow.page-template-page-checkout .co-cal { min-width: 0; }
  body.fluid-flow.page-template-page-checkout .co-cal__grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  body.fluid-flow.page-template-page-checkout .co-cal__day { min-width: 0; }

  body.fluid-flow :is(.set-composition-page, .edit-set-page) {
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: visible;
  }
  body.fluid-flow :is(.set-composition-page .sv-head, .edit-set-page .es-sticky-head) {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    min-height: 0;
    padding: 106px clamp(24px, 5vw, 60px) 28px;
    box-sizing: border-box;
  }
  body.fluid-flow :is(.set-composition-page, .edit-set-page) .sv-back {
    position: relative;
    inset: auto;
    width: fit-content;
  }
  body.fluid-flow :is(.set-composition-page, .edit-set-page) .sv-summary {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    align-items: start;
    gap: clamp(24px, 4vw, 48px);
    width: 100%;
    height: auto;
    margin-top: 28px;
  }
  body.fluid-flow :is(.set-composition-page, .edit-set-page) .sv-product {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 84px;
    align-items: flex-start;
  }
  body.fluid-flow :is(.set-composition-page, .edit-set-page) .sv-product__meta {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    height: auto;
    max-height: none;
    min-height: 84px;
    overflow: visible;
    gap: 8px;
  }
  body.fluid-flow :is(.set-composition-page, .edit-set-page) .sv-product__title {
    display: block;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
  }
  body.fluid-flow :is(.set-composition-page, .edit-set-page) .sv-product__bottom {
    flex-wrap: wrap;
    transform: none;
  }
  body.fluid-flow :is(.set-composition-page, .edit-set-page) .sv-ingredients {
    width: 100%;
    height: auto;
    min-height: 84px;
    max-height: clamp(112px, 22dvh, 180px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body.fluid-flow .set-composition-page .sv-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    grid-auto-rows: auto;
    gap: 12px clamp(18px, 3vw, 32px);
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 32px clamp(24px, 5vw, 60px) 40px;
  }
  body.fluid-flow .set-composition-page .sv-flavor {
    width: 100%;
    height: auto;
    min-height: 130.5px;
    overflow: visible;
  }
  body.fluid-flow .set-composition-page .sv-flavor__name {
    left: 6px;
    width: calc(100% - 12px);
    overflow-wrap: anywhere;
  }
  body.fluid-flow .set-composition-page .sv-flavor__qty {
    left: 50%;
    transform: translateX(-50%);
  }

  body.fluid-flow .edit-set-page .es-hint { display: block; margin: 24px clamp(24px, 5vw, 60px) 0; }
  body.fluid-flow .edit-set-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding-bottom: 102px;
    box-sizing: border-box;
  }
  body.fluid-flow .edit-set-page .es-hint { flex: 0 0 auto; }
  body.fluid-flow .edit-set-page .es-stage {
    display: block;
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    height: auto;
    margin: 32px auto 0;
    padding-bottom: 0;
    box-sizing: border-box;
  }
  body.fluid-flow .edit-set-page .es-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    grid-auto-rows: auto;
    gap: 12px clamp(18px, 3vw, 32px);
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0 clamp(24px, 5vw, 60px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    align-content: start;
    box-sizing: border-box;
  }
  body.fluid-flow .edit-set-page .es-grid .es-tile,
  body.fluid-flow .edit-set-page .es-grid .es-add-tile {
    width: 100%;
    min-width: 0;
    height: auto;
  }
  body.fluid-flow .edit-set-page .es-tile { min-height: 130.5px; }
  body.fluid-flow .edit-set-page .sm-tile__name { width: calc(100% - 12px); overflow-wrap: anywhere; }
  body.fluid-flow .edit-set-page .sm-tile__photo { width: min(180px, 100%); }
  body.fluid-flow .edit-set-page .sm-tile__photo img { max-width: 100%; }
  body.fluid-flow .edit-set-page .es-done-bar {
    position: fixed;
    inset: auto 0 0;
    z-index: 12;
    height: auto;
    min-height: 102px;
    margin: 0;
    padding: 28px clamp(24px, 5vw, 60px);
    box-sizing: border-box;
  }
}

body.fluid-flow.page-template-page-cart [hidden],
body.fluid-flow.page-template-page-checkout [hidden] {
  display: none !important;
}

@media (min-width: 1024px) and (max-width: 1199px) ,  (min-width: 1024px) and (width < 1200px) {
  body.fluid-flow.page-template-page-checkout .co-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
    gap: clamp(24px, 3vw, 36px);
  }
}

/* The legacy tablet form keeps a three-column grid down to 431px. Once the
 * page uses real CSS pixels that leaves inputs too narrow for labels and makes
 * the 326px scheduler wider than its card. Let the narrow fluid interval stack
 * the order summary and give form fields/calendar room without changing 430px. */
@media (min-width: 431px) and (max-width: 650px) ,  (width > 430px) and (max-width: 650px) {
  body.fluid-flow.page-template-page-checkout .co-wrap {
    padding-inline: clamp(16px, 6vw, 40px);
  }

  body.fluid-flow.page-template-page-checkout .co-grid,
  body.fluid-flow.page-template-page-checkout .co-col-main { gap: 16px; }

  body.fluid-flow.page-template-page-checkout .co-card,
  body.fluid-flow.page-template-page-checkout .co-summary {
    padding: clamp(20px, 6.3vw, 40px);
  }

  body.fluid-flow.page-template-page-checkout .co-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.fluid-flow.page-template-page-checkout .co-field--city,
  body.fluid-flow.page-template-page-checkout .co-field--street,
  body.fluid-flow.page-template-page-checkout .co-hint { grid-column: 1 / -1; }

  body.fluid-flow.page-template-page-checkout .co-field--house {
    grid-column: auto;
    grid-row: auto;
  }

  body.fluid-flow.page-template-page-checkout .co-summary .co-items,
  body.fluid-flow.page-template-page-checkout .co-summary > .co-divider:first-of-type {
    width: 100%;
  }

  body.fluid-flow.page-template-page-checkout .co-summary .co-mid {
    flex-direction: column;
    align-items: stretch;
    gap: 28px;
  }

  body.fluid-flow.page-template-page-checkout .co-summary .co-mid .co-totals,
  body.fluid-flow.page-template-page-checkout .co-summary .co-mid .co-ship {
    flex: 0 1 auto;
    width: auto;
  }

  body.fluid-flow.page-template-page-checkout .co-card:has(> .co-scheduler:not([hidden])) {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
  }

  body.fluid-flow.page-template-page-checkout .co-card:has(> .co-scheduler:not([hidden])) > .co-scheduler {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
}

@media (min-width: 431px) and (max-width: 480px) ,  (width > 430px) and (max-width: 480px) {
  body.fluid-flow.page-template-page-checkout .co-field--phone,
  body.fluid-flow.page-template-page-checkout .co-field--name { grid-column: 1 / -1; }
}

/* The formatted phone value does not fit the legacy three-column fields
 * immediately above the narrow-fluid layout. Give it one full row until each
 * column has enough room again; the 860px Figma tablet frame stays untouched. */
@media (min-width: 651px) and (max-width: 780px) {
  body.fluid-flow.page-template-page-checkout .co-field--phone { grid-column: 1 / -1; }
}

/* On short touch-landscape viewports, route content scrolls naturally and
 * headers never cover a meaningful part of the editor or composition grid. */
@media (min-width: 431px) and (max-width: 640px) ,  (width > 430px) and (max-width: 640px) {
  body.fluid-flow :is(.set-composition-page, .edit-set-page) { padding-bottom: 40px; }
  body.fluid-flow :is(.set-composition-page .sv-head, .edit-set-page .es-sticky-head) {
    z-index: 20;
    min-height: 0;
    padding-inline: 24px;
  }
  body.fluid-flow :is(.set-composition-page, .edit-set-page) .sv-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-top: 24px;
  }
  body.fluid-flow :is(.set-composition-page, .edit-set-page) .sv-product__meta {
    padding: 0;
  }
  body.fluid-flow :is(.set-composition-page, .edit-set-page) .sv-product__title {
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
  }
  body.fluid-flow :is(.set-composition-page, .edit-set-page) .sv-ingredients { min-height: 100px; }
  body.fluid-flow .set-composition-page .sv-grid,
  body.fluid-flow .edit-set-page .es-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    padding-inline: 24px;
  }
  body.fluid-flow .edit-set-page .es-hint { margin-inline: 24px; }
  body.fluid-flow .edit-set-page .es-done-bar { padding-inline: 24px; }
}

/* Keep one usable editor row between the live summary and Done on short
 * landscape/tablet-height viewports. The ingredient panel scrolls internally
 * so selecting a lower flavour never moves its allergen text off-screen. */
@media (min-width: 861px) and (max-width: 1199px) and (max-height: 600px) ,  (width > 860px) and (max-width: 1199px) and (max-height: 600px) ,  (min-width: 861px) and (width < 1200px) and (max-height: 600px) {
  body.fluid-flow :is(.set-composition-page .sv-head, .edit-set-page .es-sticky-head) {
    padding: 76px 24px 8px;
  }
  body.fluid-flow :is(.set-composition-page, .edit-set-page) .sv-summary {
    gap: 24px;
    margin-top: 8px;
  }
  body.fluid-flow :is(.set-composition-page, .edit-set-page) .sv-ingredients {
    height: 84px;
    min-height: 84px;
    max-height: 84px;
    overflow-y: auto;
  }
  body.fluid-flow .edit-set-page { padding-bottom: 62px; }
  body.fluid-flow .edit-set-page .es-hint { margin: 8px 24px 0; }
  body.fluid-flow .edit-set-page .es-stage { margin-top: 4px; }
  body.fluid-flow .edit-set-page .es-grid { padding-inline: 24px; }
  body.fluid-flow .edit-set-page .es-done-bar {
    min-height: 62px;
    padding: 8px 24px max(8px, env(safe-area-inset-bottom));
  }
  body.fluid-flow .edit-set-page .es-done { min-height: 46px; height: auto; }
}

@media (min-width: 521px) and (max-width: 640px) {
  body.fluid-flow .set-composition-page .sv-grid,
  body.fluid-flow .edit-set-page .es-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
