/* ==========================================================================
   Ruhi Wholesale — responsive-fixes.css
   Loaded LAST on every page (after luxury.css / inline-extracted.css).
   Structural only: layout, colour contrast, sizing. No text, meta, schema
   or tracking code is touched by this file.
   ========================================================================== */
:root{
  --rf-header-bg:rgba(245,241,232,.96);
  --rf-hair:rgba(22,18,15,.14);
  --rf-pad-x:clamp(16px,4vw,32px);   /* 16px phones -> 32px desktop (px-4 -> px-8) */
  --rf-on-dark-head:#F8F5EE;          /* 15.99:1 on #081a33 */
  --rf-on-dark-body:#E5E7EB;          /* 14.07:1 on #081a33 */
}
html,body{margin:0;max-width:100%}

/* ---------- ISSUE 2a · Navbar: full-bleed bar, no white side strips ----------
   Root cause: luxury.css paints the INNER .wrap.nav cream while header.top /
   header.topbar stayed white, so on wide screens white strips showed either side. */
html body header.top,
html body header.topbar{
  width:100%;max-width:none;margin:0;box-sizing:border-box;
  background:var(--rf-header-bg)!important;
  border-bottom:1px solid var(--rf-hair)!important;
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
}
html body header.top>.nav,
html body header.topbar>.nav{
  background:transparent!important;border:0!important;box-shadow:none!important;
  -webkit-backdrop-filter:none!important;backdrop-filter:none!important;
  width:100%;max-width:1240px;margin-inline:auto;box-sizing:border-box;
  height:auto;min-height:64px;padding-block:.5rem;padding-inline:var(--rf-pad-x);
}
html body header.nav{width:100%;max-width:none;margin:0}
html body header.nav>.navin{
  width:100%;max-width:1240px;margin-inline:auto;box-sizing:border-box;
  padding-block:.5rem;padding-inline:var(--rf-pad-x);
}

/* ---------- ISSUE 2b · Logo never clipped ---------- */
html body header .brand{
  display:inline-flex;align-items:center;gap:10px;min-width:0;
  overflow:visible;line-height:1;
}
html body header[class] .brand img.site-logo{
  display:block;flex:0 0 auto;
  height:clamp(34px,10vw,44px)!important;   /* shrinks smoothly on small phones */
  width:auto!important;
  max-height:48px!important;
  max-width:min(160px,40vw)!important;
  object-fit:contain!important;object-position:center;
}

/* ---------- ISSUE 3 · Readable text on dark hero sections ----------
   Root cause: luxury.css forces h1/h2/h3 to near-black (#16120F) with !important
   (1.07:1 on the navy hero) and p to grey (#6F675C, 2.9:1). */
