/*
 * Island nav (includes/class-redaccs-island-nav.php): the site header as a floating ink bar that
 * opens downward into each menu. Loads on every public page that gets the island. Carries its own
 * tokens so it looks the same on pages without the landing/homepage CSS (blog, shop, cart, checkout).
 */
.ran-wrap {
  --ran-ink: oklch(18% 0 0);
  --ran-ink-2: oklch(23.5% 0 0);
  --ran-ink-3: oklch(29% 0 0);
  --ran-ink-4: oklch(35% 0 0);
  --ran-text: oklch(97% 0 0);
  --ran-muted: oklch(72% 0 0);
  --ran-faint: oklch(58% 0 0);
  --ran-rule: oklch(100% 0 0 / 0.09);
  --ran-hover: oklch(100% 0 0 / 0.07);
  --ran-accent: #ff642f;
  --ran-accent-hover: #ff7a4b;
  --ran-accent-ink: oklch(18% 0 0);
  --ran-amber: #f59e0b;
  --ran-focus: oklch(72% 0.15 55);
  --ran-font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Helvetica, Arial, sans-serif;
  --ran-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ran-shadow: 0 1px 1px oklch(0% 0 0 / 0.08), 0 4px 10px -2px oklch(0% 0 0 / 0.12), 0 28px 56px -24px oklch(0% 0 0 / 0.45);
}

/* the bar: a sticky strip that keeps its space in the flow; only the island takes pointer events */
.ran-wrap { position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 1000; height: 84px; padding: 12px 24px 0; pointer-events: none; }
.ran { position: relative; max-width: 1240px; margin: 0 auto; background: var(--ran-ink); color: var(--ran-text); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--ran-rule), var(--ran-shadow); overflow: hidden; pointer-events: auto; font: 400 15px/1.5 var(--ran-font); text-align: left; -webkit-font-smoothing: antialiased; }
.ran *, .ran *::before, .ran *::after { box-sizing: border-box; }
/* :where() keeps the states at the same weight as `.ran a`, so a visited, hovered or focused link
   still takes its own colour (.ran-trig, .ran-login) instead of turning white */
.ran a, .ran a:where(:hover, :focus, :visited) { color: inherit; text-decoration: none; }
/* reset at zero specificity so each control's own rules win over it, and it still beats the theme's button styles (loaded earlier) */
:where(.ran) button { font: inherit; color: inherit; background: none; border: 0; border-radius: 0; margin: 0; padding: 0; min-height: 0; line-height: inherit; text-transform: none; letter-spacing: normal; box-shadow: none; cursor: pointer; }
:where(.ran) button:hover, :where(.ran) button:focus { color: inherit; background: none; }
.ran :focus-visible { outline: 2px solid var(--ran-focus); outline-offset: 2px; border-radius: 8px; }
.ran-ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.ran-row { display: flex; align-items: center; gap: 4px; height: 60px; padding: 0 10px 0 16px; }
.ran-logo { display: inline-flex; flex: none; align-items: center; gap: 10px; margin-right: 14px; white-space: nowrap; }
.ran-logo img { display: block; width: 30px; height: 30px; }
.ran-logo span { font: 800 13px/1 var(--ran-font); letter-spacing: .06em; text-transform: uppercase; color: var(--ran-text); }
.ran-nav { display: flex; align-items: center; gap: 2px; }
.ran .ran-trig, .ran .ran-login { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 9px; font: 560 14.5px/1 var(--ran-font); color: var(--ran-muted); white-space: nowrap; transition: background-color .2s var(--ran-ease), color .2s; }
.ran .ran-trig:hover, .ran .ran-trig[aria-expanded="true"], .ran .ran-login:hover { color: var(--ran-text); background: var(--ran-hover); }
.ran-chev { width: 15px; height: 15px; stroke-width: 2; transition: transform .3s var(--ran-ease); }
.ran-trig[aria-expanded="true"] .ran-chev { transform: rotate(180deg); }
.ran-wal { width: 17px; height: 17px; }
.ran-bal { color: var(--ran-text); font-variant-numeric: tabular-nums; }
.ran-bal .woocommerce-Price-amount, .ran-bal bdi { color: inherit; font: inherit; }
.ran-sp { flex: 1; }
.ran .ran-cart { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; color: var(--ran-muted); }
.ran .ran-cart:hover { color: var(--ran-text); background: var(--ran-hover); }
.ran-cart { position: relative; }
.ran-count { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--ran-accent); color: var(--ran-accent-ink); font: 700 10.5px/1 var(--ran-font); font-variant-numeric: tabular-nums; }
.ran-count[hidden] { display: none; }
.ran-cart .ran-count { position: absolute; top: 3px; right: 1px; box-shadow: 0 0 0 2px var(--ran-ink); }
.ran-util .ran-count { margin-left: 2px; }
.ran .ran-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; margin-left: 6px; padding: 0 16px; border-radius: 10px; background: var(--ran-accent); color: var(--ran-accent-ink) !important; font: 700 14px/1 var(--ran-font); white-space: nowrap; box-shadow: inset 0 1px 0 oklch(100% 0 0 / .28), inset 0 -1px 0 oklch(0% 0 0 / .12); transition: background-color .2s var(--ran-ease), transform .2s var(--ran-ease); }
.ran .ran-cta:hover { background: var(--ran-accent-hover); }
.ran .ran-cta { gap: 8px; text-transform: uppercase; letter-spacing: .05em; }
.ran-cta-ico { width: 18px; height: 18px; flex: none; fill: currentColor; }
.ran .ran-cta:active { transform: translateY(1px); }
.ran .ran-menu { display: none; width: 42px; height: 42px; border-radius: 10px; place-items: center; color: var(--ran-text); }
.ran .ran-menu:hover { background: var(--ran-hover); }
.ran-menu .ran-menu-close, .ran-menu[aria-expanded="true"] .ran-menu-open { display: none; }
.ran-menu[aria-expanded="true"] .ran-menu-close { display: block; }

