/* RouxLub · layout — container, header, footer, grids */

.rx-container { width: 100%; max-width: var(--rx-container); margin-inline: auto; padding-inline: var(--rx-gutter); }
.rx-section { padding-block: var(--rx-space-6); }
.rx-main { min-height: 50vh; }

/* ---- Header (fixed; transparent over the hero, navy elsewhere/on scroll) ---- */
/* Fixed overlay header → push body content down by default (interior pages). */
body { padding-top: var(--rx-header-h); }
/* Home: hero image STARTS where the header ends (traced from roux.com.mx). The header
   stays a fixed overlay (its glass shows the image through it on scroll — intended);
   the hero's own overflow:hidden clips the parallax bleed flush to the header edge. */
body.home { padding-top: var(--rx-header-h); }

.rx-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  /* white glass reskin — light header (graded white, not pure), red rule kept for brand. */
  background-color: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 3px solid var(--rx-red);
  box-shadow: 0 1px 0 rgba(0, 33, 95, .06);
  transition: background-color .3s var(--rx-ease), border-color .3s var(--rx-ease), box-shadow .3s var(--rx-ease), backdrop-filter .3s var(--rx-ease);
}
/* Interior pages: stays light; scroll only adds a soft shadow. */
.rx-header.is-scrolled { box-shadow: 0 6px 24px rgba(0, 33, 95, .12); }
/* Home: light glass, slightly more opaque on scroll for legibility over the hero. */
.home .rx-header { background-color: rgba(255, 255, 255, .82); }
.home .rx-header.is-scrolled {
  background-color: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 6px 20px rgba(0, 33, 95, .1);
}
.rx-header__inner {
  max-width: var(--rx-container); margin-inline: auto; padding-inline: var(--rx-gutter);
  height: var(--rx-header-h);
  display: flex; align-items: center; gap: var(--rx-space-4);
}
.rx-header__brand { margin-right: auto; display: inline-flex; align-items: center; flex-shrink: 0; }
.rx-header__logo { height: 56px; width: auto; display: block; } /* size by height only → never cropped */

/* Primary nav — items span the full header height so hover stays continuous into the mega */
.rx-nav { align-self: stretch; display: flex; align-items: stretch; }
.rx-nav__list { display: flex; align-items: stretch; height: 100%; gap: clamp(1.1rem, 2.4vw, 2.4rem); list-style: none; padding: 0; margin: 0; }
.rx-nav__item { position: relative; display: flex; align-items: center; }
.rx-nav__link {
  display: inline-flex; align-items: center; gap: .25rem;
  font-family: var(--rx-font-head); font-weight: var(--rx-fw-bold); font-size: 1.02rem;
  letter-spacing: .03em; text-transform: uppercase; color: var(--rx-navy);
  padding: .4rem 0; transition: color .2s var(--rx-ease);
}
.rx-nav__link:hover, .rx-nav__item:hover > .rx-nav__link, .rx-nav__item:focus-within > .rx-nav__link { color: var(--rx-red); }
.rx-nav__caret { transition: transform .2s var(--rx-ease); }
.rx-has-sub:hover .rx-nav__caret, .rx-has-sub:focus-within .rx-nav__caret { transform: rotate(180deg); }

/* Home icon item */
.rx-nav__home { display: inline-flex; flex-direction: column; align-items: center; color: var(--rx-navy); padding: .2rem 0; }
.rx-nav__home:hover { color: var(--rx-red); }
.rx-nav__home-underline { display: block; width: 22px; height: 2px; background: currentColor; margin-top: 3px; opacity: 0; transition: opacity .2s var(--rx-ease); }
.rx-nav__item.is-current .rx-nav__home-underline,
.rx-nav__home:hover .rx-nav__home-underline { opacity: 1; }

