/* ============================================================
   RoidOcean — Header, nav, designed mega-menus, search pill,
   scroll-transform navy header, mobile drawer + bottom bar.
   All values measured from roidocean.to over CDP (2026-08-06).
   ============================================================ */

/* ---- Utility / announcement bar ---- */
.ro-topbar { background: var(--ro-navy); color: #fff; font-size: var(--ro-fs-xs); }
.ro-topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 34px; }
.ro-topbar-welcome { color: var(--ro-orange); font-weight: var(--ro-fw-semi); letter-spacing: .02em; }
.ro-topbar-select { display: flex; align-items: center; gap: 6px; }
.ro-topbar-btn {
  background: transparent; border: 0; color: #dbe4f5; cursor: pointer; font: inherit;
  padding: 6px 8px; display: inline-flex; align-items: center; gap: 6px; border-radius: 6px;
}
.ro-topbar-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.ro-topbar-btn .ro-caret { font-size: 9px; opacity: .7; }

/* ---- Header bar ---- */
.ro-header {
  position: sticky; top: 0; z-index: 500; background: #fff;
  box-shadow: 0 1px 0 var(--ro-line), 0 2px 12px rgba(16,49,120,.05);
  transition: background .25s ease, box-shadow .25s ease;
}
.ro-header-inner { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.ro-logo { flex-shrink: 0; display: inline-flex; align-items: center; }
.ro-logo img { height: 34px; width: auto; }
.ro-logo .ro-logo-white { display: none; }

.ro-burger { display: none; background: transparent; border: 0; cursor: pointer; font-size: 22px; color: var(--ro-navy); padding: 4px 6px; }

/* ---- Primary nav ---- */
.ro-nav { flex: 1 1 auto; }
.ro-mainnav { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; justify-content: center; }
.ro-nav-item { position: static; }
.ro-nav-item > a {
  display: inline-flex; align-items: center; gap: 6px; padding: 20px 12px;
  font-size: var(--ro-fs-sm); font-weight: var(--ro-fw-medium); color: var(--ro-navy); white-space: nowrap;
}
.ro-nav-item > a:hover { color: var(--ro-orange); }
.ro-nav-item > a i.fa-chevron-down { font-size: 9px; opacity: .6; transition: transform .2s; }
.ro-nav-item.group:hover > a i.fa-chevron-down { transform: rotate(180deg); }

/* ============================================================
   Designed mega panels
   ============================================================ */
.ro-mega {
  position: absolute; left: 0; right: 0; top: 100%;
  background: #fff;
  border-top: 2px solid var(--ro-orange);
  border-radius: 0 0 12px 12px;
  box-shadow: var(--ro-shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .18s, transform .18s, visibility .18s;
  z-index: 490; padding: 24px 0 28px;
}
.ro-nav-item.group:hover > .ro-mega,
.ro-nav-item.group:focus-within > .ro-mega { opacity: 1; visibility: visible; transform: translateY(0); }

.ro-mega-inner { width: 100%; max-width: var(--ro-container); margin: 0 auto; padding: 0 1.5rem; }
.ro-mega-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; align-items: start; }

/* column card */
.ro-mega-col { border-radius: 12px; padding: 20px; }
.ro-tint-gray   { background: #f3f4f6; }
.ro-tint-blue   { background: #eff6ff; }
.ro-tint-indigo { background: #eef2ff; }
.ro-tint-amber  { background: #fffbeb; }
.ro-tint-red    { background: #fef2f2; }

.ro-mega-colhead {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px solid rgba(16,49,120,.10);
}
.ro-mega-colhead i { color: var(--ro-navy); font-size: 15px; width: 18px; text-align: center; }
.ro-mega-colhead .ro-flag { width: 22px; height: 16px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.05); }
.ro-mega-colhead span {
  font-size: var(--ro-fs-sm); font-weight: var(--ro-fw-bold); color: var(--ro-navy);
  text-transform: uppercase; letter-spacing: .04em; line-height: 1.1;
}
.ro-mega .sub-menu { list-style: none; margin: 0; padding: 0; }
.ro-mega .sub-menu li { margin: 0; }
.ro-mega .sub-menu a { display: block; padding: 5px 0; font-size: var(--ro-fs-sm); color: #2d4a7a; }
.ro-mega .sub-menu a:hover { color: var(--ro-orange); }
.ro-mega-viewall a { color: var(--ro-orange) !important; font-weight: var(--ro-fw-semi); margin-top: 4px; }

@media (max-width: 1200px){ .ro-mega-grid { grid-template-columns: repeat(3, 1fr); } }

/* ============================================================
   The ONE search-pill component
   ============================================================ */
.ro-searchpill {
  display: flex; align-items: center;
  height: 48px; background: #fff;
  border: 1px solid #d1d5db; border-radius: 8px;
  overflow: hidden; width: 100%;
}
.ro-searchpill-ico { color: #9ca3af; font-size: 16px; margin: 0 10px 0 16px; flex-shrink: 0; }
.ro-searchpill-input {
  flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: transparent;
  font: inherit; font-size: var(--ro-fs-base); color: var(--ro-navy); padding: 0 8px 0 0;
}
.ro-searchpill-input:focus { outline: none; }
.ro-searchpill-input::placeholder { color: #9ca3af; }
.ro-searchpill-btn {
  flex-shrink: 0; margin: 3px; height: calc(100% - 6px);
  padding: 0 20px; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--ro-orange); color: #fff;
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: var(--ro-fs-sm); font-weight: var(--ro-fw-semi);
}
.ro-searchpill-btn:hover { background: var(--ro-orange-600); }
.ro-searchpill-btn .ro-searchpill-label { line-height: 1; }

/* ---- Header actions ---- */
.ro-header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.ro-icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: var(--ro-radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; cursor: pointer; color: var(--ro-navy); font-size: 17px;
}
.ro-icon-btn:hover { background: var(--ro-section-bg); color: var(--ro-orange); }
.ro-cart-count {
  position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--ro-orange); color: #fff; font-size: 10px; font-weight: var(--ro-fw-bold);
  border-radius: var(--ro-radius-full); display: inline-flex; align-items: center; justify-content: center;
}

/* header inline search (revealed when stuck) */
.ro-header-search { display: none; flex: 1 1 auto; max-width: 820px; margin: 0 8px; }

/* ============================================================
   Scroll-transform: header becomes a compact navy search bar
   ============================================================ */
.ro-header.is-scrolled { background: var(--ro-navy); box-shadow: 0 4px 18px rgba(10,31,74,.28); }
.ro-header.is-scrolled .ro-header-inner { min-height: 72px; }
.ro-header.is-scrolled .ro-nav { display: none; }
.ro-header.is-scrolled .ro-header-search { display: block; }
.ro-header.is-scrolled .ro-logo-navy { display: none; }
.ro-header.is-scrolled .ro-logo-white { display: inline-block; }
.ro-header.is-scrolled .ro-icon-btn { color: #fff; }
.ro-header.is-scrolled .ro-icon-btn:hover { background: rgba(255,255,255,.12); color: var(--ro-orange); }
.ro-header.is-scrolled .ro-hide-stuck { display: none; }
.ro-header.is-scrolled .ro-cart-count { box-shadow: 0 0 0 2px var(--ro-navy); }

/* ---- Desktop search overlay (unscrolled search icon) ---- */
.ro-search-panel {
  position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-top: 1px solid var(--ro-line);
  box-shadow: var(--ro-shadow); padding: 24px 0 30px; z-index: 480;
}
.ro-search-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ro-search-head h3 { margin: 0; font-size: var(--ro-fs-xl); }
.ro-searchpill--overlay { height: 52px; }
.ro-search-popular { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ro-search-popular-label { font-size: var(--ro-fs-xs); font-weight: var(--ro-fw-bold); color: var(--ro-muted); letter-spacing: .05em; }
.ro-search-tag { font-size: var(--ro-fs-sm); padding: 5px 12px; border-radius: var(--ro-radius-full); background: var(--ro-section-bg); color: var(--ro-navy); }
.ro-search-tag:hover { background: var(--ro-orange); color: #fff; }

/* ============================================================
   Persistent mobile search bar
   ============================================================ */
.ro-mobile-search { display: none; background: #fff; border-bottom: 1px solid var(--ro-line); padding: 10px 0; }
.ro-searchpill--mobile { height: 46px; }
.ro-searchpill--mobile .ro-searchpill-btn,
.ro-searchpill--drawer .ro-searchpill-btn { padding: 0 14px; }
/* mobile/drawer search buttons are icon-only (no label rendered by PHP) */

/* ============================================================
   Mobile drawer
   ============================================================ */
.ro-drawer-overlay { position: fixed; inset: 0; background: rgba(10,31,74,.5); z-index: 9000; opacity: 0; transition: opacity .25s; }
.ro-drawer-overlay.is-open { opacity: 1; }
.ro-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(86vw, 340px);
  background: #fff; z-index: 9001; transform: translateX(-100%); transition: transform .28s ease;
  display: flex; flex-direction: column; box-shadow: 0 0 40px rgba(0,0,0,.25);
}
.ro-drawer.is-open { transform: translateX(0); }
.ro-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--ro-navy); }
.ro-drawer-head .ro-logo img { height: 30px; }
.ro-drawer-head-actions { display: flex; align-items: center; gap: 4px; }
.ro-drawer-head .ro-icon-btn { color: #fff; }
.ro-drawer-head .ro-icon-btn:hover { background: rgba(255,255,255,.12); color: var(--ro-orange); }
.ro-drawer-search { padding: 12px 16px; border-bottom: 1px solid var(--ro-line); }
.ro-searchpill--drawer { height: 44px; }
.ro-drawer-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.ro-drawer-selectors { border-top: 1px solid var(--ro-line); padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.ro-dsel {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--ro-section-bg); border: 1px solid var(--ro-line); border-radius: var(--ro-radius-sm);
  padding: 11px 14px; font: inherit; font-size: var(--ro-fs-sm); color: var(--ro-navy); cursor: pointer;
}
.ro-dsel .ro-caret { margin-left: auto; font-size: 10px; opacity: .6; }
.ro-dsel i.fa-globe { color: var(--ro-orange); }
.ro-dsel:hover { border-color: var(--ro-orange); }

/* derived drawer nav (built by ro-app.js) */
.ro-dnav { list-style: none; margin: 0; padding: 0; }
.ro-dnav li { border-bottom: 1px solid var(--ro-line-soft); }
.ro-dnav > li > a, .ro-dnav > li > .ro-dnav-row {
  display: flex; align-items: center; justify-content: space-between; padding: 13px 16px;
  font-size: var(--ro-fs-base); font-weight: var(--ro-fw-medium); color: var(--ro-navy); cursor: pointer;
}
.ro-dnav-row .ro-dnav-toggle { padding: 6px; color: var(--ro-muted); }
.ro-dnav .ro-dnav-sub { list-style: none; margin: 0; padding: 0; display: none; background: var(--ro-section-bg); }
.ro-dnav .ro-dnav-sub.is-open { display: block; }
.ro-dnav .ro-dnav-sub a { display: block; padding: 10px 16px 10px 28px; font-size: var(--ro-fs-sm); color: var(--ro-ink-soft); }
.ro-dnav .ro-dnav-sub a:hover { color: var(--ro-orange); }
.ro-dnav-toggle i { transition: transform .2s; }
.ro-dnav-row.is-open .ro-dnav-toggle i { transform: rotate(180deg); }

/* ============================================================
   Bottom tab bar (fixed, lg:hidden)
   ============================================================ */
.ro-bottomnav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000;
  background: #fff; border-top: 1px solid var(--ro-line); box-shadow: 0 -2px 12px rgba(16,49,120,.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.ro-bnav-item {
  flex: 1; background: transparent; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 8px 4px 7px; font: inherit; font-size: 10px; font-weight: var(--ro-fw-medium);
  color: var(--ro-muted); text-decoration: none; line-height: 1;
}
.ro-bnav-item i { font-size: 18px; }
.ro-bnav-item span { font-size: 10px; }
.ro-bnav-item:hover { color: var(--ro-navy); }
.ro-bnav-item.is-active { color: var(--ro-orange); }
.ro-bnav-carticon { position: relative; display: inline-flex; }
.ro-bnav-badge {
  position: absolute; top: -6px; right: -9px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--ro-orange); color: #fff; font-size: 9px; font-weight: var(--ro-fw-bold);
  border-radius: var(--ro-radius-full); display: inline-flex; align-items: center; justify-content: center;
}

/* ============================================================
   Responsive header
   ============================================================ */
@media (max-width: 1024px){
  .ro-nav, .ro-hide-sm, .ro-hide-mobile { display: none; }
  .ro-burger { display: inline-flex; }
  .ro-header-inner { gap: 10px; }
  .ro-logo { margin-left: auto; margin-right: auto; }

  /* mobile keeps the plain white header (no scroll-transform) */
  .ro-header.is-scrolled { background: #fff; box-shadow: 0 1px 0 var(--ro-line), 0 2px 12px rgba(16,49,120,.05); }
  .ro-header.is-scrolled .ro-header-search { display: none; }
  .ro-header.is-scrolled .ro-logo-navy { display: inline-block; }
  .ro-header.is-scrolled .ro-logo-white { display: none; }
  .ro-header.is-scrolled .ro-icon-btn { color: var(--ro-navy); }

  /* top bar: centered welcome, selectors hidden (moved to drawer) */
  .ro-topbar-inner { justify-content: center; }
  .ro-topbar-welcome { display: inline; }
  .ro-topbar-select { display: none; }

  .ro-mobile-search { display: block; }
  .ro-bottomnav { display: flex; }
  .ro-site { padding-bottom: 62px; }
}
