/* Maltazon Terms & Conditions UX2 — isolated to CMS page 3 and its checkout modal component. */
body.cms-id-3 #left-column,
body.cms-id-3 #right-column {
  display: none;
}

body.cms-id-3 #content-wrapper {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
}

body.cms-id-3 .page-content.page-cms-3 {
  max-width: 1240px;
  margin: 0 auto 52px;
  padding: 0;
  overflow: visible;
  border: 1px solid #e7e7e7;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(30, 30, 30, 0.07);
  color: #343434;
  text-align: left;
}

.mz-terms,
.mz-terms * {
  box-sizing: border-box;
}

.mz-terms {
  color: #343434;
  font-size: 1rem;
  line-height: 1.65;
}

.mz-terms a {
  color: #9c4800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  overflow-wrap: anywhere;
}

.mz-terms a:hover {
  color: #723500;
}

.mz-terms a:focus-visible,
.mz-terms summary:focus-visible {
  outline: 3px solid #7a3900;
  outline-offset: 3px;
  border-radius: 3px;
}

.mz-terms__hero,
.mz-terms__layout {
  padding-right: clamp(24px, 5vw, 64px);
  padding-left: clamp(24px, 5vw, 64px);
}

.mz-terms__hero {
  position: relative;
  isolation: isolate;
  padding-top: clamp(42px, 7vw, 78px);
  padding-bottom: clamp(38px, 6vw, 68px);
  overflow: hidden;
  border-radius: 17px 17px 0 0;
  background: linear-gradient(135deg, #fff8f1 0%, #fff 66%);
}

.mz-terms__hero::after {
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  background: #ff7900;
  content: "";
}

.mz-terms__eyebrow {
  margin: 0 0 14px;
  color: #a94d00;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mz-terms h1 {
  max-width: 820px;
  margin: 0 0 22px;
  color: #202020;
  font-size: clamp(2.25rem, 4.6vw, 4rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-transform: none;
}

.mz-terms__intro {
  max-width: 68ch;
  margin: 0;
  color: #4b4b4b;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.62;
}

.mz-terms__company {
  margin-bottom: clamp(48px, 7vw, 72px);
  padding: clamp(26px, 4vw, 38px);
  border: 1px solid #e2e2e2;
  border-radius: 14px;
  background: #f7f7f7;
}

.mz-terms__section-heading {
  max-width: 72ch;
  margin-bottom: 28px;
}

.mz-terms h2 {
  margin: 0 0 24px;
  color: #222;
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-transform: none;
}

.mz-terms__section-heading h2 {
  margin-bottom: 0;
}

.mz-terms__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.mz-terms__fact {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  background: #fff;
}

.mz-terms__fact--wide {
  grid-column: 1 / -1;
}

.mz-terms__fact dt {
  margin: 0 0 6px;
  color: #555;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.mz-terms__fact dd {
  margin: 0;
  color: #292929;
  font-size: 1rem;
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.mz-terms__layout {
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(0, 72ch);
  gap: clamp(36px, 6vw, 76px);
  align-items: start;
  justify-content: center;
  padding-top: clamp(42px, 6vw, 68px);
  padding-bottom: clamp(46px, 7vw, 78px);
  border-top: 1px solid #ededed;
}

.mz-terms__toc {
  min-width: 0;
  border: 1px solid #dedede;
  border-radius: 12px;
  background: #fff;
}

.mz-terms__toc summary {
  position: relative;
  min-height: 48px;
  padding: 14px 44px 14px 16px;
  color: #242424;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
}

.mz-terms__toc summary::-webkit-details-marker {
  display: none;
}

.mz-terms__toc summary::after {
  position: absolute;
  top: 50%;
  right: 17px;
  width: 9px;
  height: 9px;
  border-right: 2px solid #7a3900;
  border-bottom: 2px solid #7a3900;
  content: "";
  transform: translateY(-68%) rotate(45deg);
  transition: transform 0.2s ease;
}

.mz-terms__toc[open] summary::after {
  transform: translateY(-28%) rotate(225deg);
}

.mz-terms__toc nav {
  padding: 2px 16px 16px;
  border-top: 1px solid #ededed;
}

.mz-terms__toc ol {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.mz-terms__toc li + li {
  margin-top: 4px;
}

.mz-terms__toc a {
  display: block;
  padding: 7px 4px;
  color: #4b4b4b;
  font-size: 0.875rem;
  line-height: 1.4;
  text-decoration: none;
}

.mz-terms__toc a:hover {
  color: #8c4100;
  text-decoration: underline;
}

.mz-terms__document {
  min-width: 0;
  max-width: 72ch;
}

.mz-terms__section {
  scroll-margin-top: 120px;
}

.mz-terms__section + .mz-terms__section {
  margin-top: clamp(48px, 7vw, 72px);
  padding-top: clamp(42px, 6vw, 60px);
  border-top: 1px solid #e6e6e6;
}

.mz-terms__section h2::before,
.mz-terms__related h2::before {
  display: block;
  width: 44px;
  height: 4px;
  margin-bottom: 16px;
  border-radius: 4px;
  background: #ff7900;
  content: "";
}

.mz-terms__section h3 {
  margin: 36px 0 14px;
  color: #292929;
  font-size: clamp(1.12rem, 1.7vw, 1.3rem);
  font-weight: 700;
  line-height: 1.35;
  text-transform: none;
}

.mz-terms__section p,
.mz-terms__section li {
  font-size: 1rem;
  line-height: 1.65;
}

.mz-terms__section p {
  margin: 0 0 1.1em;
}

.mz-terms__section p:last-child {
  margin-bottom: 0;
}

.mz-terms__section ul,
.mz-terms__section ol {
  margin: 0 0 1.4em;
  padding-left: 1.35em;
}

.mz-terms__section li {
  margin-bottom: 0.55em;
  padding-left: 0.2em;
}

.mz-terms__section strong {
  color: #282828;
  font-weight: 700;
}

.mz-terms__section span[style*="text-decoration"] {
  text-decoration-thickness: 1px !important;
  text-underline-offset: 0.16em;
}

.mz-terms__related {
  margin-top: clamp(54px, 8vw, 84px);
  padding: 28px 30px;
  border-radius: 12px;
  background: #252525;
  color: #fff;
}

.mz-terms__related h2 {
  margin-bottom: 18px;
  color: #fff;
  font-size: 1.4rem;
}

.mz-terms__related ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mz-terms__related a {
  color: #ffd0a4;
  font-weight: 600;
}

@media (min-width: 1100px) {
  .mz-terms__toc {
    position: sticky;
    top: 108px;
    max-height: calc(100vh - 132px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

}

@media (max-width: 1099.98px) {
  .mz-terms__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .mz-terms__toc {
    width: 100%;
  }
}

@media (max-width: 767.98px) {
  body.cms-id-3 #wrapper .container {
    padding-right: 15px;
    padding-left: 15px;
  }

  body.cms-id-3 .page-content.page-cms-3 {
    margin-bottom: 30px;
    border-radius: 14px;
    box-shadow: 0 8px 26px rgba(30, 30, 30, 0.06);
  }

  .mz-terms {
    font-size: 16px;
    line-height: 1.65;
  }

  .mz-terms__hero,
  .mz-terms__layout {
    padding-right: 20px;
    padding-left: 20px;
  }

  .mz-terms__hero {
    padding-top: 34px;
    padding-bottom: 34px;
    border-radius: 13px 13px 0 0;
  }

  .mz-terms__hero::after {
    width: 5px;
  }

  .mz-terms h1 {
    margin-bottom: 18px;
    font-size: 2.25rem;
  }

  .mz-terms__intro,
  .mz-terms__section p,
  .mz-terms__section li,
  .mz-terms__fact dd {
    font-size: 1rem;
    line-height: 1.65;
  }

  .mz-terms__company {
    padding: 24px 16px;
  }

  .mz-terms__facts {
    grid-template-columns: 1fr;
  }

  .mz-terms__fact,
  .mz-terms__fact--wide {
    grid-column: auto;
    padding: 16px;
  }

  .mz-terms__layout {
    gap: 34px;
    padding-top: 32px;
    padding-bottom: 42px;
  }

  .mz-terms__section + .mz-terms__section {
    margin-top: 42px;
    padding-top: 38px;
  }

  .mz-terms__section h3 {
    margin-top: 30px;
  }

  .mz-terms__related {
    margin-top: 48px;
    padding: 24px 20px;
  }

  .mz-terms__related ul {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

body#checkout #modal .mz-terms {
  width: 100%;
  background: #fff;
}

body#checkout #modal .mz-terms__hero,
body#checkout #modal .mz-terms__layout {
  padding-right: 24px;
  padding-left: 24px;
}

body#checkout #modal .mz-terms__hero {
  padding-top: 34px;
  padding-bottom: 34px;
  border-radius: 0;
}

body#checkout #modal .mz-terms__company {
  padding-top: 30px;
  padding-bottom: 34px;
}

body#checkout #modal .mz-terms__facts,
body#checkout #modal .mz-terms__layout {
  grid-template-columns: 1fr;
}

body#checkout #modal .mz-terms__layout {
  gap: 30px;
  padding-top: 30px;
  padding-bottom: 40px;
}

body#checkout #modal .mz-terms__toc {
  position: static;
  max-height: none;
  overflow: visible;
}