/* Productos mega-menu (full panel, traced from roux.com.mx) */
.rx-mega {
  position: fixed; top: var(--rx-header-h); left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: min(1320px, 95vw);
  max-height: calc(100vh - var(--rx-header-h) - 20px); overflow-y: auto;
  border-radius: 22px;
  background-color: #ffffff;
  border: 1px solid var(--rx-border);
  box-shadow: 0 30px 70px rgba(0, 33, 95, .22);
  opacity: 0; visibility: hidden; pointer-events: none; z-index: 210;
  transition: opacity .2s var(--rx-ease), transform .2s var(--rx-ease);
}
/* Invisible bridge: keeps :hover alive across the gap between the trigger and the panel. */
.rx-mega::before {
  content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px;
}
.rx-has-mega:hover .rx-mega, .rx-has-mega:focus-within .rx-mega {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.rx-mega__inner { padding: clamp(1rem, 2vw, 1.8rem); }
.rx-mega__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: #eef2f7; border-radius: 999px; padding: .5rem 2rem; margin-bottom: 1.4rem;
}
.rx-mega__heading { font-family: var(--rx-font-head); font-weight: var(--rx-fw-bold); font-size: 1.25rem; letter-spacing: .05em; text-transform: uppercase; color: var(--rx-navy); }
.rx-mega__logo { height: 38px; width: auto; }
.rx-mega__cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 2.5vw, 2.6rem); align-items: start; }
.rx-mega__group { margin-bottom: 1.3rem; }
.rx-mega__title {
  display: block; text-align: center; background: #eef2f7; color: var(--rx-navy);
  font-family: var(--rx-font-head); font-weight: var(--rx-fw-bold); font-size: 1.02rem; letter-spacing: .04em; text-transform: uppercase;
  padding: .5rem 1.2rem; border-radius: 999px; margin-bottom: 1rem; transition: color .15s var(--rx-ease);
}
.rx-mega__title:hover { color: var(--rx-red); }
.rx-mega__list { list-style: none; margin: 0; padding: 0 .4rem; }
.rx-mega__list--2 { columns: 2; column-gap: 2rem; }
.rx-mega__list li { margin: 0 0 .6rem; break-inside: avoid; }
.rx-mega__list a {
  display: flex; align-items: flex-start; gap: .5rem;
  color: var(--rx-ink); font-size: .96rem; line-height: 1.25; transition: color .15s var(--rx-ease);
}
.rx-mega__list a:hover { color: var(--rx-red); }
.rx-mega__drop {
  flex: 0 0 auto; width: 15px; height: 18px; margin-top: 1px;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%236ea8dc' d='M12 2S5 11 5 16a7 7 0 0 0 14 0c0-5-7-14-7-14z'/%3E%3C/svg%3E");
}

/* Header actions */
.rx-header__actions { display: flex; align-items: center; gap: var(--rx-space-2); }

/* Language switcher — country flags (MX / US), traced from roux.com.mx */
.rx-lang { display: inline-flex; align-items: center; gap: .45rem; }
.rx-lang__opt {
  display: inline-flex; padding: 2px; border-radius: 4px; line-height: 0;
  border: 1.5px solid transparent;
  transition: opacity .2s var(--rx-ease), border-color .2s var(--rx-ease), transform .2s var(--rx-ease);
}
.rx-lang__opt .rx-flag {
  width: 26px; height: auto; display: block; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .3);
}
.rx-lang a.rx-lang__opt { opacity: .5; }
.rx-lang a.rx-lang__opt:hover { opacity: 1; transform: translateY(-1px); }
.rx-lang__opt.is-active { border-color: var(--rx-red); opacity: 1; }
/* The header-bar switcher shows on desktop; on mobile it moves into the menu (.rx-nav__lang). */
.rx-nav__lang { display: none; }

.rx-search-toggle { display: inline-flex; background: none; border: 0; color: var(--rx-navy); cursor: pointer; padding: 4px; transition: color .2s var(--rx-ease); }
.rx-search-toggle:hover { color: var(--rx-red); }
.rx-burger { display: none; }

