/* Shared alignment for the existing storefront and its native Elementor canvas. */
:where(body.mmox-platform-active) {
  --mmox-page-gutter: 32px;
}

/* Explicit areas prevent wrapped flex rows from distributing empty header space. */
:where(body.mmox-platform-active) .mmox-header .mmox-header-inner {
  display: grid;
  grid-template-areas: "brand navigation actions";
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  align-content: center;
  justify-content: normal;
  width: 100%;
  max-width: 1280px;
  height: auto;
  min-height: 80px;
  margin: 0 auto;
  padding: 10px var(--mmox-page-gutter);
  gap: 0 24px;
  --width: 100%;
  --min-height: 80px;
  --padding-top: 10px;
  --padding-bottom: 10px;
  --padding-left: var(--mmox-page-gutter);
  --padding-right: var(--mmox-page-gutter);
  --row-gap: 0px;
  --column-gap: 24px;
  --align-items: center;
  --align-content: center;
}

:where(body.mmox-platform-active) .mmox-header .mmox-brand {
  grid-area: brand;
  justify-self: start;
  align-self: center;
  width: auto;
  min-width: 0;
  --width: auto;
  --flex-grow: 0;
  --flex-shrink: 1;
}

:where(body.mmox-platform-active) .mmox-header nav {
  grid-area: navigation;
  order: 0;
  justify-self: center;
  justify-content: center;
  align-items: center;
  width: auto;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  --width: auto;
  --flex-basis: auto;
  --justify-content: center;
}

:where(body.mmox-platform-active) .mmox-header .mmox-header-actions {
  grid-area: actions;
  justify-self: end;
  justify-content: flex-end;
  align-items: center;
  width: auto;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  --width: auto;
  --justify-content: flex-end;
}

/* The support bar follows the same left/right edges as the page content. */
:where(body.mmox-platform-active) .mmox-support-strip .mmox-container {
  padding-right: var(--mmox-page-gutter);
  padding-left: var(--mmox-page-gutter);
  --padding-right: var(--mmox-page-gutter);
  --padding-left: var(--mmox-page-gutter);
}

/* Keep intrinsically wide text and form controls inside their layout tracks. */
:where(body.mmox-platform-active) :is(
  .mmox-hero-grid, .mmox-category-grid, .mmox-product-grid,
  .mmox-catalog-layout, .mmox-product-detail, .mmox-footer-grid,
  .mmox-support-service-grid, .mmox-support-contact-grid,
  .mmox-support-lower-grid, .mmox-support-topic-grid
) > * {
  min-width: 0;
}

:where(body.mmox-platform-active) .mmox-view .mmox-product-grid {
  align-items: stretch;
}

/* A shared footer slot aligns prices and actions after the complete card copy. */
:where(body.mmox-platform-active) .mmox-product-card .mmox-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

:where(body.mmox-platform-active) .mmox-product-card .mmox-card-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin-top: auto;
  padding-top: 4px;
}

:where(body.mmox-platform-active) .mmox-card-footer .mmox-card-actions {
  margin-top: 0;
}

/* Reserve the same finance space when a deposit or a sale price wraps. */
:where(body.mmox-platform-active) .mmox-card-rent .mmox-card-price-group {
  min-height: 88px;
}

:where(body.mmox-platform-active) .mmox-card-buy .mmox-card-price-group {
  min-height: 34px;
}

:where(body.mmox-platform-active) .mmox-card-footer .mmox-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 4px;
}

:where(body.mmox-platform-active) .mmox-card-footer .mmox-price small {
  margin-left: 0;
}

:where(body.mmox-platform-active) .mmox-card-footer .mmox-card-deposit {
  display: block;
  width: auto;
  max-width: 100%;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

:where(body.mmox-platform-active) .mmox-view .mmox-card-features {
  display: grid;
  gap: 4px;
  margin: 3px 0 8px;
  padding: 0;
  list-style: none;
  color: #58656c;
  font-size: 12px;
  line-height: 1.5;
}

:where(body.mmox-platform-active) .mmox-card-features li {
  position: relative;
  min-width: 0;
  margin: 0;
  padding-left: 11px;
  overflow-wrap: anywhere;
}

:where(body.mmox-platform-active) .mmox-card-features li::before {
  content: "";
  position: absolute;
  top: .67em;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--mmox-blue-ink);
}