/* Keep the existing desktop modal presentation unchanged. The wrapper is
 * promoted to a persistent header only at checkout-mobile widths. */
body#checkout #modal .mz-terms-modal__header {
  display: contents;
}

body#checkout #modal .mz-terms-modal__title {
  display: none;
}

@media (max-width: 767.98px), (max-width: 1023.98px) and (max-height: 600px) {
  body#checkout #modal {
    z-index: 100200;
    padding: 0 !important;
    overflow: hidden;
    overscroll-behavior: contain;
  }

  body#checkout #modal .modal-dialog {
    display: flex;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
  }

  body#checkout #modal .modal-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    max-height: 100vh;
    max-height: 100dvh;
    padding: 0;
    overflow: hidden;
    background: #fff;
    border: 0;
    border-radius: 0;
  }

  body#checkout #modal .mz-terms-modal__header {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px 20px;
    background: #fff;
    border-bottom: 1px solid #e3e7eb;
  }

  body#checkout #modal .mz-terms-modal__title {
    display: block;
    min-width: 0;
    margin: 0;
    color: #022;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
  }

  body#checkout #modal .mz-terms-modal__close {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0 0 0 auto;
    padding: 0;
    float: none;
    color: #172126;
    font-size: 32px;
    font-weight: 400;
    line-height: 1;
    text-shadow: none;
    background: transparent;
    border: 0;
    border-radius: 50%;
    opacity: 1;
  }

  body#checkout #modal .mz-terms-modal__close:hover,
  body#checkout #modal .mz-terms-modal__close:focus {
    color: #000;
    background: #f1f3f5;
    opacity: 1;
  }

  body#checkout #modal .mz-terms-modal__close:focus-visible {
    outline: 3px solid #f28c00;
    outline-offset: 2px;
  }

  body#checkout #modal .mz-terms-modal__body {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    padding-bottom: env(safe-area-inset-bottom);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    background: #fff;
  }
}

