/* ==========================================================================
   SAI INTERNATIONAL EXIM — Responsive overrides
   Breakpoints: 1199 / 991 (navigation collapses) / 767 / 575 / 374
   ========================================================================== */

/* ---------- ≤ 1499px: keep footer links clear of the floating WhatsApp pill ----------
   (127px wide at right: 20px; wider viewports leave enough margin beside the container.
   Phones stack the bar and reserve space below it instead — see ≤ 767px.) */
@media (max-width: 1499px) {
  .footer-bottom__inner {
    padding-right: 150px;
  }
}

/* ---------- ≤ 1199px ---------- */
@media (max-width: 1199px) {
  :root {
    --section-y: 70px;
  }

  .header-info__item--email {
    display: none;
  }

  .nav__link {
    padding: 0 18px;
  }

  .nav-cta {
    flex-basis: 240px;
    font-size: 1.0625rem;
  }

  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .step:not(:last-child)::after {
    display: none;
  }

  .gallery-grid {
    --row: 220px;
  }

  .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* Three columns: the "Other products" card becomes a regular card so every row stays full */
  .p-card--wide {
    grid-column: auto;
    flex-direction: column;
  }

  .p-card--wide .p-card__media {
    flex: none;
  }

  .p-card--wide .p-card__media img {
    position: static;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .approach__grid {
    gap: 50px;
  }

  .story__grid {
    gap: 70px;
  }

  /* Tablet: the brand pillar becomes a full-width ivory band near the top of the footer
     (logo | name, statement and description | social icons) between two gold hairlines;
     the three link/contact columns follow. The band (and its gold hairline) reaches the
     screen edges through a border-image outset, which paints outside the box without
     adding horizontal scrolling. */
  .footer-grid {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 0.8fr) minmax(0, 1.4fr);
    gap: 48px 36px;
  }

  .footer-brand {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "logo text social"
      "logo about social";
    align-items: center;
    gap: 6px 40px;
    margin: calc(12px - var(--footer-pad-top)) 0 0; /* a 12px forest-green band stays above it */
    padding: 34px 0 32px;
    background: none;
    border-image: linear-gradient(var(--gold) 1px, var(--footer-ivory) 1px, var(--footer-ivory) calc(100% - 1px), var(--gold) calc(100% - 1px)) fill 0 / 0 / 0 100vmax;
    text-align: left;
  }

  .footer-brand::before {
    display: none;
  }

  .footer-brand__lockup {
    display: contents;
  }

  .footer-brand__logo {
    grid-area: logo;
    width: 150px;
  }

  .footer-brand__text {
    grid-area: text;
    align-self: end;
    margin: 0;
    padding: 0;
  }

  .footer-brand__text::before,
  .footer-brand__text::after {
    display: none;
  }

  .footer-brandline {
    max-width: none;
    margin: 0;
  }

  .footer-brand__about {
    grid-area: about;
    align-self: start;
    max-width: 56ch;
  }

  .footer-brand .social--footer {
    grid-area: social;
    margin-top: 0;
  }

  .about-media .about-media__secondary {
    right: 0;
  }
}

