/* Both text and background follow merchant branding together. */
.mt-button {
  background: var(--buttons-bg-color, var(--primary-color));
  color: var(--buttons-color, var(--text-color-primary-bg, #fff));
  padding-block: .75rem;
  padding-inline: 1.25rem;
}
.mt-number { direction: ltr; unicode-bidi: isolate; }

/* MT section shell: neutral geometry, no inherited store palette. */
.mt-section {
  position: relative;
  isolation: isolate;
  background-color: var(--mt-section-bg, transparent);
  padding-block-start: var(--mt-space-top, 3rem);
  padding-block-end: var(--mt-space-bottom, 3rem);
  text-align: start;
}
.mt-section__background, .mt-section__overlay {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
}
.mt-section__background { object-fit: cover; object-position: center; z-index: -2; }
.mt-section__overlay {
  z-index: -1;
  background-color: var(--mt-overlay-color, #000);
  opacity: var(--mt-overlay-opacity, .4);
}
.mt-section__content {
  box-sizing: border-box;
  inline-size: 100%;
  max-inline-size: var(--mt-content-width, 75rem);
  margin-inline: auto;
  padding-inline: var(--mt-content-gutter, 1.5rem);
}
.mt-section--full > .mt-section__content { max-inline-size: none; }
.mt-section__messages { padding-inline-start: 1.5rem; }
@media (max-width: 767px) {
  .mt-section {
    padding-block-start: var(--mt-space-top-mobile, var(--mt-space-top, 3rem));
    padding-block-end: var(--mt-space-bottom-mobile, var(--mt-space-bottom, 3rem));
  }
}
/* Carousel navigation, in the base stylesheet rather than in mt-main-slider.css.
   The advertising popup renders its own `.mt-slider__navigation` on every page
   it is enabled on, and mt-main-slider.css is linked only by the main slider
   section. Kept in the section's sheet, the popup's arrows and dots would lose
   their row, their spacing and their current-slide outline on any page without
   a slider - which is every page but the home page. */
.mt-slider__navigation, .mt-slider__dots { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.mt-slider__navigation { padding-block: .75rem; }
/* Not on the theme's own arrows (.dana-sw-nav, core.css): at (0,1,1) this
   outweighed their white disc, and the popup's `color: inherit` below their
   hover, so the chevron went grey on a dark disc (2026-09-29 review). */
.mt-slider__navigation button:not(.dana-sw-nav) { background: var(--mt-nav-bg, transparent); color: var(--mt-nav-text, inherit); }
.mt-slider__navigation [aria-current="true"] { outline: 2px solid var(--mt-nav-active, currentColor); outline-offset: 2px; }
.mt-slider__navigation[hidden] { display: none; }
/* Theme-owned variables/composition; functionality does not impose a brand. */
.mt-popup {
  border: 0;
  padding: 0;
  inline-size: min(48rem, calc(100% - 2rem));
  max-block-size: calc(100dvh - 2rem);
  overflow: auto;
  background: var(--mt-popup-bg, var(--dana-bg, #fff));
  color: var(--mt-popup-text, var(--dana-text, #111));
}
.mt-popup::backdrop { background: var(--mt-popup-backdrop, #000); opacity: var(--mt-popup-backdrop-opacity, .5); }
.mt-popup__close { position: sticky; inset-block-start: 0; display: flex; justify-content: end; background: inherit; z-index: 2; padding: .5rem; margin: 0; }
.mt-popup__slide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
.mt-popup__slide:not(:has(.mt-popup__image)) { grid-template-columns: 1fr; }
.mt-popup__slide[hidden] { display: none; }
.mt-popup__image img { inline-size: 100%; block-size: auto; display: block; }
.mt-popup[data-image-position="end"] .mt-popup__image { order: 1; }
.mt-popup[data-image-position="stack"] .mt-popup__slide { grid-template-columns: 1fr; }
.mt-popup__content { padding: 1.5rem; text-align: start; }
.mt-popup__content h2, .mt-popup__content p { color: inherit; }
.mt-popup__content p { white-space: pre-line; }
/* The popup's button is the theme's own .dana-btn (widgets.css): a rule here
   on `.mt-popup__content a` outweighed its padding and display. */
.mt-popup .mt-slider__navigation button:not(.dana-sw-nav) { color: inherit; }
@media (max-width: 767px) {
  .mt-popup__slide { grid-template-columns: 1fr; }
  .mt-popup[data-image-position="end"] .mt-popup__image { order: 0; }
}
/* column-reverse, not column, and the order matters.
   The column is anchored to the bottom of the viewport and the back-to-top
   button appears and disappears with scrolling and focus. In `column` order it
   sits below WhatsApp, so every time it is hidden the container shrinks from
   the top and the WhatsApp button slides down - measured at 61px in a headless
   browser, which is enough for a click that started on WhatsApp to land on
   nothing. Reversed, WhatsApp is the bottom child and keeps its position no
   matter what appears above it. */
/* A floating corner stays physical: the same corner in both languages
   (conventions.md), so `right`, not inset-inline-end. */
.mt-floating { position: fixed; left: auto; right: 1rem; inset-block-end: calc(1rem + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column-reverse; align-items: end; gap: .75rem; z-index: var(--mt-floating-layer, 40); }
.mt-whatsapp { position: relative; }
.mt-whatsapp__icon { inline-size: 1.25rem; block-size: 1.25rem; vertical-align: middle; }
.mt-whatsapp__trigger, .mt-back-top { display: inline-block; border: 0; padding-block: .75rem; padding-inline: 1rem; cursor: pointer; background: var(--mt-chat-button-bg, var(--dana-bg, #fff)); color: var(--mt-chat-button-text, var(--dana-primary-ink, #111)); }
.mt-back-top { background: var(--mt-back-top-bg, var(--dana-bg, #fff)); color: var(--mt-back-top-text, var(--dana-heading, #111)); }
.mt-whatsapp__panel { position: absolute; left: auto; right: 0; inset-block-end: calc(100% + .75rem); inline-size: min(20rem, calc(100vw - 2rem)); max-block-size: calc(100dvh - 12rem); overflow: auto; box-sizing: border-box; padding: 1rem; background: var(--mt-chat-bg, var(--dana-bg, #fff)); color: var(--mt-chat-text, var(--dana-text, #111)); box-shadow: 0 .25rem 1rem #0003; text-align: start; }
.mt-whatsapp__panel h2 { color: inherit; }
.mt-whatsapp__close { display: block; margin-inline-start: auto; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1.5rem; }
.mt-whatsapp__avatar { inline-size: 3rem; block-size: 3rem; object-fit: cover; border-radius: 50%; }
.mt-whatsapp__messages { list-style: none; padding: 0; }
.mt-whatsapp__messages li { background: var(--mt-message-bg, var(--dana-surface, #f5f5f5)); padding: .75rem; margin-block: .5rem; white-space: pre-line; }
.mt-floating [hidden] { display: none; }
.mt-mobile { position: fixed; inset-block: 0; inset-inline-start: 0; inset-inline-end: auto; margin: 0; padding: 1rem; border: 0; box-sizing: border-box; inline-size: min(24rem, 90vw); max-inline-size: 100%; block-size: 100dvh; max-block-size: 100dvh; overflow: auto; background: var(--mt-menu-bg, var(--dana-bg, #fff)); color: var(--mt-menu-text, var(--dana-heading, #111)); text-align: start; }
.mt-mobile::backdrop { background: var(--mt-menu-backdrop, #000); opacity: var(--mt-menu-opacity, .5); }
.mt-mobile__header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.mt-mobile__header h2 { color: inherit; }
.mt-mobile button { color: inherit; background: transparent; border: 0; padding: .75rem; cursor: pointer; }
.mt-mobile ul { list-style: none; padding: 0; margin: 0; }
.mt-mobile li { border-block-end: 1px solid var(--mt-menu-border, var(--dana-line, #ddd)); }
.mt-mobile li > ul { padding-inline-start: 1rem; }
.mt-mobile li > ul[hidden] { display: none; }
.mt-mobile a { color: inherit; padding-block: .75rem; display: inline-block; }
.mt-mobile__row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.mt-mobile__actions { display: flex; flex-wrap: wrap; gap: .5rem; padding-block: 1rem; }
.mt-cart { inset-block: 0; inset-inline: auto 0; margin: 0; block-size: 100dvh; max-block-size: 100dvh; inline-size: min(28rem, 100%); max-inline-size: 100%; box-sizing: border-box; padding: 1.25rem; border: 0; background: var(--mt-cart-bg, var(--dana-bg, #fff)); color: var(--mt-cart-text, var(--dana-text, #111)); overflow-y: auto; }
.mt-cart::backdrop { background: rgb(0 0 0 / .5); }
.mt-cart header, .mt-cart__total { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.mt-cart h2 { font-size: 1.25rem; }
/* Every rule below names the drawer region it belongs to instead of a bare element.
   The recommendation row rendered inside this dialog is another module's component:
   a blanket `.mt-cart button { color: inherit }` outranks its own button colour by
   one element and leaves a dark label on a dark button, and a blanket
   `.mt-cart article` would put a cart line's divider and 5rem thumbnail on every
   recommendation card. */
.mt-cart header button, .mt-cart [data-cart-retry], .mt-cart [data-cart-body] button, .mt-cart [data-cart-body] input, .mt-cart [data-cart-coupon] button, .mt-cart [data-cart-coupon] input { font: inherit; color: inherit; }
.mt-cart header button, .mt-cart [data-cart-retry], .mt-cart [data-cart-body] button, .mt-cart [data-cart-coupon] button { cursor: pointer; }
.mt-cart [data-cart-body] article { padding-block: 1rem; border-block-end: 1px solid var(--mt-cart-border, var(--dana-line, #ddd)); }
.mt-cart [data-cart-body] article img { inline-size: 5rem; block-size: 5rem; object-fit: contain; }
.mt-cart [data-cart-body] article input { inline-size: 5rem; margin-inline: .5rem; }
.mt-cart footer { margin-block-start: 1.5rem; padding-block-end: env(safe-area-inset-bottom); }
.mt-cart [aria-busy="true"] { opacity: .6; }
/* The shipping bar, the coupon form and the applied-coupon box are toggled with the
   `hidden` attribute between renders. An author rule that sets `display` outranks the
   user-agent's `[hidden] { display: none }`, so without this the applied coupon and the
   form it replaces would both be on screen at once. */
.mt-cart [hidden] { display: none; }
.mt-cart__shipping { display: grid; gap: .5rem; margin-block: .75rem 1rem; }
.mt-cart__shipping-message { margin: 0; font-size: .875rem; }
.mt-cart__progress { appearance: none; -webkit-appearance: none; inline-size: 100%; block-size: .5rem; border: 0; border-radius: 999px; background: var(--mt-cart-border, var(--dana-line, #ddd)); overflow: hidden; }
.mt-cart__progress::-webkit-progress-bar { background: var(--mt-cart-border, var(--dana-line, #ddd)); }
.mt-cart__progress::-webkit-progress-value { background: var(--mt-cart-accent, var(--dana-accent, #111)); }
.mt-cart__progress::-moz-progress-bar { background: var(--mt-cart-accent, var(--dana-accent, #111)); }
.mt-cart__coupon { display: grid; gap: .5rem; margin-block: 1rem; padding-block-start: 1rem; border-block-start: 1px solid var(--mt-cart-border, var(--dana-line, #ddd)); }
.mt-cart__coupon-label { font-size: .875rem; }
.mt-cart__coupon-row { display: flex; gap: .5rem; margin-block-start: .375rem; }
.mt-cart__coupon-row input { flex: 1 1 auto; min-inline-size: 0; }
.mt-cart__coupon-applied { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
/* The refusal carries weight rather than a colour of its own. The merchant chooses this
   drawer's background, so a fixed error red here would be a contrast ratio nobody has
   measured; each theme sets its own error colour on top of this rule. */
.mt-cart__coupon-error { margin: 0; font-size: .875rem; font-weight: 600; }
.mt-cart__totals { display: grid; gap: .25rem; margin-block-end: 1rem; }
/* View cart and checkout share the row; the closed-store checkout stays visible
   but cannot be pressed, as on the cart page. */
.mt-cart__actions { display: flex; gap: .75rem; }
.mt-cart__actions .mt-button { flex: 1 1 0; min-inline-size: 0; text-align: center; }
.mt-cart__actions .mt-button[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.mt-cart__continue { margin: .75rem 0 0; text-align: center; }
.mt-cart__continue button { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
/* A recommendation strip on the cart page must not drag a slider library onto
   the one page whose only job is checking out. Vineta's row costs jQuery plus
   slick before a single product is drawn; this one is a scroll-snap rail, so it
   works with the script blocked and follows the writing direction on its own  - 
   a flex row and `scroll-snap-align: start` are already direction-aware.
   `overflow-x` and `scroll-snap-type: x` name an axis rather than a side, which
   is why they are the two physical properties left in this file: the logical
   `inline` keyword for scroll-snap is still uneven across shipping browsers. */
.mt-recommendations { margin-block: 2rem 0; }
.mt-recommendations[hidden] { display: none; }
/* The heading's distance from the cards is a property a theme sets to its own
   section-heading spacing. The default is in px on purpose: Zid's starter
   themes set the root font size to 12px, so the old `1rem` was 12px there  - 
   the row's heading sat on top of the cards in every theme.
   The drawer's row is tighter and has its own knob
   (--mt-recommendations-title-gap-drawer, at the end of this file): one name
   for both would mean a theme setting the page's gap on :root - the obvious
   place - silently widened the drawer too. */
.mt-recommendations__title { margin-block: 0 var(--mt-recommendations-title-gap, 24px); font-size: 1.125rem; }
.mt-recommendations__row {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  overscroll-behavior-inline: contain;
  padding-block-end: .5rem;
  scrollbar-width: thin;
}
.mt-recommendations__card {
  flex: 0 0 auto;
  inline-size: clamp(8.5rem, 42vw, 12rem);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  text-align: start;
}
/* The tint is derived from the inherited text colour so the placeholder cannot
   fight a theme that paints the cart page dark. The flat value is the fallback
   for browsers without color-mix, not a second opinion about the colour. */
.mt-recommendations__media {
  display: block;
  aspect-ratio: 1;
  max-inline-size: 100%;
  overflow: hidden;
  background: #f2f2f2;
  background: color-mix(in srgb, currentColor 6%, transparent);
}
.mt-recommendations__media img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.mt-recommendations__name { margin: 0; font-size: .9375rem; font-weight: 500; line-height: 1.4; }
.mt-recommendations__name-link {
  color: inherit;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mt-recommendations__name-link:hover, .mt-recommendations__name-link:focus-visible { text-decoration: underline; }
.mt-recommendations__price { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
/* An Arabic price beside a struck-through one reorders the two figures unless
   each is isolated from its neighbour's bidi run. */
.mt-recommendations__price-now, .mt-recommendations__price-was { unicode-bidi: isolate; }
.mt-recommendations__price-was { opacity: .65; }
.mt-recommendations__note, .mt-recommendations__flag { margin: 0; font-size: .8125rem; opacity: .75; }
/* Both button colours together: a merchant who darkens one without the other is
   how a readable label turns into 1.35:1. */
.mt-recommendations__action {
  margin-block-start: auto;
  display: block;
  inline-size: 100%;
  box-sizing: border-box;
  border: 0;
  padding-block: .5rem;
  padding-inline: .75rem;
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  background: var(--buttons-bg-color, var(--primary-color, #111111));
  color: var(--buttons-color, var(--text-color-primary-bg, #ffffff));
}
.mt-recommendations__action[disabled] { opacity: .6; cursor: default; }
.mt-recommendations--drawer { margin-block: 1.5rem 0; }
.mt-recommendations--drawer .mt-recommendations__title { font-size: 1rem; margin-block-end: var(--mt-recommendations-title-gap-drawer, 16px); }
.mt-recommendations--drawer .mt-recommendations__card { inline-size: 8.5rem; }
/* Internal advertisements - neutral geometry only.

   Every value here is either a custom property with a plain fallback or a
   layout rule that has to hold in both directions. No palette, no typography,
   no borrowed class names: each theme paints this itself.

   Everything is written with logical properties. The two physical names that
   remain are axis names, not side names: `overflow-x` and `scrollbar-width`
   have no logical spelling a storefront browser can be relied on to support,
   and an axis does not mirror between Arabic and English. */
.mt-ads {
  --mt-ads-per-view: 1;
  --mt-ads-per-view-mobile: 1;
  --mt-ads-gap: 1rem;
  position: relative;
  padding-block-start: var(--mt-ads-space-top, 2.5rem);
  padding-block-end: var(--mt-ads-space-bottom, 2.5rem);
}
.mt-ads__inner {
  box-sizing: border-box;
  inline-size: 100%;
  max-inline-size: var(--mt-content-width, 75rem);
  margin-inline: auto;
  padding-inline: var(--mt-content-gutter, 1.5rem);
}
/* Full width widens the band; the gutter stays, because unlike the main slider
   an advertisement strip still needs its content off the edge of the screen. */
.mt-ads--full > .mt-ads__inner { max-inline-size: none; }

.mt-ads__heading {
  text-align: var(--mt-ads-title-align, start);
  margin-block-end: 1rem;
}
.mt-ads__title { margin: 0; }
.mt-ads__subtitle { margin-block: .25rem 0; }

.mt-ads__slider { position: relative; }
/* The track is the only box on the page allowed to scroll sideways, and it can
   only do so inside its own border box: `inline-size: 100%` with border-box
   sizing means a 375px viewport never gains a document-level scrollbar.
   It carries no padding and no border on purpose - mt-ads.js aligns slides by
   comparing the track's own client rect with a slide's, and a padded scroll
   container would offset every page by that padding. */
.mt-ads__track {
  display: flex;
  box-sizing: border-box;
  inline-size: 100%;
  max-inline-size: 100%;
  gap: var(--mt-ads-gap);
  padding: 0;
  border: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
}
.mt-ads__track::-webkit-scrollbar { display: none; }

.mt-ads__slide {
  box-sizing: border-box;
  /* min-inline-size: 0 stops a long word inside a slide from pushing the flex
     item past its basis, which is what actually produces stray page scrolling. */
  min-inline-size: 0;
  max-inline-size: 100%;
  flex: 0 0 calc((100% - (var(--mt-ads-per-view-mobile) - 1) * var(--mt-ads-gap)) / var(--mt-ads-per-view-mobile));
  scroll-snap-align: start;
  color: var(--mt-ads-text, inherit);
  text-align: var(--mt-ads-align, start);
}
@media (min-width: 768px) {
  .mt-ads__slide {
    flex-basis: calc((100% - (var(--mt-ads-per-view) - 1) * var(--mt-ads-gap)) / var(--mt-ads-per-view));
  }
}

/* The frame takes its height from a ratio rather than from the picture, so a
   merchant who uploads an odd crop cannot make one banner twice as tall as the
   one beside it, and nothing reflows once the image arrives. */
.mt-ads__frame {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  box-sizing: border-box;
  inline-size: 100%;
  max-inline-size: 100%;
  aspect-ratio: var(--mt-ads-ratio, 16 / 9);
  overflow: hidden;
  background-color: var(--mt-ads-slide-bg, transparent);
  color: inherit;
  text-decoration: none;
}
.mt-ads__media, .mt-ads__overlay {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
}
.mt-ads__media { z-index: 0; }
.mt-ads__media img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: center;
}
.mt-ads__overlay {
  z-index: 1;
  pointer-events: none;
  background-color: var(--mt-ads-overlay, #000);
  opacity: var(--mt-ads-overlay-opacity, .4);
}
.mt-ads__content {
  position: relative;
  z-index: 2;
  display: grid;
  gap: .4rem;
  justify-items: var(--mt-ads-align, start);
  padding: var(--mt-ads-content-padding, 1.25rem);
}
.mt-ads__text { white-space: pre-line; }
.mt-ads__button {
  display: inline-block;
  justify-self: var(--mt-ads-align, start);
  padding-block: .5rem;
  padding-inline: 1rem;
  border: 1px solid currentColor;
}

.mt-ads__navigation {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  justify-content: center;
  padding-block-start: .75rem;
}
.mt-ads__navigation[hidden] { display: none; }
.mt-ads__dots { display: flex; flex-wrap: wrap; gap: .4rem; }
.mt-ads__navigation button:not(.dana-sw-nav) {
  background: var(--mt-ads-nav-bg, transparent);
  color: var(--mt-ads-nav-text, inherit);
}
.mt-ads__navigation button[disabled] { opacity: .5; }
.mt-ads__navigation [aria-current="true"] {
  outline: 2px solid var(--mt-ads-nav-active, currentColor);
  outline-offset: 2px;
}
@media (max-width: 767px) {
  .mt-ads {
    padding-block-start: var(--mt-ads-space-top-mobile, var(--mt-ads-space-top, 2.5rem));
    padding-block-end: var(--mt-ads-space-bottom-mobile, var(--mt-ads-space-bottom, 2.5rem));
  }
}