@media print {
  body.cms-id-3 #header,
  body.cms-id-3 #footer,
  body.cms-id-3 .breadcrumb,
  body.cms-id-3 .mz-terms__toc,
  body.cms-id-3 #back-top {
    display: none !important;
  }

  body.cms-id-3,
  body.cms-id-3 #page,
  body.cms-id-3 #wrapper,
  body.cms-id-3 #wrapper > .container,
  body.cms-id-3 .page-content.page-cms-3,
  body.cms-id-3 .mz-terms,
  body.cms-id-3 .mz-terms__company,
  body.cms-id-3 .mz-terms__layout {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    color: #000 !important;
  }

  body.cms-id-3 .mz-terms__hero,
  body.cms-id-3 .mz-terms__company,
  body.cms-id-3 .mz-terms__layout {
    display: block !important;
    padding-top: 20pt !important;
    padding-bottom: 20pt !important;
  }

  body.cms-id-3 .mz-terms__hero::after {
    display: none;
  }

  body.cms-id-3 .mz-terms__facts {
    display: block;
  }

  body.cms-id-3 .mz-terms__fact {
    margin-bottom: 8pt;
    padding: 8pt 0;
    break-inside: avoid;
    border-width: 0 0 1px;
    border-radius: 0;
  }

  body.cms-id-3 .mz-terms__section,
  body.cms-id-3 .mz-terms__related {
    display: block !important;
    break-inside: auto;
  }

  body.cms-id-3 .mz-terms__section h2,
  body.cms-id-3 .mz-terms__section h3,
  body.cms-id-3 .mz-terms__related {
    break-inside: avoid;
  }

  body.cms-id-3 .mz-terms__related {
    padding: 18pt 0 !important;
    border-top: 1px solid #777;
    color: #000 !important;
  }

  body.cms-id-3 .mz-terms__related h2,
  body.cms-id-3 .mz-terms__related a {
    color: #000 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mz-terms *,
  .mz-terms *::before,
  .mz-terms *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
