/* Kapsule.fit shared theme — tokens, chrome, product cards.
   Self-hosted CSS (not Tailwind CDN) so styles are cacheable, render-blocking
   without runtime JS, and small enough for Core Web Vitals. */

:root {
  --navy: #1E3A5C;
  --navy-deep: #152C46;
  --lime: #86BF3E;
  --lime-tint: #EEF6E1;
  --lime-line: #D7E9C4;
  --bg: #F7F9FB;
  --line: #E2E8EE;
  --amber: #E39A3D;
  --amber-tint: #FCEDD8;
  --white: #FFFFFF;
  --muted: #647080;
  --nav-h: 64px;
  --font-sans: "Public Sans", system-ui, sans-serif;
  --font-serif: "Fraunces", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow-card: 0 14px 28px rgba(21, 44, 70, 0.1);
  --radius-card: 18px;
  --wrap: 1240px;
  /* Aliases so older inline styles still resolve */
  --green: var(--lime);
  --green2: #5F8F2C;
  --navy2: var(--navy-deep);
  --cream: var(--bg);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-family: var(--font-sans);
  color: var(--navy);
}

a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
img { max-width: 100%; height: auto; }
[x-cloak] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 40px; }

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo img { height: 40px; width: auto; display: block; object-fit: contain; }

/* ---------- Buttons ---------- */
.btn-navy {
  background: var(--navy); color: var(--white);
  font-size: 13px; font-weight: 700;
  padding: 10px 18px; border-radius: 10px;
  border: 0; white-space: nowrap; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px;
}
.btn-navy:hover { background: var(--navy-deep); }
.btn-navy:disabled,
.btn-navy.is-disabled {
  background: var(--line); color: var(--muted); cursor: not-allowed;
}
.btn-lime {
  background: var(--lime); color: var(--navy-deep);
  font-weight: 700; font-size: 14px;
  padding: 14px 26px; border-radius: 12px;
  border: 0; white-space: nowrap; display: inline-flex;
  align-items: center; justify-content: center;
  transition: filter 0.12s, transform 0.12s;
}
.btn-lime:hover { filter: brightness(0.96); }
.btn-lime:active { transform: scale(0.98); filter: brightness(0.94); }
.btn-lime:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }
.signin-btn {
  background: var(--navy); color: var(--white);
  font-size: 13px; font-weight: 700;
  padding: 10px 18px; border-radius: 10px;
  white-space: nowrap; display: inline-block;
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--white); border: 1px solid var(--line);
  position: relative; flex-shrink: 0;
}
.icon-btn .dot {
  position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber); border: 1.5px solid var(--white);
}
.icon-btn .count {
  position: absolute; top: -3px; right: -3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--lime); color: var(--navy-deep);
  font-size: 9px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Desktop top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg); border-bottom: 1px solid var(--line);
  overflow: visible;
}
.topbar-inner {
  display: flex; align-items: center; gap: 36px; padding: 16px 0;
}
.navlinks { display: flex; align-items: center; gap: 28px; flex-shrink: 0; }
.navlinks a,
.navlinks .nav-link {
  font-size: 13.5px; font-weight: 600; color: var(--navy);
  background: none; border: 0; padding: 0; font-family: inherit;
}
.navlinks a:hover,
.navlinks .nav-link:hover { color: var(--lime); }
.topsearch {
  flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: 9px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 11px; padding: 10px 14px;
  color: var(--muted); font-size: 13.5px; position: relative;
}
.topsearch input {
  border: none; background: none; outline: none;
  flex: 1; min-width: 0;
  font-family: var(--font-sans); font-size: 13.5px; color: var(--navy);
}
.top-actions {
  display: flex; align-items: center; gap: 10px;
  margin-left: auto; flex-shrink: 0;
}