/* ---------- ≤ 991px: mobile header & menu ---------- */
@media (max-width: 991px) {
  :root {
    --header-main-h: 76px;
    --section-y: 64px;
  }

  html {
    scroll-padding-top: 90px;
  }

  .topbar {
    display: none;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
  }

  .header-main__inner {
    min-height: var(--header-main-h);
    padding-bottom: 0;
  }

  .logo img {
    height: 60px;
  }

  .header-info {
    display: none;
  }

  /* Room for the compact language control between the logo and the menu button */
  .header-main__inner {
    position: relative;
    gap: 10px;
  }

  .translate--compact {
    display: block;
    position: static;
    margin-left: auto;
  }

  .translate--compact .translate__toggle {
    gap: 6px;
    height: 44px;
    padding: 0 10px;
    border: 1px dashed #cfcfcf;
    color: var(--heading);
    font-family: var(--font-heading);
    font-size: 0.8125rem;
    font-weight: 600;
  }

  .translate--compact .translate__toggle .icon {
    color: var(--green-dark);
    font-size: 1.1rem;
  }

  .translate--compact .translate__toggle:hover,
  .translate--compact .translate__toggle[aria-expanded="true"] {
    border-color: var(--green-bright);
    color: var(--heading);
  }

  .translate--compact .translate__chev {
    display: none;
  }

  /* The list lines up with the header's content edge and stays on screen. */
  .translate--compact .translate__panel {
    right: var(--gutter);
    width: min(340px, calc(100% - 2 * var(--gutter)));
  }

  .translate--compact .translate__panel:not([hidden]) {
    max-height: calc(100vh - var(--header-main-h) - 16px);
    max-height: calc(100dvh - var(--header-main-h) - 16px);
  }

  .translate__list button {
    min-height: 44px;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-right: -6px;
    padding: 0;
    border: 1px dashed transparent;
    background: none;
    color: var(--heading);
  }

  .menu-toggle:hover {
    border-color: var(--border);
  }

  .menu-toggle__bars {
    position: relative;
    display: grid;
    gap: 6px;
    width: 28px;
  }

  .menu-toggle__bars span {
    display: block;
    height: 2px;
    background: currentColor;
    transition: transform var(--t-base) var(--ease), opacity var(--t-fast) var(--ease);
  }

  .menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* The nav bar becomes a drop-down panel under the header */
  .navbar-wrap {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    height: auto;
    max-height: calc(100vh - var(--header-main-h));
    max-height: calc(100dvh - var(--header-main-h));
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--dark);
    background-image: var(--pattern-dark);
    box-shadow: var(--shadow-nav);
  }

  .no-js .navbar-wrap {
    position: static;
    display: block;
    max-height: none;
  }

  .no-js .menu-toggle {
    display: none;
  }

  .navbar-wrap.is-open {
    display: block;
    animation: menu-in 0.3s var(--ease);
  }

  .navbar-wrap.is-fixed .navbar {
    position: static;
    filter: none;
    animation: none;
  }

  .navbar__inner {
    flex-direction: column;
    height: auto;
    gap: 0;
    padding-top: 10px;
    padding-bottom: 26px;
  }

  .nav {
    padding: 0;
    background: transparent;
  }

  .nav__list {
    flex-direction: column;
  }

  .nav__link {
    width: 100%;
    min-height: 54px;
    padding: 0 4px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    font-size: 0.9375rem;
  }

  /* No moving leaf in the drop-down menu; the current item keeps its static leaf */
  .nav__leaf {
    display: none;
  }

  .nav.leaf-ready .nav__link[aria-current="page"] .nav__text::after {
    display: block;
  }

  .nav__link[aria-current="page"] .nav__text::after {
    top: -6px;
    right: -22px;
  }

  .nav-cta {
    flex: none;
    min-height: 56px;
    margin-top: 22px;
    font-size: 1rem;
  }

  .nav-cta .icon {
    font-size: 1.3rem;
  }

  .navbar__mobile-extra {
    display: grid;
    gap: 4px;
    margin-top: 20px;
    list-style: none;
  }

  .navbar__mobile-extra a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    color: #cfcfcf;
    font-size: 0.9375rem;
    overflow-wrap: anywhere;
  }

  .navbar__mobile-extra .icon {
    color: var(--green-bright);
    font-size: 1.15rem;
  }

  .navbar__social {
    margin-top: 12px;
  }

  .navbar__mobile-extra .social--menu .social__link {
    display: inline-grid;
    gap: 0;
    min-height: 0;
    width: 44px;
    height: 44px;
  }

  .navbar__mobile-extra .social--menu .icon {
    color: #cfcfcf;
  }

  /* Hero */
  .hero__slide {
    min-height: 600px;
    padding: 70px 0 110px;
  }

  .hero__controls {
    bottom: 26px;
  }

  /* Grids */
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split,
  .split--wide-left {
    grid-template-columns: minmax(0, 1fr);
    gap: 50px;
  }

  .about-media {
    max-width: 640px;
    margin-bottom: 40px;
  }

  .about-media .about-media__secondary {
    right: 0;
  }

  .approach__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .approach__intro {
    position: static;
    max-width: 640px;
  }

  .story__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 60px;
  }

  .story__media {
    max-width: 480px;
  }

  .principles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 44px;
  }

  .flow::before {
    display: none;
  }

  .band__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 60px;
  }

  .band__col {
    padding: 0;
  }

  .band__col + .band__col {
    padding-top: 60px;
    border-left: 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
  }

  .cta-band--ship::before {
    background: linear-gradient(180deg, rgba(9, 40, 23, 0.9) 0%, rgba(9, 40, 23, 0.84) 100%);
  }

  .cta-band__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .product {
    grid-template-columns: minmax(0, 1fr);
  }

  .pgallery__stage {
    flex: none;
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .contact-layout {
    grid-template-columns: minmax(0, 1fr);
  }


  .gallery-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-banner {
    padding: 70px 0 64px;
  }
}

