/* ================================================================
   store.css - customer storefront components (mobile first)

   Everything is prefixed rr- so it cannot clash with the older site
   styles. Uses the brand tokens from pages.css (--p-*) with fallbacks,
   so it also works on pages that do not load pages.css.

   Breakpoints: base = phones, 640px = large phones, 900px = desktop.
   Touch targets are at least 44px tall; inputs are 16px so iOS does not zoom.
   ================================================================ */

:root {
  --rr-blue: var(--p-blue, #004b88);
  --rr-blue-dark: var(--p-blue-dark, #003366);
  --rr-blue-tint: var(--p-blue-tint, #e8f0fa);
  --rr-red: var(--p-red, #d10024);
  --rr-bg: var(--p-bg, #f0f4f8);
  --rr-card: #fff;
  --rr-line: var(--p-border, #e4e9f0);
  --rr-text: var(--p-text-1, #1a2332);
  --rr-text-2: var(--p-text-2, #3d4f63);
  --rr-text-3: var(--p-text-3, #66788d);
  --rr-green: #1a7f4b;
  --rr-green-tint: #e6f5ec;
  --rr-amber-tint: #fff6dd;
  --rr-radius: 14px;
  --rr-shadow: 0 2px 12px rgba(0, 40, 80, .07), 0 1px 3px rgba(0, 0, 0, .04);
  --rr-font: 'Mulish', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --rr-display: 'Syne', var(--rr-font);
}

/* ---------- layout ---------- */
.rr-page { background: var(--rr-bg); min-height: 60vh; padding-bottom: 88px; font-family: var(--rr-font); color: var(--rr-text); }
.rr-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.rr-narrow { max-width: 760px; }
.rr-stack > * + * { margin-top: 16px; }
.rr-h1 { font-family: var(--rr-display); font-weight: 800; font-size: 1.55rem; line-height: 1.2; margin: 0 0 6px; color: var(--rr-text); overflow-wrap: anywhere; }
.rr-h2 { font-family: var(--rr-display); font-weight: 700; font-size: 1.15rem; margin: 0 0 12px; color: var(--rr-text); }
.rr-muted { color: var(--rr-text-3); }
.rr-small { font-size: .875rem; }
.rr-eyebrow { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--rr-blue); margin: 0 0 4px; }
.rr-card { background: var(--rr-card); border: 1px solid var(--rr-line); border-radius: var(--rr-radius); box-shadow: var(--rr-shadow); padding: 18px; }
.rr-card-tight { padding: 0; overflow: hidden; }
.rr-section { margin-top: 16px; }

/* breadcrumbs: one scrollable line on phones */
.rr-crumbs { display: flex; flex-wrap: nowrap; gap: 6px; list-style: none; margin: 0; padding: 14px 0 10px; overflow-x: auto; white-space: nowrap; font-size: .85rem; -webkit-overflow-scrolling: touch; }
.rr-crumbs li + li::before { content: "\203A"; margin-right: 6px; color: var(--rr-text-3); }
.rr-crumbs a { color: var(--rr-blue); text-decoration: none; display: inline-block; padding: 6px 0; }
.rr-crumbs li:last-child { color: var(--rr-text-3); }

/* ---------- buttons ---------- */
.rr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 2px solid transparent; font: 700 1rem/1.2 var(--rr-font); text-decoration: none !important; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; -webkit-tap-highlight-color: transparent; text-align: center; }
.rr-btn:active { transform: translateY(1px); }
.rr-btn-primary { background: var(--rr-blue); color: #fff !important; box-shadow: 0 6px 20px rgba(0, 75, 136, .28); }
.rr-btn-primary:hover { background: var(--rr-blue-dark); }
.rr-btn-accent { background: var(--rr-red); color: #fff !important; box-shadow: 0 6px 20px rgba(209, 0, 36, .25); }
.rr-btn-ghost { background: #fff; color: var(--rr-blue) !important; border-color: var(--rr-blue); }
.rr-btn-ghost:hover { background: var(--rr-blue-tint); }
.rr-btn-lg { min-height: 52px; font-size: 1.05rem; }
.rr-btn-block { display: flex; width: 100%; }
.rr-btn[disabled] { opacity: .55; cursor: not-allowed; }
.rr-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

/* badges and notes */
.rr-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--rr-blue-tint); color: var(--rr-blue); }
.rr-badge-green { background: var(--rr-green-tint); color: var(--rr-green); }
.rr-badge-amber { background: var(--rr-amber-tint); color: #8a5a00; }
.rr-badge-red { background: #fde7ea; color: var(--rr-red); }
.rr-badge-grey { background: #eceff3; color: #51606f; }
.rr-note { border-radius: 10px; padding: 12px 14px; background: var(--rr-blue-tint); color: var(--rr-text-2); font-size: .95rem; }

/* forms */
.rr-form { display: block; }
.rr-label { display: block; font-weight: 700; margin: 0 0 6px; }
.rr-input, .rr-select { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #c5d0dc; border-radius: 10px; font-size: 16px; font-family: inherit; background: #fff; color: var(--rr-text); }
.rr-input:focus, .rr-select:focus { outline: 3px solid rgba(0, 75, 136, .25); border-color: var(--rr-blue); }
.rr-help { color: var(--rr-text-3); font-size: .875rem; margin: 6px 0 0; }
.rr-check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; }
.rr-check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }

/* ---------- product detail page ---------- */
.rr-pdp { display: grid; gap: 16px; }
.rr-gallery { background: #fff; border: 1px solid var(--rr-line); border-radius: var(--rr-radius); box-shadow: var(--rr-shadow); display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; overflow: hidden; }
.rr-gallery img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.rr-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--rr-text-3); text-align: center; padding: 20px; }
.rr-placeholder-mark { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--rr-blue-tint); color: var(--rr-blue); font-family: var(--rr-display); font-weight: 800; font-size: 1.9rem; letter-spacing: .02em; }
.rr-buybox { display: grid; gap: 14px; }
.rr-partline { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.rr-part { font-family: var(--p-font-mono, 'JetBrains Mono', monospace); font-weight: 700; color: var(--rr-blue); background: var(--rr-blue-tint); padding: 4px 10px; border-radius: 8px; font-size: .95rem; }
.rr-price { font-family: var(--rr-display); font-weight: 800; font-size: 2rem; line-height: 1.1; color: var(--rr-text); }
.rr-price small { font-size: .9rem; font-weight: 600; color: var(--rr-text-3); font-family: var(--rr-font); }
.rr-price-ask { font-family: var(--rr-display); font-weight: 800; font-size: 1.4rem; }
.rr-keyspecs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rr-keyspecs li { background: #f6f9fc; border: 1px solid var(--rr-line); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.rr-keyspecs b { display: block; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--rr-text-3); }
.rr-keyspecs span { display: block; font-weight: 700; overflow-wrap: anywhere; }
.rr-trust { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .92rem; color: var(--rr-text-2); }
.rr-trust li { display: flex; gap: 10px; align-items: flex-start; }
.rr-trust .rr-ico { flex: none; width: 22px; height: 22px; color: var(--rr-green); }

/* spec table: label/value pairs; two columns on wide screens */
.rr-specs { margin: 0; display: grid; grid-template-columns: 1fr; }
.rr-specs > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 16px; border-top: 1px solid var(--rr-line); }
.rr-specs > div:nth-child(odd) { background: #f9fbfd; }
.rr-specs dt { color: var(--rr-text-3); font-weight: 600; flex: 0 1 45%; }
.rr-specs dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.rr-card-title { margin: 0; padding: 16px 16px 12px; font-family: var(--rr-display); font-weight: 700; font-size: 1.1rem; line-height: 1.25; color: var(--rr-text); }

/* sibling sizes: a table that scrolls sideways instead of breaking the page */
.rr-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rr-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 460px; }
.rr-table th { text-align: left; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--rr-text-3); padding: 10px 12px; border-bottom: 2px solid var(--rr-line); white-space: nowrap; }
.rr-table td { padding: 12px; border-top: 1px solid var(--rr-line); vertical-align: middle; }
.rr-table tr:hover td { background: #f6f9fc; }
.rr-table a { color: var(--rr-blue); font-weight: 700; text-decoration: none; }

/* sticky call-to-action on phones */
.rr-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: #fff; border-top: 1px solid var(--rr-line); box-shadow: 0 -6px 20px rgba(0, 40, 80, .12); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 12px; align-items: center; }
.rr-sticky .rr-sticky-price { flex: 1; min-width: 0; line-height: 1.15; }
.rr-sticky .rr-sticky-price b { display: block; font-family: var(--rr-display); font-weight: 800; font-size: 1.2rem; }
.rr-sticky .rr-sticky-price span { font-size: .78rem; color: var(--rr-text-3); }
.rr-sticky .rr-btn { flex: 1.2; }

/* ---------- order tracking ---------- */
.rr-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; }
.rr-steps li { text-align: center; font-size: .78rem; color: var(--rr-text-3); position: relative; padding-top: 34px; font-weight: 600; }
.rr-steps li::before { content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%; background: #dfe6ee; border: 3px solid #fff; box-shadow: 0 0 0 2px #dfe6ee; z-index: 1; }
.rr-steps li::after { content: ""; position: absolute; top: 16px; left: -50%; width: 100%; height: 3px; background: #dfe6ee; }
.rr-steps li:first-child::after { display: none; }
.rr-steps li.is-done { color: var(--rr-text); }
.rr-steps li.is-done::before { background: var(--rr-green); box-shadow: 0 0 0 2px var(--rr-green); }
.rr-steps li.is-done::after { background: var(--rr-green); }
.rr-steps li.is-now { color: var(--rr-green); }
.rr-steps li.is-now::before { animation: rr-pulse 1.6s ease-out infinite; }
@keyframes rr-pulse { 0% { box-shadow: 0 0 0 2px var(--rr-green), 0 0 0 2px rgba(26, 127, 75, .5); } 100% { box-shadow: 0 0 0 2px var(--rr-green), 0 0 0 12px rgba(26, 127, 75, 0); } }
@media (prefers-reduced-motion: reduce) { .rr-steps li.is-now::before { animation: none; } }

.rr-track { display: grid; gap: 10px; background: #fff8ec; border: 1px solid #f1dcae; border-radius: 12px; padding: 14px; }
.rr-track-no { font-family: var(--p-font-mono, monospace); font-weight: 700; font-size: 1.05rem; letter-spacing: .03em; overflow-wrap: anywhere; user-select: all; }

.rr-order { display: grid; gap: 12px; }
.rr-order-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; align-items: baseline; }
.rr-order-item { display: flex; gap: 12px; align-items: center; }
.rr-order-item img, .rr-order-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: contain; background: #f6f9fc; border: 1px solid var(--rr-line); flex: none; }
.rr-order-thumb { display: grid; place-items: center; color: var(--rr-text-3); font-weight: 800; }

/* empty states */
.rr-empty { text-align: center; padding: 40px 20px; }
.rr-empty h2 { font-family: var(--rr-display); }

/* ---------- 640px and up ---------- */
@media (min-width: 640px) {
  .rr-h1 { font-size: 1.9rem; }
  .rr-actions { flex-direction: row; flex-wrap: wrap; }
  .rr-keyspecs { grid-template-columns: repeat(3, 1fr); }
  .rr-specs { grid-template-columns: 1fr 1fr; }
  .rr-specs > div:nth-child(odd) { background: transparent; }
  .rr-specs > div:nth-child(4n+1), .rr-specs > div:nth-child(4n+2) { background: #f9fbfd; }
}

/* ---------- 900px and up (desktop) ---------- */
@media (min-width: 900px) {
  .rr-page { padding-bottom: 40px; }
  .rr-pdp { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px; align-items: start; }
  .rr-gallery { position: sticky; top: 90px; aspect-ratio: 1 / 1; }
  .rr-h1 { font-size: 2.2rem; }
  .rr-sticky { display: none; }
  .rr-price { font-size: 2.4rem; }
  .rr-steps li { font-size: .9rem; }
}
@media (max-width: 899px) { .rr-desktop-only { display: none !important; } }
@media (min-width: 900px) { .rr-mobile-only { display: none !important; } }

/* ================================================================
   Site-wide phone polish for the older header, search results and
   cookie banner (scoped to small screens only)
   ================================================================ */
/* the old header hides the search box below 992px: phones and tablets need it most */
@media (max-width: 991px) {
  #search-bar { display: block !important; margin: 0 0 10px !important; width: 100%; }
  #header .container .row { margin: 0; flex-wrap: wrap !important; }
  #header .container, #header .header-container-style { padding-left: 4px; padding-right: 4px; }
  #header .container .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; padding: 0 12px; }
  .header-logo { text-align: center; padding: 8px 0 4px; }
  .header-search form { display: flex; }
  .header-search form .input { display: block; height: 46px; padding: 0 14px; background: #fff !important; color: #1a2332 !important; border: 2px solid #fff; font-size: 16px; }
  .header-search form .input::placeholder { color: #6b7c8f; }
  .header-search form .search-btn { height: 46px; background: var(--rr-red); color: #fff; border: 0; font-weight: 700; min-width: 84px; }
  #search-bar .search-error:empty { display: none; }
  .header-search form .input { flex: 1; min-width: 0; border-radius: 10px 0 0 10px; }
  .header-search form .search-btn { border-radius: 0 10px 10px 0; padding: 0 16px; }
  ul.category-links, ul.category-links.d-block { display: flex !important; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; gap: 8px; padding: 2px 12px !important; margin: 0; -webkit-overflow-scrolling: touch; }
  ul.category-links > li { float: none !important; flex: none; margin: 0 !important; padding: 0 !important; }
  ul.category-links > li > a { margin: 0 !important; }
}

@media (max-width: 767px) {
  /* header: keep the useful links, drop the address and email line */
  #top-header { padding: 2px 0; }
  #top-header #left-header-links { display: none; }
  #top-header .col-md-6 { width: 100%; max-width: 100%; flex: 0 0 100%; }
  #top-header .header-links { display: flex; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 0 4px; font-size: .85rem; -webkit-overflow-scrolling: touch; }
  #top-header .header-links li { flex: none; margin: 0 !important; padding: 0 6px !important; border: 0 !important; }
  #top-header .header-links li a, #top-header .header-links li button { padding: 8px 2px; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; white-space: nowrap; }
  .responsive-logo { max-height: 48px; width: auto; }
  .header-search input[type="search"], .header-search .input { font-size: 16px; min-height: 46px; }
  .header-search .search-btn { min-height: 46px; }
  .category-links a { display: inline-block; padding: 10px 12px !important; min-height: 44px; }

  /* search results: two compact cards across, bigger touch targets */
  .shop-page .container { padding-left: 12px; padding-right: 12px; }
  .shop-title { font-size: 1.35rem; }
  .product-grid { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px !important; }
  .product-card { margin: 0 !important; min-width: 0; }
  .product-title { font-size: .95rem; overflow-wrap: anywhere; }
  .product-specs { font-size: .82rem; }
  .btn-view, .btn-apply, .btn-reset { min-height: 44px; }
  .filter-bar { position: sticky; top: 0; z-index: 50; }

  /* the cookie banner should not cover half a phone screen */
  #cookie-consent-popup { max-height: 38vh; overflow-y: auto; font-size: .8rem; }
}
@media (max-width: 420px) {
  .product-grid { grid-template-columns: 1fr !important; }
}
img { max-width: 100%; }

/* reviews */
.rr-review { padding: 14px 0; border-top: 1px solid var(--rr-line); }
.rr-review:first-of-type { border-top: 0; padding-top: 0; }
.rr-stars { color: #f0a500; font-size: 1.2rem; margin: 4px 0; letter-spacing: 2px; }

/* orders */
.rr-searchrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 10px 0 0; }
.rr-searchrow .rr-btn-ghost { grid-column: 1 / -1; }
.rr-actions-tight { margin-top: 4px; }
.rr-actions-tight .rr-btn { padding: 8px 14px; min-height: 44px; }
.rr-inline { display: contents; }
.rr-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; }
.rr-links { display: grid; gap: 10px; grid-template-columns: 1fr; }
.rr-links a.rr-card { display: grid; gap: 2px; color: var(--rr-text); text-decoration: none; padding: 14px 16px; }
.rr-links a.rr-card:hover { border-color: var(--rr-blue); }
@media (min-width: 640px) { .rr-links { grid-template-columns: 1fr 1fr; } .rr-actions-tight .rr-btn { flex: 0 0 auto; } }
@media (min-width: 900px) { .rr-links { grid-template-columns: repeat(4, 1fr); } .rr-order { grid-template-columns: 1fr; } }


/* order detail lines */
.rr-center { text-align: center; margin: 10px 0 0; }
.rr-lines { list-style: none; margin: 0; padding: 0; }
.rr-line { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--rr-line); }
.rr-line img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: #f6f9fc; border: 1px solid var(--rr-line); flex: none; }
.rr-line-main { flex: 1; min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.rr-line-price { font-weight: 800; white-space: nowrap; }
.rr-specs.rr-one { grid-template-columns: 1fr; }
.rr-specs.rr-one > div { background: transparent !important; }
.rr-specs.rr-one > div:nth-child(even) { background: #f9fbfd !important; }

/* an older global heading rule sets Playfair Display on every h1-h3; keep store headings on the store font */
.rr-page h1, .rr-page h2, .rr-page h3 { font-family: var(--rr-display) !important; letter-spacing: 0; }
.rr-page h2.rr-card-title { font-size: 1.1rem; margin: 0; }
.rr-page h2.rr-h2 { font-size: 1.15rem; }
.rr-page h1.rr-h1 { font-size: 1.55rem; }
@media (min-width: 640px) { .rr-page h1.rr-h1 { font-size: 1.9rem; } }
@media (min-width: 900px) { .rr-page h1.rr-h1 { font-size: 2.2rem; } }
.rr-page h2.rr-card-title { padding: 16px 16px 12px; }
.rr-empty h2 { font-size: 1.3rem; }

/* landing tiles and part grid */
.rr-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rr-tile { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; background: #fff; border: 1px solid var(--rr-line); border-radius: var(--rr-radius); padding: 14px; box-shadow: var(--rr-shadow); text-decoration: none !important; color: var(--rr-text) !important; min-height: 120px; transition: transform .15s, border-color .15s, box-shadow .15s; }
.rr-tile:hover { transform: translateY(-2px); border-color: var(--rr-blue); box-shadow: 0 8px 24px rgba(0, 40, 80, .12); }
.rr-tile-name { font-family: var(--rr-display); font-weight: 700; font-size: 1.02rem; line-height: 1.2; }
.rr-tile-blurb { color: var(--rr-text-3); font-size: .85rem; line-height: 1.35; flex: 1; }
.rr-tile-mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--rr-blue-tint); color: var(--rr-blue); font-family: var(--rr-display); font-weight: 800; }
.rr-tile-brand { align-items: center; text-align: center; justify-content: center; }
.rr-cta { display: grid; gap: 8px; }
.rr-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.rr-pcard { display: grid; gap: 4px; background: #fff; border: 1px solid var(--rr-line); border-radius: var(--rr-radius); padding: 14px; text-decoration: none !important; color: var(--rr-text) !important; box-shadow: var(--rr-shadow); min-width: 0; transition: border-color .15s, transform .15s; }
.rr-pcard:hover { border-color: var(--rr-blue); transform: translateY(-1px); }
.rr-pcard .rr-part { justify-self: start; }
.rr-pcard-title { font-weight: 700; overflow-wrap: anywhere; }
.rr-pcard-specs { color: var(--rr-text-3); font-size: .88rem; overflow-wrap: anywhere; }
.rr-pcard-price { font-family: var(--rr-display); font-weight: 800; }
@media (min-width: 640px) { .rr-tiles { grid-template-columns: repeat(3, 1fr); gap: 14px; } .rr-grid { grid-template-columns: 1fr 1fr; } .rr-cta { grid-template-columns: 1fr auto; align-items: center; } }
@media (min-width: 900px) { .rr-tiles { grid-template-columns: repeat(4, 1fr); } .rr-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
