/* 7S Sourcing v1.7 responsive layer.
   Desktop declarations are intentionally untouched; all layout overrides live
   inside tablet/mobile media queries. */

.rs-menu-toggle {
  display: none;
}

@media (max-width: 1100px) {
  .rs-page,
  .rs-page * {
    box-sizing: border-box;
  }

  .rs-header {
    padding: 14px 24px !important;
  }

  .rs-header-logo img {
    width: 180px !important;
  }

  .rs-header-menu {
    gap: 16px !important;
    margin-left: 18px !important;
  }

  .rs-nav {
    gap: 14px !important;
    font-size: 13.5px !important;
  }

  .rs-header-menu .btn {
    padding: 10px 12px !important;
  }

  .rs-section,
  .rs-footer {
    padding-left: 32px !important;
    padding-right: 32px !important;
  }

  .rs-grid-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  /* QA v1.9-fix1: .rs-grid-5 is only ever used by 10-item lists. repeat(3)
     orphans item 10 alone on a new row at 901-1100px (10 does not divide
     evenly by 3). 10 divides evenly by 2, and 2 columns is already the
     verified-clean layout this class uses at <=900px, so it is applied
     one breakpoint earlier here instead of introducing a new arrangement. */
  .rs-grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .rs-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .rs-footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  /* QA v1.9-fix2: switched from CSS grid to a wrapping flex row so a
     partial last row (Method's 7-step timeline never divides evenly by
     2 or 3) is centered instead of left-orphaned with empty cells beside
     it. Contact's 4-step timeline continues to render identically to
     before (2 full, balanced rows of 2 at <=900px; 3+1 centered, not
     orphaned, at 901-1100px). */
  .rs-timeline {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 28px 18px !important;
  }

  .rs-timeline > * {
    flex: 0 0 calc((100% - 36px) / 3);
    min-width: 0;
  }

  .rs-timeline [style*="border-top:2px dotted"],
  .rs-timeline [style*="border-top: 2px dotted"] {
    display: none !important;
  }

  .rs-page img,
  .rs-page image-slot {
    max-width: 100%;
  }

  /* QA v1.9-fix3: this container keeps its fixed 100px desktop height
     (tuned for the 6-column grid) all the way down to 767px, where a
     mobile-only fix used to take over. In between, the grid is already
     down to 3 or 2 columns (wider cells) while the height stays fixed,
     so object-fit:cover shows a tiny, badly-cropped sliver of each photo.
     Extending the same proven mobile fix to the full <=1100px tablet
     range removes that gap. */
  .rs-jute-bag-collection-media {
    height: auto !important;
    min-height: 210px;
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 1100px) {
  /* QA v1.9: four-detail bands become 2 x 2 at both approved tablet
     viewports. The original desktop flex layout remains above 1100px. */
  .rs-home-textiles-feature-grid,
  .rs-lifestyle-feature-grid,
  .rs-sustainable-feature-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0 !important;
    width: 100%;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }

  .home-customization,
  .lifestyle-customization,
  .sustainable-requirement {
    width: 100%;
    min-width: 0;
    padding: 18px 24px !important;
    border-right: 0 !important;
  }

  .home-customization:nth-child(odd),
  .lifestyle-customization:nth-child(odd),
  .sustainable-requirement:nth-child(odd) {
    border-right: 1px solid #E1D5C1 !important;
  }

  .home-customization:nth-child(-n + 2),
  .lifestyle-customization:nth-child(-n + 2),
  .sustainable-requirement:nth-child(-n + 2) {
    border-bottom: 1px solid #E1D5C1 !important;
  }

  /* QA follow-up (post v1.9): the six-item application strips on Jute Bags,
     Jute Fabrics and Jute Yarns & Twines render as a single no-wrap flex
     row with fixed 26px side padding per item. Below 1100px this overflows
     the viewport horizontally (confirmed: ~490px of content in a 390px
     viewport, scrollable sideways) and silently pushes the 5th/6th items
     out of the visible area. The corresponding page markup now also sets
     flex-wrap:wrap on the row; this contains it to a centered 2-column
     grid. Desktop (>1100px) is untouched. */
  .jute-bag-application,
  .fabric-application,
  .yarn-application {
    flex: 0 0 50% !important;
    max-width: 50%;
    box-sizing: border-box;
    padding: 14px 12px !important;
    border-right: 0 !important;
  }
}