/* ---------- ≤ 767px ---------- */
@media (max-width: 767px) {
  :root {
    --section-y: 56px;
  }

  body {
    font-size: 0.96875rem;
  }

  .sec-title {
    margin-bottom: 40px;
  }

  .sec-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    margin-bottom: 36px;
  }

  .hero__slide {
    min-height: min(640px, calc(100svh - var(--header-main-h)));
    padding: 56px 0 104px;
  }

  .hero__media img {
    object-position: var(--pos-mobile, 50% 50%);
  }

  .hero__media::after {
    background: linear-gradient(180deg, rgba(9, 20, 14, 0.62) 0%, rgba(9, 20, 14, 0.66) 100%);
  }

  .hero__eyebrow {
    margin-bottom: 14px;
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
  }

  .hero__title {
    margin-bottom: 16px;
  }

  .hero__text {
    margin-bottom: 28px;
    font-size: 1rem;
    line-height: 1.65;
  }

  .hero__actions {
    gap: 12px;
  }

  .hero .btn {
    min-height: 50px;
    padding: 0 24px;
  }

  .grid--2,
  .mv-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .p-card--featured {
    grid-row: auto;
  }

  /* Two columns: the "Other products" card spans both columns again as a horizontal card */
  .p-card--wide {
    grid-column: span 2;
    flex-direction: row;
  }

  .p-card--wide .p-card__media {
    flex: 0 0 46%;
  }

  .p-card--wide .p-card__media img {
    position: absolute;
    height: 100%;
    aspect-ratio: auto;
  }

  .p-card--featured .p-card__media {
    flex: none;
    min-height: 0;
  }

  .p-card--featured .p-card__media img {
    aspect-ratio: 16 / 10;
  }

  .info-boxes {
    grid-template-columns: minmax(0, 1fr);
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid {
    --row: 170px;
    gap: 26px 12px;
  }

  .g-item__title {
    font-size: 0.9375rem;
  }

  .g-item__cat {
    font-size: 0.8125rem;
  }

  .product__body {
    padding: 30px 24px;
  }

  .specs {
    grid-template-columns: minmax(0, 1fr);
  }

  .specs dt {
    padding-bottom: 2px;
    border-bottom: 0;
  }

  .specs dd {
    padding-top: 0;
    padding-left: 22px;
  }

  .enquiry-prompt {
    grid-template-columns: minmax(0, 1fr);
    padding: 30px 24px;
  }

  .form-box {
    padding: 32px 22px;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .mv-card {
    padding: 38px 28px 36px;
  }

  .mv-card::before {
    left: 28px;
  }

  .mv-card:hover::before {
    width: calc(100% - 56px);
  }

  .story__facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .lightbox__stage {
    padding: 0 12px;
  }

  .lightbox__nav {
    top: auto;
    bottom: -64px;
    transform: none;
  }

  .lightbox__nav--prev {
    left: 12px;
  }

  .lightbox__nav--next {
    right: 12px;
  }

  .lightbox__caption {
    padding: 16px 80px 24px;
  }

  .lightbox__img {
    max-height: calc(100vh - 220px);
    max-height: calc(100svh - 220px);
  }

  .site-footer {
    --footer-pad-top: 60px;
    --footer-pad-bottom: 44px;
  }

  .footer-brand {
    column-gap: 28px;
  }

  .footer-brand__logo {
    width: 128px;
  }

  .float-wa {
    right: 16px;
    height: 44px;
    padding: 0 18px;
    font-size: 0.875rem;
  }

  .to-top {
    right: 16px;
    bottom: calc(var(--float-offset) + 56px);
    width: 44px;
    height: 44px;
  }

  .page-banner {
    padding: 56px 0 52px;
    background-image: url("../assets/images/backgrounds/banner-onions-960.webp");
  }

  .page-banner p {
    font-size: 1rem;
  }
}

/* ---------- ≤ 575px ---------- */
@media (max-width: 575px) {
  :root {
    --gutter: 16px;
  }

  .grid--4,
  .grid--3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .products-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .p-card--featured,
  .p-card--wide {
    grid-column: auto;
  }

  .p-card--wide {
    flex-direction: column;
  }

  .p-card--wide .p-card__media {
    flex: none;
  }

  .p-card--wide .p-card__media img {
    position: static;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .p-card--featured .p-card__body {
    padding: 24px 22px 26px;
  }

  .p-card--featured .p-card__title {
    font-size: 1.5rem;
  }

  .p-card__facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .approach__list {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Vertical timeline on phones */
  .flow {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 16px;
  }

  .flow::before {
    display: block;
    top: 22px;
    bottom: 22px;
    left: 21px;
    right: auto;
    border-top: 0;
    border-left: 1px dashed var(--green-bright);
  }

  .flow__item {
    flex-direction: row;
    gap: 16px;
    text-align: left;
  }

  .flow__num {
    flex: 0 0 44px;
    margin: 0;
  }

  .flow__icon {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    margin: 0;
    font-size: 1.4rem;
  }

  .flow__item h3 {
    max-width: none;
  }

  .principle {
    padding: 30px 26px;
  }

  .story__media::after {
    right: -14px;
  }

  .steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .principles {
    grid-template-columns: minmax(0, 1fr);
  }


  /* Phones: brand and contact full width; Quick Links and Products side by side */
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 20px;
  }

  /* Phones: the ivory band stacks and centres its content, as on the desktop pillar */
  .footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 0 32px;
    text-align: center;
  }

  .footer-brand__logo {
    width: 150px;
  }

  .footer-brand__text,
  .footer-brand__about {
    align-self: auto;
  }

  .footer-brand__text {
    margin-top: 18px;
    padding-top: 18px;
  }

  .footer-brand__text::before,
  .footer-brand__text::after {
    display: block;
  }

  .footer-brandline {
    max-width: 30ch;
    margin: 0 auto;
  }

  .footer-brand__about {
    max-width: 36ch;
    margin: 12px 0 0;
  }

  .footer-brand .social--footer {
    margin-top: 18px;
  }

  .footer-grid > .footer-col:last-child {
    grid-column: 1 / -1;
  }

  .footer-bottom__inner {
    flex-direction: column;
    align-items: flex-start;
    padding-right: var(--gutter);
    padding-bottom: 84px;
  }

  /* keep the bar links clear of the back-to-top button (44px wide, 16px from the edge) */
  .footer-bottom ul {
    padding-right: 56px;
  }

  .btn-row .btn {
    flex: 1 1 auto;
  }

  .hero__actions .btn {
    flex: 0 1 auto;
    min-width: 0;
  }

  .logistics-strip {
    margin-bottom: 44px;
  }

  .logistics-strip img {
    aspect-ratio: 4 / 3;
  }

  .cta-band .btn-row {
    width: 100%;
    flex-direction: column;
  }

  .about-media .about-media__secondary {
    width: 55%;
    bottom: -30px;
    border-width: 5px;
  }

  .chip {
    padding: 8px 14px;
    font-size: 0.875rem;
  }

  .gallery-grid {
    --row: 185px;
  }

  .filter-bar .tab,
  .tabs .tab {
    padding: 6px 12px;
    font-size: 0.875rem;
  }

  .enquiry-prompt__icon {
    width: 70px;
    height: 70px;
    font-size: 1.7rem;
  }

  .form-actions .btn {
    width: 100%;
    max-width: calc(100% - 72px);
  }
}

/* ---------- ≤ 374px (small phones) ---------- */
@media (max-width: 374px) {
  .logo img {
    height: 56px;
  }

  .hero__title {
    font-size: 1.5rem;
  }

  .hero__text {
    font-size: 0.9375rem;
  }

  .gallery-grid {
    --row: 150px;
  }

}

/* ---------- Short landscape screens ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .hero__slide {
    min-height: 0;
    padding: 40px 0 96px;
  }

  .navbar-wrap {
    max-height: calc(100vh - var(--header-main-h));
  }
}

/* ---------- Parallax only on larger, non-touch screens ---------- */
@media (min-width: 992px) and (hover: hover) {
  .band--markets {
    background-image: url("../assets/images/backgrounds/bg-port-sunset.webp");
    background-attachment: fixed;
  }

  .band--about {
    background-attachment: fixed;
  }
}

/* ---------- Print ---------- */
@media print {
  .topbar,
  .navbar-wrap,
  .hero__controls,
  .float-wa,
  .to-top,
  .cta-band,
  .menu-toggle {
    display: none !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