:where(body.mmox-platform-active) .mmox-card-features .mmox-spec-label {
  margin-right: 4px;
  color: #41617e;
  font-weight: 600;
}

:where(body.mmox-platform-active) .mmox-view .mmox-product-specs {
  display: grid;
  gap: 0;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

:where(body.mmox-platform-active) .mmox-product-specs li {
  position: relative;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
  margin: 0;
  padding: 10px 0 10px 14px;
  border-bottom: 1px solid #e0e7ff;
  font-size: 13px;
  line-height: 1.6;
}

:where(body.mmox-platform-active) .mmox-product-specs li::before {
  content: "";
  position: absolute;
  top: calc(10px + .7em);
  left: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mmox-blue-ink);
}

:where(body.mmox-platform-active) .mmox-product-specs .mmox-spec-label {
  color: #183b56;
}

:where(body.mmox-platform-active) :is(.mmox-key-specs, .mmox-card-features) .mmox-spec-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

:where(body.mmox-platform-active) .mmox-view :is(details, summary) {
  min-width: 0;
  overflow-wrap: anywhere;
}

:where(body.mmox-platform-active) .mmox-view .woocommerce :is(.form-row, .select2-container, #order_review) {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 768px) {
  :where(body.mmox-platform-active) .mmox-header .mmox-brand img {
    width: clamp(155px, 16vw, 190px);
  }
}

@media (min-width: 768px) and (max-width: 1100px) {
  :where(body.mmox-platform-active) .mmox-header .mmox-header-inner {
    gap: 0 16px;
    --column-gap: 16px;
  }
}

/* Tablet navigation has a compact, explicitly sized second row. */
@media (min-width: 768px) and (max-width: 1024px) {
  :where(body.mmox-platform-active) .mmox-header .mmox-header-inner {
    grid-template-areas: "brand actions" "navigation navigation";
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    min-height: 0;
    padding-top: 10px;
    padding-bottom: 6px;
    gap: 4px 16px;
    --min-height: 0px;
    --padding-top: 10px;
    --padding-bottom: 6px;
    --row-gap: 4px;
  }

  :where(body.mmox-platform-active) .mmox-header nav {
    width: 100%;
    gap: 8px;
    --width: 100%;
  }
}

/* Portrait tablets need room for the same purchase fields and specifications. */
@media (min-width: 768px) and (max-width: 900px) {
  :where(body.mmox-platform-active) .mmox-view .mmox-product-detail {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  :where(body.mmox-platform-active) .mmox-view-rent .mmox-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  :where(body.mmox-platform-active) {
    --mmox-page-gutter: 16px;
  }

  :where(body.mmox-platform-active) .mmox-header .mmox-header-inner {
    grid-template-areas: "brand actions";
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 64px;
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 0 10px;
    --min-height: 64px;
    --padding-top: 8px;
    --padding-bottom: 8px;
    --row-gap: 0px;
    --column-gap: 10px;
  }

  :where(body.mmox-platform-active) .mmox-product-card .mmox-card-footer {
    gap: 6px;
    padding-top: 2px;
  }

  :where(body.mmox-platform-active) .mmox-card-rent .mmox-card-price-group {
    min-height: 78px;
  }

  :where(body.mmox-platform-active) .mmox-card-buy .mmox-card-price-group {
    min-height: 36px;
  }

  :where(body.mmox-platform-active) .mmox-view .mmox-card-features {
    gap: 4px;
    margin-bottom: 6px;
    font-size: 11px;
    line-height: 1.5;
  }

  :where(body.mmox-platform-active) .mmox-product-specs li {
    font-size: 12px;
  }
}

@media (max-width: 359px) {
  :where(body.mmox-platform-active) .mmox-card-rent .mmox-card-price-group {
    min-height: 96px;
  }

  :where(body.mmox-platform-active) .mmox-card-buy .mmox-card-price-group {
    min-height: 36px;
  }
}