/* the drawer: height is set by island-nav.js and eased here */
.ran-drawer { height: 0; overflow: hidden; transition: height .42s var(--ran-ease); }
.ran-drawer.is-closing { transition-duration: .26s; transition-timing-function: cubic-bezier(.4, 0, 1, 1); }
.ran-panel { padding: 8px 14px 16px; border-top: 1px solid var(--ran-rule); opacity: 0; transform: translateY(-6px); }
.ran-panel.is-in { opacity: 1; transform: none; transition: opacity .28s var(--ran-ease) .04s, transform .38s var(--ran-ease) .04s; }
.ran-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 20px; padding-top: 10px; }
.ran .ran-item { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 10px; font: 600 15px/1.3 var(--ran-font); color: var(--ran-text); transition: background-color .2s var(--ran-ease); }
.ran-item > .ran-ico:first-child { width: 18px; height: 18px; color: var(--ran-amber); }
.ran .ran-item:hover, .ran .ran-item:focus-visible { background: var(--ran-ink-2); }
.ran-ext { width: 13px; height: 13px; color: var(--ran-faint); }
.ran-foot { display: flex; justify-content: flex-end; padding: 12px 10px 0; }
.ran .ran-foot a { display: inline-flex; align-items: center; gap: 8px; font: 600 14px/1 var(--ran-font); color: var(--ran-text); }
.ran-foot .ran-ico { width: 16px; height: 16px; transition: transform .25s var(--ran-ease); }
.ran-foot a:hover .ran-ico { transform: translateX(3px); }

/* phone list (shown by island-nav.js below 1024px) */
.ran-mob { max-height: calc(100dvh - 90px - var(--wp-admin--admin-bar--height, 0px)); overflow-y: auto; overscroll-behavior: contain; padding: 6px 8px 0; border-top: 1px solid var(--ran-rule); scrollbar-width: thin; scrollbar-color: var(--ran-ink-4) transparent; }
.ran-label { margin: 16px 10px 4px; padding: 0; font: 600 12px/1.4 var(--ran-font); letter-spacing: .06em; text-transform: uppercase; color: var(--ran-faint); }
.ran .ran-mob-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 10px; border-radius: 10px; font: 560 15px/1.25 var(--ran-font); color: var(--ran-text); }
.ran-mob-item > .ran-ico:first-child { width: 18px; height: 18px; color: var(--ran-muted); }
.ran .ran-mob-item:hover, .ran .ran-mob-item:focus-visible { background: var(--ran-ink-2); }
.ran-util { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin: 18px 2px 0; }
.ran .ran-util a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 10px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--ran-rule); font: 600 14.5px/1 var(--ran-font); color: var(--ran-text); white-space: nowrap; }
.ran-util .ran-ico { width: 18px; height: 18px; }
.ran-mob-cta { position: sticky; bottom: 0; margin: 12px -8px 0; padding: 12px 10px; background: var(--ran-ink); box-shadow: 0 -1px 0 var(--ran-rule); }
.ran .ran-mob-cta .ran-cta { display: flex; width: 100%; min-height: 50px; margin: 0; font-size: 15px; }

@media (min-width: 1024px) {
  .ran-mob { display: none !important; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  .ran-logo span { display: none; }
  .ran-logo { margin-right: 6px; }
}
@media (max-width: 1023px) {
  .ran-wrap { height: 70px; padding: 10px 10px 0; }
  .ran { border-radius: 14px; }
  .ran-row { height: 54px; padding: 0 6px 0 14px; }
  .ran-nav, .ran-row > .ran-trig, .ran-row > .ran-login, .ran-row > .ran-cart, .ran-row > .ran-cta { display: none !important; }
  .ran .ran-menu { display: grid; }
  .ran-panel { display: none !important; }
}
@media (max-width: 380px) {
  .ran-logo span { font-size: 12px; letter-spacing: .04em; }
}

/* below 600px WordPress lets the admin bar scroll away (position: absolute), so the island sticks to the top */
@media (max-width: 600px) {
  .ran-wrap { top: 0; }
}

/* while the phone list is open, the floating "View cart" and "Need Help?" buttons step aside */
html.ran-mob-open #redaccs-view-cart, html.ran-mob-open #redaccs-chatbot-placeholder { visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }

/* anchor jumps land below the island */
html:has(body.ra-island-nav) { scroll-padding-top: calc(92px + var(--wp-admin--admin-bar--height, 0px)); }
@media (max-width: 1023px) { html:has(body.ra-island-nav) { scroll-padding-top: calc(78px + var(--wp-admin--admin-bar--height, 0px)); } }

/* GeneratePress leaves room for its header and slide-out; neither is printed now */
body.ra-island-nav .slideout-overlay, body.ra-island-nav #sticky-placeholder { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .ran *, .ran-drawer, .ran-panel { transition: none !important; animation: none !important; }
}