/* ---------- Product card ---------- */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.pcard {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: box-shadow 0.15s;
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.pcard:hover { box-shadow: var(--shadow-card); }
.pcard .thumb {
  height: 170px; background: var(--white);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.pcard .thumb svg,
.pcard .thumb .thumb-ph { width: 64px; height: 64px; color: var(--navy); flex-shrink: 0; }
.pcard .thumb img,
.pcard .thumb .thumb-img {
  width: 100%; height: 100%; object-fit: contain; padding: 12px; display: block;
}
.pcard .badge,
.pcard-row .badge {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  background: var(--amber); color: var(--white);
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  padding: 4px 9px; border-radius: 6px;
}
.pcard .wish {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 0; display: flex; align-items: center; justify-content: center;
}
.pcard .wish svg { width: 15px; height: 15px; color: var(--navy); }
.pcard .wish.is-on svg { fill: var(--navy); }
.pcard .info { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.pcard .brand {
  font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--lime); font-weight: 700;
}
.pcard .name {
  font-size: 14.5px; font-weight: 600; margin: 5px 0 10px;
  line-height: 1.35; color: var(--navy);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 39px;
}
.pcard .price-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; gap: 8px;
}
.price-box {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0;
}
.pcard .price-row .price-box { flex: 1; }
.price-box .selling { font-size: 1.125rem; font-weight: 700; color: var(--navy); line-height: 1.2; }
.price-box .mrp { font-size: 0.875rem; font-weight: 500; color: var(--muted); text-decoration: line-through; }
.price-box .off {
  font-size: 11px; font-weight: 700; color: var(--green2);
  background: var(--lime-tint); border: 1px solid var(--lime-line);
  padding: 2px 7px; border-radius: 6px; letter-spacing: 0.02em;
}
.pcard .add {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--lime); border: 0;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: filter 0.12s, transform 0.12s;
}
.pcard .add svg { width: 16px; height: 16px; color: var(--white); }
.pcard .add:hover { filter: brightness(0.96); }
.pcard .add:active { transform: scale(0.96); filter: brightness(0.94); }
.buy-now {
  margin-top: 10px;
  width: 100%;
  background: var(--navy);
  border: 0;
  color: var(--white);
  font-size: 12.5px;
  font-weight: 700;
  padding: 9px 10px;
  border-radius: 9px;
  transition: filter 0.12s, transform 0.12s;
}
.buy-now:hover { filter: brightness(0.96); }
.buy-now:active { transform: scale(0.98); filter: brightness(0.94); }
.buy-now:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }
.pcard .add:disabled,
.pcard .add.is-disabled { background: var(--line); cursor: not-allowed; }
.qty-step {
  display: inline-flex;
  align-items: stretch;
  height: 34px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--lime);
  flex-shrink: 0;
}
.qty-step button {
  width: 28px;
  border: 0;
  background: transparent;
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-step button:active { background: rgba(21, 44, 70, 0.12); }
.qty-step button:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-step .n {
  min-width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
}
.qty-step-wide {
  width: 100%;
  height: 40px;
  justify-content: space-between;
}
.qty-step-wide button { width: 40px; }
.qty-step-wide .n { min-width: 32px; font-size: 15px; }
.qty-step-navy { background: var(--navy); }
.pcard .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.pcard .pill,
.pcard-row .pill {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  padding: 3px 8px; border-radius: 6px;
  background: var(--lime-tint); color: var(--navy); border: 1px solid var(--lime-line);
}
.pill.pill-action {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}
.pill.pill-action svg { width: 10px; height: 10px; flex-shrink: 0; }
.pill.pill-action:hover { background: var(--lime); border-color: transparent; }
.pill.pill-action .lbl {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pcard .oos {
  position: absolute; inset: 0; z-index: 3;
  background: rgba(247, 249, 251, 0.72);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.pcard .oos span {
  background: var(--navy-deep); color: var(--white);
  font-size: 11px; font-weight: 700;
  padding: 6px 12px; border-radius: 99px;
}

/* ---------- Desktop footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 70px;
  padding: 56px 0 40px;
  background: var(--bg);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 44px;
}
.foot-brand .logo { margin-bottom: 14px; }
.foot-brand p { font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 260px; }
.foot-col h4 {
  font-size: 12.5px; font-weight: 700; color: var(--navy);
  margin: 0 0 16px; text-transform: uppercase; letter-spacing: 0.04em;
}
.foot-col a { display: block; font-size: 13px; color: var(--muted); margin-bottom: 11px; }
.foot-col a:hover { color: var(--navy); }
.foot-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 28px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.foot-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.foot-badges span {
  background: var(--lime-tint); color: var(--navy);
  font-size: 11px; font-weight: 700;
  padding: 6px 11px; border-radius: 8px;
}

/* ---------- Mobile shell + tabbar ---------- */
.phone {
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
.phone .topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
}
.phone .topbar .logo img { height: 34px; }
.phone .topbar .spacer { flex: 1; }
.phone .icon-btn { width: 36px; height: 36px; }
.phone .icon-btn .dot { border-color: var(--bg); }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 430px; margin: 0 auto;
  background: var(--white);
  border-top: 1px solid var(--line);
  display: flex;
  padding: 9px 4px calc(12px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--muted); background: none; border: 0;
}
.tab.active { color: var(--navy); }
.tab svg { width: 21px; height: 21px; }
.tab span { font-size: 10px; font-weight: 700; }
.tab.search-tab { position: relative; }

/* ---------- Mobile site footer (policies) ---------- */
.mobile-site-footer {
  margin: 20px 16px 8px;
  padding: 18px 16px 12px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(247,249,251,.6) 0%, var(--bg) 100%);
  border-radius: 16px;
}
.mobile-foot-kicker {
  margin: 0 0 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.mobile-foot-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.mobile-foot-links a {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--navy);
  text-decoration: none;
}
.mobile-foot-links a:active { opacity: 0.7; }
.mobile-foot-copy {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}
.mobile-site-footer--minimal {
  padding: 12px 16px 10px;
  margin: 12px 16px 8px;
}
.mobile-foot-minimal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mobile-foot-minimal a {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
}
.mobile-foot-minimal a:active { opacity: 0.7; }
.mobile-foot-minimal span {
  color: var(--muted);
  font-size: 12px;
}
.mobile-site-footer--minimal .mobile-foot-copy {
  margin: 8px 0 0;
  padding-top: 0;
  border-top: 0;
}
.phone.legal .mobile-site-footer {
  margin: 8px 0 0;
  border-radius: 0;
  background: var(--bg);
}
.phone.checkout .mobile-site-footer,
.phone.payment .mobile-site-footer {
  margin-bottom: 88px;
}
.phone.pdp .mobile-site-footer {
  margin-bottom: 24px;
}

/* ---------- Mobile slide-out menu ---------- */
body.mobile-menu-lock { overflow: hidden; }
.mobile-menu-root {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  visibility: hidden;
}
.mobile-menu-root.is-open {
  pointer-events: auto;
  visibility: visible;
}
.mobile-menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(21, 44, 70, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.mobile-menu-root.is-open .mobile-menu-overlay { opacity: 1; }
.mobile-menu-sidebar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(340px, 86vw);
  background: var(--white);
  box-shadow: 8px 0 32px rgba(21, 44, 70, 0.12);
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
.mobile-menu-root.is-open .mobile-menu-sidebar { transform: translateX(0); }
.mobile-menu-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  background: linear-gradient(145deg, var(--navy-deep) 0%, var(--navy) 72%, #223D2A 100%);
}
.mobile-menu-hd .logo img { height: 30px; display: block; filter: brightness(0) invert(1); }
.mobile-menu-hd .icon-btn {
  background: rgba(255, 255, 255, 0.14);
  border: 0;
}
.mobile-menu-hd .icon-btn svg { stroke: var(--white); }
.mobile-menu-lead {
  margin: 0;
  padding: 12px 16px 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}
.mobile-menu-body { padding: 12px 16px 8px; flex: 1; }
.mobile-menu-sec { margin-bottom: 18px; }
.mobile-menu-sec h3 {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.mobile-menu-sec a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 4px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--line);
}
.mobile-menu-sec a:active { opacity: 0.75; }
.mobile-menu-sec a::after {
  content: "›";
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
}
.mobile-menu-copy {
  margin: 0;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}
.phone .topbar .mobile-menu-open { flex-shrink: 0; }

.tab.search-tab .search-fab {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy-deep);
  display: flex; align-items: center; justify-content: center;
  margin-top: -26px;
  box-shadow: 0 6px 14px rgba(21, 44, 70, 0.32);
  border: 4px solid var(--white);
}
.tab.search-tab span { margin-top: 1px; color: var(--navy); }

.muted { color: var(--muted); font-size: 13px; }
.brand {
  font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--lime); font-weight: 700;
}

@media (max-width: 1180px) {
  .wrap { padding: 0 24px; }
  .topbar-inner { gap: 20px; }
  .navlinks { gap: 16px; }
  .prod-grid { grid-template-columns: repeat(3, 1fr); }
  .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
}

@media (max-width: 760px) {
  .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .pcard .thumb { height: 128px; }
  .pcard .info { padding: 10px 12px 12px; }
  .pcard .name { font-size: 12.5px; min-height: 32px; }
  .pcard .price-box .selling { font-size: 1rem; }
}
