/* Momen Food product pages: scoped editorial styling. */
.momen-product-page {
  --momen-paper: #fffdf9;
  --momen-cream: #faf3e7;
  --momen-ink: #22281f;
  --momen-muted: #5b6459;
  --momen-pine: #35513b;
  --momen-pine-deep: #243a2a;
  --momen-lime: #a1bc3a;
  --momen-mustard: #d9a02b;
  --momen-rule: #e4dbc9;
  color: var(--momen-ink);
}

.momen-product-page .momen-product-hero {
  align-items: center;
  margin-block: clamp(2rem, 6vw, 5.5rem) clamp(3rem, 8vw, 7rem);
}

.momen-product-page .momen-product-media {
  overflow: hidden;
  border-radius: 22px;
  background: var(--momen-cream);
}

.momen-product-page .momen-product-media .wc-block-components-product-image-gallery,
.momen-product-page .momen-product-media .woocommerce-product-gallery {
  margin: 0;
}

/* Keep the product gallery balanced instead of letting WooCommerce's
 * thumbnail sizing create a cramped rail and an oversized viewer. */
.momen-product-page .momen-product-media .wc-block-product-gallery {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 1rem;
  align-items: start;
}

.momen-product-page .momen-product-media .wc-block-product-gallery-large-image {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  overflow: hidden;
  background: var(--momen-paper);
}

.momen-product-page .momen-product-media .wc-block-product-gallery-thumbnails {
  grid-column: 2;
  grid-row: 1;
  width: 96px;
  min-width: 0;
}