html body>section.hero:not(.wrap) h1,html body>section.hero:not(.wrap) h2,html body>section.hero:not(.wrap) h3,
html body main:not(.wrap)>section.hero:not(.wrap) h1,html body main:not(.wrap)>section.hero:not(.wrap) h2,html body main:not(.wrap)>section.hero:not(.wrap) h3,
html body section.hero-grid h1,
html body section.hero-grid h2,
html body section.hero-grid h3{color:var(--rf-on-dark-head)!important}
html body section.hero-grid h1 .text-gold{color:#caa64b!important}   /* keep the gold accent line */
html body>section.hero:not(.wrap) p,html body>section.hero:not(.wrap) li,
html body main:not(.wrap)>section.hero:not(.wrap) p,html body main:not(.wrap)>section.hero:not(.wrap) li,
html body section.hero-grid p:not(.text-gold):not(.ruhi-eyebrow){color:var(--rf-on-dark-body)!important}
/* NB: the light heroes (category pages, imported-tensils: <main class="wrap">) are deliberately excluded. */

/* ---------- ISSUE 4 · Mobile / tablet ---------- */
img,video,svg,canvas,iframe{max-width:100%}
h1,h2,h3,p,li,a,td,th{overflow-wrap:break-word}

/* hamburger button: hidden unless the page JS is present and the screen is narrow */
.nav-toggle{display:none;align-items:center;justify-content:center;flex:0 0 auto;
  width:44px;height:44px;min-height:44px;padding:0;margin:0;
  background:transparent;border:1px solid var(--rf-hair);border-radius:0;
  color:var(--ink,#16120F);cursor:pointer;-webkit-tap-highlight-color:transparent}
.nav-toggle:focus-visible{outline:3px solid #2563eb;outline-offset:2px}
.nav-toggle .ico-close{display:none}
.nav-toggle[aria-expanded="true"] .ico-open{display:none}
.nav-toggle[aria-expanded="true"] .ico-close{display:inline}

@media (max-width:767.98px){
  /* header row: logo left, toggle right, links drop below */
  html body header.top>.nav,
  html body header.topbar>.nav{
    flex-direction:row!important;flex-wrap:wrap;align-items:center!important;
    justify-content:space-between;gap:0 12px;
  }
  html.js-nav .nav-toggle{display:inline-flex}
  html.js-nav header .nav .navlinks{
    display:none;flex:0 0 100%;width:100%;order:3;
    flex-direction:column;align-items:stretch;gap:0;
    margin-top:.5rem;border-top:1px solid var(--rf-hair);
    max-height:calc(100vh - 88px);overflow-y:auto;-webkit-overflow-scrolling:touch;
  }
  html.js-nav header .nav.is-open .navlinks{display:flex}
  html.js-nav header .nav .navlinks a{
    display:flex;align-items:center;width:100%;min-height:48px;
    padding:.75rem .25rem!important;border-bottom:1px solid var(--rf-hair);
    border-radius:0;white-space:normal;
  }
  html.js-nav header .nav .navlinks a:last-child{border-bottom:0}
  /* without JS the links simply wrap under the logo (no hidden navigation) */
  html:not(.js-nav) header .nav .navlinks{flex:0 0 100%;width:100%;order:3;justify-content:flex-start}

  /* compact header on the product / category / checkout pages */
  html body header.nav>.navin{gap:8px;min-height:60px}
  html body header.nav>.navin>div{min-width:0;gap:6px}
  html body header.nav .btn{padding:.6rem .7rem!important;font-size:.6rem;letter-spacing:.12em!important;white-space:nowrap}

  /* headings scale down (desktop sizes are untouched at >=768px) */
  /* "html body" prefix beats the inline `body h1{font-size:2.35rem!important}` on index.html */
  html body h1,html body .h1-like{font-size:clamp(1.75rem,8vw,2.25rem)!important;line-height:1.12!important}
  html body h2{font-size:clamp(1.5rem,6.2vw,1.875rem)!important;line-height:1.15!important}
  html body h3{font-size:clamp(1.15rem,4.8vw,1.4rem)!important}

  /* section rhythm: 16px side gutters, tighter vertical padding */
  .wrap,.ruhi-semantic-footer{padding-left:16px;padding-right:16px}
  body>section.hero:not(.wrap),main:not(.wrap)>section.hero:not(.wrap){padding-block:2rem}
  section.content{padding-block:1.75rem 2.5rem}
  section[class*="py-14"],section[class*="py-12"]{padding-block:2.5rem}
  section>div[class*="py-14"],section>div[class*="py-12"]{padding-block:2.5rem}
}

/* tablet: keep a comfortable gutter */
@media (min-width:768px) and (max-width:1023.98px){
  .wrap{padding-inline:var(--rf-pad-x)}
  h1{font-size:clamp(2.4rem,5.6vw,3.2rem)!important}
}

/* desktop rhythm for the plain static pages (py-16 / px-8 equivalent) */
@media (min-width:1024px){
  body>section.hero:not(.wrap),main:not(.wrap)>section.hero:not(.wrap){padding-block:4rem}
  section.content{padding-block:4rem 4.5rem}
  .wrap{padding-inline:var(--rf-pad-x)}
}

/* ==========================================================================
   MOBILE SAFETY NET (appended) — mobile-first, never hides content.
   Every rule below sits inside @media (max-width:767.98px), so the desktop /
   laptop layout and styles are unchanged by construction.
   ========================================================================== */
@media (max-width:767.98px){
  /* 0. No sideways scroll on phones. "clip" on body (not "hidden") keeps the
        sticky header working; html:hidden is the fallback for older iOS Safari. */
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%;overflow-x:hidden}
  body{overflow-x:clip}

  /* 1. Content is visible from the first paint on phones. The scroll-reveal
        fade (.ruhi-reveal) starts at opacity:0 and waits for JavaScript; on a
        slow phone, or if that script is blocked, every section stayed blank. */
  .ruhi-reveal,
  .ruhi-reveal:not(.is-in){opacity:1!important;transform:none!important;transition:none!important}

  /* 2. Grid / flex children may shrink instead of pushing the page wider. */
  #productGrid>*,.product-grid>*,.product-card,.catcard,.product{min-width:0;max-width:100%}
  .product-card *{min-width:0}

  /* 3. Long code strings and embedded media can never create sideways scroll. */
  pre,code{white-space:pre-wrap;overflow-wrap:anywhere}
  video,iframe,canvas{max-width:100%}
}