/* ---- Search overlay (lupa) ---- */
.rx-search-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(6, 14, 34, .94); display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .25s var(--rx-ease);
}
.rx-search-overlay[hidden] { display: none; }
.rx-search-overlay.is-open { opacity: 1; }
.rx-search-overlay__close { position: absolute; top: 2rem; right: 2.4rem; background: none; border: 0; color: #fff; cursor: pointer; opacity: .8; }
.rx-search-overlay__close:hover { opacity: 1; }
.rx-search-overlay__form {
  display: flex; align-items: center; width: min(760px, 88vw);
  background: #fff; border-radius: var(--rx-radius); overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.rx-search-overlay__input { flex: 1; border: 0; padding: 1.3rem 1.6rem; font-size: 1.4rem; font-family: var(--rx-font-body); color: var(--rx-ink); background: transparent; }
.rx-search-overlay__input:focus { outline: none; }
.rx-search-overlay__submit { background: none; border: 0; color: var(--rx-blue-500); cursor: pointer; padding: 0 1.4rem; display: inline-flex; }
.rx-search-overlay__submit:hover { color: var(--rx-red); }

/* ---- Footer (navy): logo · three link columns · meta (certs/social/lang) ---- */
.rx-footer { background: #e7ebf2; color: var(--rx-ink-soft); }
.rx-footer__inner {
  max-width: var(--rx-container); margin-inline: auto;
  padding: var(--rx-space-5) var(--rx-gutter) var(--rx-space-4);
  display: grid; grid-template-columns: auto minmax(0, 2.6fr) auto; gap: clamp(1.6rem, 4vw, 3.5rem); align-items: start;
}
.rx-footer a { color: var(--rx-ink-soft); transition: color .2s var(--rx-ease); }
.rx-footer a:hover { color: var(--rx-red); }
/* Col 1 — logo only */
.rx-footer__brand-col { display: flex; align-items: flex-start; }
.rx-footer__logo { height: 60px; width: auto; }
/* Col 5 — meta: certifications + social + language */
.rx-footer__meta { display: flex; flex-direction: column; align-items: flex-start; gap: var(--rx-space-2); }
.rx-footer__certs img { height: 50px; width: auto; }
.rx-footer__lang { margin-top: .2rem; }
/* Cols 2-4 — link columns */
.rx-footer__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.2rem, 3vw, 2.5rem); }
.rx-footer__heading {
  font-family: var(--rx-font-head); font-weight: var(--rx-fw-bold); font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--rx-navy); margin: 0 0 var(--rx-space-2);
  padding-bottom: .55rem; border-bottom: 2px solid var(--rx-red);
}
.rx-footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.rx-footer__col a { font-size: .93rem; line-height: 1.35; }
/* Roux Corporation logo in the footer "Empresa" column (links to the corporate portal) */
.rx-footer__corp { margin-top: .5rem; }
.rx-footer__corp a { display: inline-block; }
.rx-footer__corp img { width: 150px; max-width: 100%; height: auto; display: block; transition: transform .25s var(--rx-ease); }
.rx-footer__corp a:hover img { transform: translateY(-2px); }
/* Social round buttons (red ring, white icon; fill on hover) */
.rx-social { display: flex; align-items: center; gap: .7rem; list-style: none; margin: .3rem 0 0; padding: 0; }
.rx-social li { margin: 0; }
.rx-social__btn {
  display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px;
  border-radius: 50%; border: 2px solid var(--rx-red); background: transparent; color: var(--rx-navy);
  transition: background .2s var(--rx-ease), color .2s var(--rx-ease), transform .2s var(--rx-ease);
}
.rx-social__btn:hover { background: var(--rx-red); color: #fff; transform: translateY(-2px); }
.rx-footer__bar {
  border-top: 1px solid rgba(0, 33, 95, .12); text-align: center;
  padding: var(--rx-space-2); font-size: .85rem; color: var(--rx-ink-muted);
}

/* ---- Card grid ---- */
.rx-grid { display: grid; gap: var(--rx-space-3); }
.rx-grid--cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---- Mobile ---- */
@media (max-width: 900px) {
  .rx-header__logo { height: 44px; } /* smaller but full (sized by height only) */
  .rx-nav {
    display: block; /* override the desktop flex row → let the list fill full width (fixes short dividers) */
    position: fixed; inset: var(--rx-header-h) 0 auto 0;
    max-height: calc(100dvh - var(--rx-header-h)); overflow-y: auto;
    background: #ffffff; border-bottom: 3px solid var(--rx-red);
    transform: translateY(-130%); transition: transform .3s var(--rx-ease);
    box-shadow: 0 14px 30px rgba(0, 33, 95, .18);
  }
  .rx-nav.is-open { transform: translateY(0); }
  .rx-nav__list { flex-direction: column; align-items: stretch; padding: var(--rx-space-1) var(--rx-gutter) var(--rx-space-2); gap: 0; }
  .rx-nav__item { display: block; border-bottom: 1px solid rgba(0, 33, 95, .1); margin: 0; }
  .rx-nav__link, .rx-nav__home { display: flex; padding: .95rem 0; font-size: 1rem; }
  .rx-nav__home { flex-direction: row; gap: .5rem; }
  .rx-nav__home-underline { display: none; }
  /* Mobile: flatten the mega into the 3 product lines (no fixed panel, no subcategories) */
  .rx-mega {
    position: static; transform: none; opacity: 1; visibility: visible; pointer-events: auto;
    width: auto; max-height: none; overflow: visible; box-shadow: none; border-radius: 0;
    background: transparent;
  }
  .rx-mega__inner { padding: 0 0 .4rem .8rem; }
  .rx-mega__bar { display: none; }
  .rx-mega__cols { grid-template-columns: 1fr; gap: 0; }
  .rx-mega__group { margin-bottom: .2rem; }
  .rx-mega__title {
    background: transparent; color: var(--rx-navy); text-align: left;
    padding: .7rem 0; margin: 0; border-radius: 0; font-size: .95rem;
  }
  .rx-mega__list { display: none; }
  .rx-burger {
    display: inline-flex; flex-direction: column; gap: 5px;
    background: none; border: 0; cursor: pointer; padding: 6px;
  }
  .rx-burger span { width: 24px; height: 2px; background: var(--rx-navy); transition: transform .3s var(--rx-ease), opacity .3s var(--rx-ease); }

  /* Language switcher: hidden in the header bar, moved INSIDE the menu (per the original) */
  .rx-header__lang { display: none; }
  .rx-nav__lang { display: block; border-bottom: 0; padding: var(--rx-space-3) var(--rx-gutter); }
  .rx-nav__lang .rx-lang { justify-content: center; gap: 1.1rem; }
  .rx-nav__lang .rx-lang__opt { padding: 3px; }
  .rx-nav__lang .rx-lang__opt .rx-flag { width: 38px; }

  .rx-footer__inner { grid-template-columns: 1fr; gap: var(--rx-space-4); }
  .rx-footer__cols { gap: var(--rx-space-4) var(--rx-space-3); }
}

@media (max-width: 560px) {
  .rx-footer__cols { grid-template-columns: 1fr 1fr; }
  /* Home product sections: force 2-column cards on mobile (Sergio, 2026-06-07) */
  .rx-lineas .rx-grid--cards { grid-template-columns: repeat(2, 1fr); gap: var(--rx-space-2); }
}