.momen-product-page .momen-product-media .wc-block-product-gallery-thumbnails__scrollable {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.momen-product-page .momen-product-media .wc-block-product-gallery-thumbnails__thumbnail {
  width: 96px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 10px;
  overflow: hidden;
}

.momen-product-page .momen-product-media .wc-block-product-gallery-thumbnails__thumbnail__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.momen-product-page .momen-product-purchase {
  padding: clamp(1rem, 3vw, 2.5rem) 0;
}

.momen-product-page .momen-product-purchase h1 {
  margin: 0 0 1rem;
  color: var(--momen-ink);
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(2.25rem, 4.5vw, 4.2rem);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -.025em;
}

.momen-product-page .momen-product-short-description {
  max-width: 46ch;
  margin: 0 0 1.5rem;
  color: var(--momen-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.momen-product-page .momen-product-purchase .wc-block-components-product-price,
.momen-product-page .momen-product-purchase .wp-block-woocommerce-product-price {
  margin: 0 0 1.5rem;
  color: var(--momen-pine);
  font-family: Fraunces, Georgia, serif;
  font-size: 1.55rem;
  font-weight: 600;
}

.momen-product-page .momen-product-description {
  max-width: 860px;
  margin-block: 0 clamp(3rem, 8vw, 7rem);
}

/* Scope the supplied editorial product markup so it does not affect other pages. */
.momen-product-description .wrap {
  max-width: none;
  padding: 0;
}

.momen-product-description .hero,
.momen-product-description .section,
.momen-product-description .footer {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  border-color: var(--momen-rule);
}

/* The description reuses the generic .hero class. Keep it content-sized on
 * product pages instead of inheriting the homepage viewport-height hero. */
.momen-product-description .hero {
  min-height: 0 !important;
  height: auto !important;
  display: block !important;
  align-items: initial !important;
}

/* Product content is rendered inside WooCommerce's description tab on the
 * live product template, so reset the same generic .hero rule there too. */
.momen-product-page .woocommerce-Tabs-panel--description .momen-package-detail .hero {
  min-height: 0 !important;
  height: auto !important;
  display: block !important;
  align-items: initial !important;
}

.momen-product-description .eyebrow {
  color: var(--momen-pine);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.momen-product-description h1,
.momen-product-description h2,
.momen-product-description h3,
.momen-product-description .closing {
  color: var(--momen-ink);
  font-family: Fraunces, Georgia, serif;
}

.momen-product-description .cta {
  background: var(--momen-pine);
  color: var(--momen-cream);
  border-radius: 999px;
}

.momen-product-description .cta:hover {
  background: var(--momen-pine-deep);
}

.momen-product-description .contents,
.momen-product-description .ticket {
  border-color: var(--momen-rule);
}

.momen-product-description .cat-card,
.momen-product-description .ticket,
.momen-product-description .paper {
  background: var(--momen-paper);
}

.momen-product-page .momen-product-tabs {
  margin-bottom: clamp(3rem, 8vw, 7rem);
}

@media (max-width: 781px) {
  .momen-product-page .momen-product-media .wc-block-product-gallery {
    grid-template-columns: minmax(0, 1fr);
    gap: .75rem;
  }

  .momen-product-page .momen-product-media .wc-block-product-gallery-large-image {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
  }

  .momen-product-page .momen-product-media .wc-block-product-gallery-thumbnails {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
  }

  .momen-product-page .momen-product-media .wc-block-product-gallery-thumbnails__scrollable {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: .2rem;
  }

  .momen-product-page .momen-product-media .wc-block-product-gallery-thumbnails__thumbnail {
    width: 72px;
    height: 54px;
    flex-basis: 54px;
  }

  .momen-product-page .momen-product-hero {
    margin-top: 1.5rem;
  }
  .momen-product-page .momen-product-purchase {
    padding-top: 0;
  }
}

/* The active WooCommerce product template does not emit the custom wrapper
 * above, so use WooCommerce's reliable body class as the final scope. */
body.single-product .wc-block-product-gallery {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 1rem;
  align-items: start;
}

body.single-product .wc-block-product-gallery:not(:has(.wc-block-product-gallery-thumbnails)) {
  grid-template-columns: minmax(0, 1fr) !important;
}

body.single-product .wc-block-product-gallery-large-image {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  aspect-ratio: 1122 / 1402;
  border-radius: 18px;
  overflow: hidden;
}

body.single-product .wc-block-product-gallery-large-image__container,
body.single-product .wc-block-product-gallery-large-image__wrapper,
body.single-product .wc-block-product-gallery-large-image .wc-block-components-product-image {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 1122 / 1402 !important;
}

body.single-product .wc-block-product-gallery-large-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  transform: none !important;
}

body.single-product .wc-block-product-gallery:not(:has(.wc-block-product-gallery-thumbnails)) .wc-block-product-gallery-large-image {
  grid-column: 1 / -1;
}

body.single-product .wc-block-product-gallery-thumbnails {
  grid-column: 2;
  grid-row: 1;
  width: 96px;
  min-width: 0;
}

body.single-product .wc-block-product-gallery-thumbnails__scrollable {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

body.single-product .wc-block-product-gallery-thumbnails__thumbnail {
  width: 96px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 10px;
  overflow: hidden;
}

body.single-product .wc-block-product-gallery-thumbnails__thumbnail__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.single-product .woocommerce-Tabs-panel--description .momen-package-detail .hero {
  min-height: 0 !important;
  height: auto !important;
  display: block !important;
  align-items: initial !important;
  overflow: visible !important;
}

body.single-product form.variations_form .variations select[name^="attribute_"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

body.single-product form.variations_form .variations .value {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .65rem;
}

body.single-product form.variations_form .variations tbody tr {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  column-gap: 1rem;
}

body.single-product form.variations_form .variations th.label {
  align-self: start;
  padding-top: .5rem;
}

.momen-variation-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  order: 1;
}

.momen-variation-button {
  appearance: none;
  border: 1px solid #cfd8c8;
  border-radius: 999px;
  padding: .5rem .9rem !important;
  background: #fffdf9 !important;
  color: var(--momen-pine) !important;
  cursor: pointer;
  font: inherit;
  font-size: .9rem !important;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.momen-variation-button:hover,
.momen-variation-button[aria-pressed="true"] {
  border-color: #a1bc3a !important;
  background: #eef3df !important;
  color: #35513b !important;
}

.momen-variation-button:focus-visible {
  outline: 3px solid rgba(161, 188, 58, .45);
  outline-offset: 2px;
}

body.single-product form.variations_form .single_variation .woocommerce-variation-price,
body.single-product form.variations_form .single_variation .price,
body.single-product form.variations_form .woocommerce-variation-price,
body.single-product form.variations_form .single_variation {
  display: none !important;
}

/* WooCommerce also repeats the price inside the simple-product add-to-cart
 * form. Keep the standalone product-price block as the single price display. */
body.single-product .wp-block-woocommerce-add-to-cart-form .wc-block-components-product-price,
body.single-product .wp-block-add-to-cart-form > .wc-block-components-product-price,
body.single-product .wp-block-add-to-cart-form .woocommerce-variation-price,
body.single-product .wp-block-add-to-cart-form form.cart .price {
  display: none !important;
}

body.single-product form.variations_form .reset_variations {
  order: 2;
  margin-top: .1rem;
  font-size: .82rem;
}

@media (max-width: 781px) {
  body.single-product .wc-block-product-gallery {
    grid-template-columns: minmax(0, 1fr);
    gap: .75rem;
  }

  body.single-product .wc-block-product-gallery:not(:has(.wc-block-product-gallery-thumbnails)) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.single-product .wc-block-product-gallery-large-image {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
  }

  body.single-product .wc-block-product-gallery-thumbnails {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
  }

  body.single-product .wc-block-product-gallery-thumbnails__scrollable {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: .2rem;
  }

  body.single-product .wc-block-product-gallery-thumbnails__thumbnail {
    width: 72px;
    height: 54px;
    flex-basis: 54px;
  }

  /* Match the mobile viewer to the portrait source images (1122 x 1402).
   * WooCommerce otherwise nests a square slide inside a 4:3 crop window. */
  body.single-product .wc-block-product-gallery-large-image {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 1122 / 1402 !important;
  }

  body.single-product .wc-block-product-gallery-large-image__container,
  body.single-product .wc-block-product-gallery-large-image__wrapper,
  body.single-product .wc-block-product-gallery-large-image .wc-block-components-product-image {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1122 / 1402 !important;
  }

  body.single-product .wc-block-product-gallery-large-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform: none !important;
  }

  body.single-product .wc-block-product-gallery-thumbnails {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body.single-product .wc-block-product-gallery-thumbnails__scrollable {
    height: 54px !important;
    max-height: none !important;
    align-items: flex-start;
    justify-content: center;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  body.single-product .wc-block-product-gallery-thumbnails__thumbnail,
  body.single-product .wc-block-product-gallery-thumbnails__thumbnail__image {
    box-sizing: border-box;
  }

  body.single-product .momen-product-hero {
    gap: 1.25rem !important;
    margin-block: 1.25rem 2rem !important;
  }

  body.single-product .momen-product-purchase {
    padding: 0 !important;
  }

  body.single-product #product-add-to-cart {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.single-product .momen-product-intro {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 16px 18px !important;
    border-left-width: 3px !important;
    overflow-wrap: anywhere;
  }

  body.single-product .momen-product-intro > div:first-child {
    margin-bottom: 6px !important;
    font-size: 9px !important;
    letter-spacing: .11em !important;
  }

  body.single-product .momen-product-intro > p:first-of-type {
    font-size: clamp(18px, 5.5vw, 21px) !important;
    line-height: 1.2 !important;
    margin-bottom: 8px !important;
  }

  body.single-product .momen-product-intro > p:last-of-type {
    font-size: 13px !important;
    line-height: 1.5 !important;
  }

  body.single-product .momen-product-intro > div:last-child {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px !important;
    margin-top: 11px !important;
  }

  body.single-product .momen-product-intro > div:last-child span {
    flex: 1 1 0;
    min-width: 0;
    padding: 4px 2px !important;
    text-align: center;
    font-size: 10px !important;
    line-height: 1.25 !important;
  }

  body.single-product .wp-block-columns:has(.wc-block-product-gallery) {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 1.5rem !important;
    padding-inline: 12px !important;
    box-sizing: border-box;
  }

  body.single-product .wp-block-columns:has(.wc-block-product-gallery) > .wp-block-column {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  body.single-product .wp-block-columns:has(.wc-block-product-gallery) .wc-block-product-gallery {
    margin: 0 !important;
  }

  body.single-product .wc-block-product-gallery:not(:has(.wc-block-product-gallery-thumbnails)) .wc-block-product-gallery-large-image {
    aspect-ratio: auto !important;
    height: auto !important;
  }

  body.single-product .wc-block-product-gallery:not(:has(.wc-block-product-gallery-thumbnails)) .wc-block-product-gallery-large-image img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }

  body.single-product .product-info-card {
    width: calc(100% - 24px);
    max-width: none;
    margin-inline: auto;
  }

  body.single-product .product-info-card .woocommerce-tabs,
  body.single-product .product-info-card .woocommerce-Tabs-panel--description {
    margin: 0 !important;
    padding: 0 !important;
  }

  body.single-product .woocommerce-Tabs-panel--description .momen-package-detail {
    padding: 20px !important;
    border-radius: 14px;
  }

  body.single-product .woocommerce-Tabs-panel--description .momen-package-detail .hero-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1rem !important;
    align-items: start !important;
  }

  body.single-product .woocommerce-Tabs-panel--description .momen-package-detail .hero-side {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: .75rem !important;
  }

  body.single-product .woocommerce-Tabs-panel--description .momen-package-detail .hero-side .stat {
    min-width: 0;
    padding: 10px 12px !important;
  }

  body.single-product .woocommerce-Tabs-panel--description .momen-package-detail .hero-side .stat b,
  body.single-product .woocommerce-Tabs-panel--description .momen-package-detail .hero-side .stat span {
    overflow-wrap: anywhere;
  }

  body.single-product .woocommerce-Tabs-panel--description .momen-package-detail .section,
  body.single-product .woocommerce-Tabs-panel--description .momen-package-detail .footer {
    padding-block: 1.5rem !important;
  }

  body.single-product form.variations_form .variations tbody tr {
    display: grid !important;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    column-gap: .75rem;
  }

  body.single-product form.variations_form .variations th.label {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    padding: 0;
    white-space: nowrap;
  }

  body.single-product form.variations_form .variations .value {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    align-items: center;
  }

  body.single-product form.variations_form .momen-variation-buttons {
    width: auto;
    justify-content: flex-start;
  }

  body.single-product form.variations_form .variations tbody tr {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center;
    align-items: center;
    gap: .65rem;
  }

  body.single-product form.variations_form .variations th.label,
  body.single-product form.variations_form .variations .value {
    grid-column: auto;
    grid-row: auto;
    position: static !important;
    float: none !important;
    display: flex !important;
  }

  body.single-product form.variations_form .variations th.label {
    order: 1 !important;
    transform: translateY(-24px) !important;
  }

  body.single-product form.variations_form .variations .value {
    order: 2 !important;
    flex: 0 1 auto;
  }

  body.single-product form.variations_form .variations .momen-variation-buttons {
    flex-wrap: nowrap;
  }
}
