/* ============================================================
   responsive.css - Mobile & Tablet Responsive Overrides
============================================================ */

/* ==== Tablet & Small Desktop (max-width: 1200px) ==== */
@media (max-width: 1200px) {

  /* Layout constraints */
  :root {
    --container-width: 100%;
    --gutter: 24px;
  }

  .mn-section {
    scroll-margin-top: 80px;
  }

  /* Header & Hamburger Menu */
  .mn-header {
    padding: 20px var(--gutter);
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .mn-nav,
  .mn-header__actions {
    display: none;
  }

  .mn-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000;
  }

  .mn-menu-btn span {
    width: 32px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
  }

  /* Sidebar Overlay */
  .mn-sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    z-index: 1001;
    transition: all 0.3s ease;
  }

  .mn-sidebar-overlay.is-active {
    opacity: 1;
    visibility: visible;
  }

  /* Sliding Sidebar */
  .mn-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 100vw;
    height: 100vh;
    background: var(--color-white);
    z-index: 1002;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
  }

  .mn-sidebar.is-open {
    right: 0;
  }

  .mn-sidebar__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .mn-sidebar__close {
    background: #f4f2e9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-dark);
  }

  .mn-sidebar__content {
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  /* Reset cloned nav/actions for sidebar */
  .mn-sidebar .mn-nav,
  .mn-sidebar .mn-header__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 24px;
  }

  .mn-sidebar .mn-nav__link {
    font-size: 16px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--color-text-dark);
  }

  .mn-sidebar .mn-nav__link::after {
    display: none;
  }

  .mn-sidebar .mn-btn {
    width: 100%;
    justify-content: center;
  }

  body.menu-open {
    overflow: hidden;
  }

  /* Hero */
  .mn-hero {
    margin-top: 70px;
    height: auto;
    min-height: 580px;
    padding-top: 32px;
    padding-bottom: 40px;
  }

  .mn-hero__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.88) 0%,
        rgba(255, 255, 255, 0.78) 50%,
        rgba(255, 255, 255, 0.6) 100%);
    pointer-events: none;
    z-index: 1;
  }

  .mn-hero__content {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    width: 100%;
    max-width: 100%;
  }

  .mn-hero__title {
    width: 100%;
    font-size: clamp(24px, 3.2vw, 38px);
    line-height: 1.25;
  }

  .mn-hero__title-accent {
    width: 100%;
    font-size: clamp(40px, 6vw, 68px);
    line-height: 1.2;
  }

  .mn-hero__text {
    width: 100%;
    font-size: 16px;
    line-height: 1.5;
  }

  /* Grids and Flex Columns */
  .mn-innovation__head,
  .mn-categories__head,
  .mn-science__grid {
    flex-direction: column;
    width: 100%;
    gap: 40px;
    height: auto;
  }

  /* Innovation Cards - Stack vertically with consistent fixed height in all states to prevent jerk */
  .mn-innovation__cards {
    flex-direction: column;
    height: auto;
    gap: 16px;
    padding-left: 0;
    padding-right: 0;
  }

  .mn-innocard {
    flex: none;
    width: 100%;
    height: 250px;
    padding: 20px 16px;
  }

  .mn-ingredient-science .mn-b2b__grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 40px;
    height: auto;
  }

  .mn-ingredient-science .mn-b2b__copy {
    display: contents;
  }

  .mn-ingredient-science .mn-b2b__title {
    order: 1;
    width: 100%;
    max-width: 100%;
  }

  .mn-ingredient-science .mn-b2b__text {
    order: 2;
    width: 100%;
    max-width: 100%;
    margin-top: 0;
    padding-top: 0;
  }

  .mn-ingredient-science .mn-b2b__cards {
    order: 3;
    width: 100%;
    max-width: 100%;
  }

  .mn-ingredient-science .mn-b2b__copy .mn-btn {
    order: 4;
    margin-top: 0;
  }

  /* Specific Sections */
  .mn-innovation__title,
  .mn-innovation__intro,
  .mn-categories__title,
  .mn-categories__intro,
  .mn-b2b__cards,
  .mn-b2b__copy,
  .mn-science__media,
  .mn-science__copy,
  .mn-science__subtitle,
  .mn-science__text,
  .mn-responsibly__hero-inner,
  .mn-responsibly__copy,
  .mn-responsibly__text,
  .mn-about__copy,
  .mn-about__title,
  .mn-about__text,
  .mn-footer__brand {
    width: 100%;
    max-width: 100%;
  }

  .mn-science__title {
    width: 100%;
    text-align: center;
  }

  .mn-science__subtitle {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    font-size: clamp(22px, 5vw, 32px);
    line-height: 1.25;
  }

  .mn-about__title {
    font-size: clamp(26px, 6vw, 44px);
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Media containers */
  .mn-science__media {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16/9;
  }

  .mn-about__grid {
    padding: 0;
    gap: 40px;
    width: 100%;
  }

  .mn-video__frame {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
  }

  .mn-aboutpreview__video {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
  }
}