@media (max-width: 900px) {
  .rs-header {
    position: relative;
    z-index: 1000;
    flex-wrap: wrap;
    padding: 12px 20px !important;
    background: #FAF5F1 !important;
  }

  .rs-header-logo img {
    width: 156px !important;
  }

  .rs-menu-toggle {
    width: 44px;
    height: 44px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-left: auto;
    border: 1px solid #D9CFC0;
    border-radius: 6px;
    background: #fff;
    color: #0B3D2A;
    cursor: pointer;
  }

  .rs-menu-toggle span {
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .rs-menu-open .rs-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .rs-menu-open .rs-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .rs-menu-open .rs-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .rs-menu-toggle:focus-visible {
    outline: 3px solid rgba(169, 116, 52, 0.35);
    outline-offset: 3px;
  }

  .rs-header-menu {
    position: absolute;
    top: calc(100% - 2px);
    left: 16px;
    right: 16px;
    width: auto;
    display: flex !important;
    flex-direction: column;
    align-items: stretch !important;
    gap: 14px !important;
    margin: 0 !important;
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: 0 16px 30px rgba(11, 20, 16, 0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: max-height 220ms ease, padding 220ms ease, opacity 180ms ease, transform 180ms ease;
  }

  .rs-menu-open .rs-header-menu {
    max-height: 420px;
    padding-top: 18px;
    padding-bottom: 18px;
    border-color: #EDE6DC;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .rs-nav {
    width: 100%;
    display: flex !important;
    flex-direction: column;
    align-items: stretch !important;
    gap: 0 !important;
    font-size: 15px !important;
  }

  .rs-nav a {
    display: block !important;
    padding: 12px 2px !important;
    border-bottom: 1px solid #EDE6DC !important;
  }

  .rs-header-menu > div {
    width: 100%;
  }

  .rs-header-menu .btn {
    width: 100%;
    display: flex !important;
    justify-content: center;
    padding: 13px 16px !important;
  }

  .rs-section,
  .rs-footer {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  .rs-hero {
    padding-top: 32px !important;
    padding-bottom: 42px !important;
  }

  .rs-hero-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 28px !important;
  }

  .rs-hero-content {
    order: 1;
    position: relative !important;
    width: 100% !important;
    max-width: 680px;
    gap: 16px !important;
  }

  .rs-hero-content h1 {
    font-size: 34px !important;
  }

  .rs-hero-content [style*="display:flex"][style*="gap:14px"],
  .rs-hero-content [style*="display: flex"][style*="gap: 14px"] {
    flex-wrap: wrap !important;
  }

  .rs-hero-media {
    order: 2;
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 10 !important;
    grid-area: auto !important;
    overflow: hidden !important;
    border-radius: 8px;
  }

  image-slot.rs-hero-media,
  .rs-hero-media .rs-hero-slot {
    display: block !important;
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 16 / 10 !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
  }

  .rs-hero-overlay {
    display: none !important;
  }

  .rs-grid-6,
  .rs-grid-5,
  .rs-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .rs-grid-2,
  .rs-grid-split,
  .rs-form-section {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .rs-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .rs-timeline > * {
    flex: 0 0 calc((100% - 18px) / 2) !important;
  }

  .rs-cta-band {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
  }

  .rs-form-section input,
  .rs-form-section select,
  .rs-form-section textarea,
  .rs-form-section button {
    max-width: 100%;
  }

  .rs-footer-grid a,
  .rs-footer-grid div {
    overflow-wrap: anywhere;
  }

  /* QA v1.9-fix4: was hidden only <=767px, but the CTA row it sits in
     already wraps onto two lines from 768px up to ~890px (confirmed),
     leaving the divider orphaned next to nothing until the row fits on
     one line again at 900px. Hiding it through the same <=900px
     breakpoint the row-wrap fix already lives in removes the gap. */
  .rs-categories-cta-divider {
    display: none !important;
  }
}

@media (max-width: 767px) {
  /* QA v1.9: the same bands become one contained column on mobile. */
  .rs-home-textiles-feature-grid,
  .rs-lifestyle-feature-grid,
  .rs-sustainable-feature-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .home-customization,
  .lifestyle-customization,
  .sustainable-requirement,
  .home-customization:nth-child(odd),
  .lifestyle-customization:nth-child(odd),
  .sustainable-requirement:nth-child(odd) {
    border-right: 0 !important;
    border-bottom: 1px solid #E1D5C1 !important;
    padding: 18px 12px !important;
  }

  .home-customization:last-child,
  .lifestyle-customization:last-child,
  .sustainable-requirement:last-child {
    border-bottom: 0 !important;
  }

  .rs-home-textiles-cta-actions {
    width: 100%;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .rs-home-textiles-cta-actions > a {
    width: 100% !important;
    justify-content: center !important;
    white-space: normal !important;
    text-align: center;
  }

  .rs-home-textiles-cta-actions > div {
    text-align: center;
  }

  .rs-home-textiles-cta-break {
    display: none;
  }
}

@media (max-width: 640px) {

  .rs-header {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .rs-header-logo img {
    width: 142px !important;
  }

  .rs-header-menu {
    left: 12px;
    right: 12px;
  }

  .rs-section,
  .rs-footer {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .rs-hero {
    padding-top: 24px !important;
    padding-bottom: 36px !important;
  }

  .rs-hero-content h1 {
    font-size: 30px !important;
    line-height: 1.18 !important;
  }

  .rs-hero-content p {
    font-size: 15px !important;
  }

  .rs-hero-media,
  image-slot.rs-hero-media,
  .rs-hero-media .rs-hero-slot {
    aspect-ratio: 4 / 3 !important;
  }

  .rs-hero-content .btn,
  .rs-cta-band .btn,
  .rs-form-section button[type="submit"] {
    width: 100% !important;
    justify-content: center !important;
    white-space: normal !important;
    text-align: center;
  }

  .rs-grid-6,
  .rs-grid-5,
  .rs-grid-4,
  .rs-grid-3,
  .rs-grid-2,
  .rs-grid-split,
  .rs-form-grid,
  .rs-footer-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .rs-timeline > * {
    flex: 0 0 100% !important;
  }

  .rs-cta-band {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 20px !important;
  }

  .rs-form-section input:not([type="checkbox"]):not([type="radio"]),
  .rs-form-section select,
  .rs-form-section textarea {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 16px !important;
  }

  .rs-privacy-ack {
    width: 100%;
    min-width: 0;
  }

  .rs-privacy-ack input[type="checkbox"] {
    width: 16px !important;
    min-width: 16px !important;
    max-width: 16px !important;
  }

  .rs-privacy-ack label {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .rs-form-submit-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .rs-form-submit-row > div {
    justify-content: center;
    text-align: center;
  }

  .rs-file-summary {
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
  }

  .rs-file-summary a,
  .rs-file-summary button {
    margin-left: 34px;
  }

  .rs-footer-grid {
    gap: 30px !important;
  }

  .rs-footer-grid > div:first-child img {
    width: 176px !important;
  }

  h2 {
    font-size: 28px !important;
    line-height: 1.2 !important;
  }
}

@media (max-width: 420px) {
  .rs-header-logo img {
    width: 132px !important;
  }

  .rs-menu-toggle {
    width: 42px;
    height: 42px;
  }

  .rs-hero-content h1 {
    font-size: 28px !important;
  }

  .rs-section,
  .rs-footer {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rs-menu-toggle span,
  .rs-header-menu {
    transition: none !important;
  }
}