/* ==== Tablet Portrait & Mobile (max-width: 991px) ==== */
@media (max-width: 991px) {

  /* Layout spacing */
  .mn-section,
  .mn-science,
  .mn-b2b,
  .mn-about,
  .mn-footer__top {
    padding: 48px var(--gutter);
  }

  .mn-footer__bottom {
    margin-top: 0;
    padding: 20px var(--gutter);
  }

  .mn-responsibly__hero {
    height: auto;
    min-height: 400px;
    padding: 48px var(--gutter);
  }

  .mn-responsibly__hero-inner {
    padding: 0;
  }

  /* Typography */
  .mn-heading-2 {
    font-size: clamp(22px, 3.5vw, 32px);
    line-height: 1.2;
  }

  /* Panel horizontal spacing overrides & gap reductions */
  .mn-innovation__head,
  .mn-innovation__cards,
  .mn-categories__head,
  .mn-science__inner {
    padding-left: 0;
    padding-right: 0;
  }

  .mn-innovation__head,
  .mn-categories__head {
    gap: 16px;
  }

  .mn-innovation,
  .mn-categories {
    gap: 28px;
  }

  .mn-article__text,
  .mn-featcol__text {
    width: 100%;
  }

  /* Form */
  .mn-form {
    width: 100%;
    max-width: 100%;
    padding: 32px 24px;
  }

  /* Categories */
  .mn-categories__grid {
    flex-direction: column;
    gap: 25px;
  }

  .mn-article {
    width: 100%;
  }

  .mn-article__media {
    height: 230px;
  }

  .mn-article__heading {
    font-size: clamp(20px, 4vw, 26px);
    line-height: 1.2;
    bottom: 20px;
  }

  /* Innovation Cards */
  .mn-innovation__cards {
    flex-direction: column;
    height: auto;
    gap: 16px;
  }

  .mn-innocard {
    flex: none;
    width: 100%;
    height: 250px;
    padding: 20px 16px;
  }

  /* Stronger white overlay when card is clicked/active or focused */
  .mn-innocard:hover::after,
  .mn-innocard:focus-within::after,
  .mn-innocard.is-active::after {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 255, 255, 0.90) 50%,
        rgba(255, 255, 255, 0.82) 100%);
    opacity: 1;
  }

  .mn-innocard:hover .mn-innocard__desc,
  .mn-innocard:focus-within .mn-innocard__desc,
  .mn-innocard.is-active .mn-innocard__desc {
    max-height: none;
    overflow: visible;
  }

  /* B2B Cards */
  .mn-b2b__cards-row {
    flex-direction: column;
  }

  /* Featcols */
  .mn-featcols {
    height: auto;
  }

  .mn-featcol {
    padding: 24px 0;
    border-right: none;
    border-bottom: 0.8px solid rgba(0, 0, 0, 0.1);
  }

  .mn-featcol__title,
  .mn-featurecard__title {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Featcol */
  .mn-featcol__media {
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
  }
}

/* ==== Small Mobile (max-width: 575px) ==== */
@media (max-width: 575px) {

  /* Spacing */
  .mn-section,
  .mn-science,
  .mn-b2b,
  .mn-about,
  .mn-footer__top {
    padding: 36px var(--gutter);
  }

  .mn-innovation__head,
  .mn-categories__head {
    gap: 12px;
  }

  .mn-innovation,
  .mn-categories {
    gap: 20px;
  }

  /* Hero */
  .mn-hero {
    min-height: 540px;
    padding-top: 24px;
    padding-bottom: 36px;
  }

  .mn-hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .mn-hero__actions .mn-btn {
    width: 100%;
  }

  /* Stats */
  .mn-stats {
    flex-direction: column;
    gap: 16px;
  }

  /* Buttons */
  .mn-b2b__copy .mn-btn,
  .mn-science__cta .mn-btn {
    width: 100%;
    justify-content: space-between;
  }

  /* Forms */
  .mn-form__actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .mn-form__submit {
    width: 100%;
  }

  /* Extra Small Devices (< 370px) */
  @media (max-width: 370px) {
    .mn-innocard {
      height: 260px;
      padding: 16px 12px;
    }

    .mn-innocard__row {
      gap: 10px;
    }

    .mn-innocard__icon {
      width: 40px;
      height: 40px;
    }

    .mn-innocard__title {
      font-size: 19px;
      padding-top: 6px;
    }

    .mn-innocard__desc {
      font-size: 14px;
      line-height: 1.45;
      padding-top: 8px;
    }
  }
}

/* ==== Modal Responsive Overrides & Tablet/Mobile Adjustments (max-width: 768px) ==== */
@media (max-width: 768px) {
  .mn-hero__bg {
    background-image: linear-gradient(270deg, rgba(255, 255, 255, 0) 37.614%, rgba(255, 255, 255, 0.21) 51.854%, rgba(255, 255, 255, 0.704) 63.266%, rgba(255, 255, 255, 0.84) 77.501%, rgba(255, 255, 255, 0.93) 100%), url("../assets/images/hero-bg-m.webp");
  }

  .mn-ingredient-science .mn-b2b__grid {
    gap: 22px;
  }

  .mn-modal {
    padding: 16px;
  }

  .mn-modal__dialog {
    max-height: 92vh;
    border-radius: 16px;
  }

  .mn-modal__header {
    padding: 24px 20px 12px;
  }

  .mn-modal__close {
    top: 14px;
    right: 14px;
  }

  .mn-modal__title {
    font-size: 20px;
  }

  .mn-modal__body {
    padding: 0 20px 24px;
    gap: 14px;
  }

  .mn-modal__stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .mn-modal__stat-number {
    font-size: 20px;
  }

  .mn-modal__dialog--thankyou {
    max-width: 100%;
    border-radius: 18px;
  }

  .mn-modal__body--thankyou {
    padding: 36px 20px 28px;
    gap: 10px;
  }

  .mn-thankyou-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 4px;
  }

  .mn-thankyou-icon svg {
    width: 28px;
    height: 28px;
  }

  .mn-modal__title--thankyou {
    font-size: 22px;
  }

  .mn-modal__text--thankyou {
    font-size: 14px;
  }

  .mn-btn--thankyou-close {
    width: 100%;
  }
}