@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Space+Grotesk:wght@500;600&display=swap');

:root {
    --accent: #c2410f;
    --nav-row: 4rem; /* locked height — change this to adjust bar */
    --safe-top: env(safe-area-inset-top, 0px);
    --nav-total: calc(var(--nav-row) + var(--safe-top));
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

html, body {
    background-color: #000000 !important;
    overscroll-behavior: none;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    color: #e4e4e7;
    overflow-x: hidden;
    max-width: 100vw;
    margin: 0;
}

img, video { max-width: 100%; height: auto; }

.heading-font {
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.section-header {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.nav-active { color: #c2410f; position: relative; }
.nav-active:after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; width: 100%; height: 2px;
    background-color: #c2410f;
}

/* ----- Navbar: fixed height, never collapses ----- */
#navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
    background-color: #000000 !important;
    background-image: none !important;
    opacity: 1 !important;
    border-bottom: 1px solid #27272a;
    padding-top: var(--safe-top) !important;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    /* Total bar height is always safe-area + nav-row */
    min-height: var(--nav-total) !important;
    height: auto !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    transition: none !important;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

#navbar .nav-row {
    /* Inner row always exactly --nav-row tall */
    min-height: var(--nav-row) !important;
    height: var(--nav-row) !important;
    max-height: var(--nav-row) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    background-color: transparent !important;
    box-sizing: border-box !important;
}

#navbar.nav-scrolled {
    background-color: #000000 !important;
    background-image: none !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

/* Logo sizes */
.nav-logo {
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
}
.nav-brand-sb {
    font-size: 2.15rem;
    line-height: 1;
}
.nav-brand-racing {
    font-size: 1.45rem;
    line-height: 1;
}

.page-top-spacer {
    height: var(--nav-total);
    width: 100%;
}

/* Index hero — image below navbar */
.hero-bg {
    position: relative;
    box-sizing: border-box;
    padding-top: var(--nav-total) !important;
    background-color: #000000;
    background-image:
        linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.6)),
        url("../assets/backdrop.jpeg");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-origin: content-box;
    background-clip: content-box;
}

.page-body { background: transparent; }

.canyon-gradient {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
}

.trail-card, .product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
@media (hover: hover) {
    .trail-card:hover, .product-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
    }
}

.sb-logo { font-weight: 900; letter-spacing: -0.05em; }
.accent { color: #c2410f; }

.btn-primary {
    background-color: #c2410f;
    transition: background-color 0.2s ease;
}
.btn-primary:hover { background-color: #9f3410; }

.modal { animation: modalPop 0.2s ease forwards; }
@keyframes modalPop {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.soggy-bg {
    background-image:
        linear-gradient(rgba(9,9,11,0.88), rgba(9,9,11,0.92)),
        url("../assets/logo.JPG");
    background-size: cover;
    background-position: center;
}

button, .tier-card { touch-action: manipulation; }
input, select, textarea { font-size: 16px !important; }

/* Mobile — do NOT shrink nav-row padding (that was collapsing the bar) */
@media (max-width: 767px) {
    .nav-logo {
        width: 3rem !important;
        height: 3rem !important;
    }
    .nav-brand-sb { font-size: 1.85rem; }
    .nav-brand-racing { font-size: 1.25rem; }

    .hero-bg {
        min-height: 100svh !important;
        height: auto !important;
    }
    .hero-bg h1 {
        font-size: clamp(2.25rem, 11vw, 3.25rem) !important;
        line-height: 1.05 !important;
    }
    .section-header { font-size: 1.75rem; }
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    #products-grid { gap: 0.75rem !important; }
    #cart-drawer { max-width: 100vw !important; }
    footer { text-align: center; }
}

@media (max-width: 380px) {
    #products-grid { grid-template-columns: 1fr !important; }
}


/* ===== Nav size (moderate, locked) ===== */
#navbar .nav-row {
    min-height: var(--nav-row, 4rem) !important;
    height: var(--nav-row, 4rem) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

#navbar .nav-logo,
#navbar .nav-row > a > div:first-child {
    width: 2.75rem !important;   /* 44px — same as old w-11 */
    height: 2.75rem !important;
    min-width: 2.75rem !important;
    min-height: 2.75rem !important;
    flex-shrink: 0 !important;
}

#navbar .nav-brand-sb,
#navbar .sb-logo {
    font-size: 1.875rem !important; /* text-3xl */
    line-height: 1 !important;
}
#navbar .nav-brand-racing {
    font-size: 1.25rem !important;  /* text-xl-ish */
    line-height: 1 !important;
}

@media (min-width: 768px) {
    #navbar .nav-logo,
    #navbar .nav-row > a > div:first-child {
        width: 3rem !important;     /* 48px desktop */
        height: 3rem !important;
        min-width: 3rem !important;
        min-height: 3rem !important;
    }
    #navbar .nav-brand-sb,
    #navbar .sb-logo { font-size: 2rem !important; }
    #navbar .nav-brand-racing { font-size: 1.35rem !important; }
}

/* ===== Poker run cards (high specificity vs Tailwind CDN) ===== */
#poker-last-draw .poker-card,
.poker-hand-row .poker-card,
.poker-card {
  width: 3.25rem !important;
  height: 4.5rem !important;
  min-width: 3.25rem !important;
  min-height: 4.5rem !important;
  perspective: 1000px !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
  isolation: isolate !important;
  position: relative !important;
  box-sizing: border-box !important;
  /* do not put lasting transforms on the shell */
  transform: none !important;
  animation: none;
}
#poker-last-draw .poker-card.lg,
.poker-card.lg {
  width: 9rem !important;
  height: 12.5rem !important;
  min-width: 9rem !important;
  min-height: 12.5rem !important;
  cursor: pointer !important;
}
#poker-last-draw .poker-card.deal {
  animation: poker-deal-in 0.35s ease-out both !important;
}
@keyframes poker-deal-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.poker-card-inner {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1) !important;
  transform-style: preserve-3d !important;
  -webkit-transform-style: preserve-3d !important;
  transform: rotateY(0deg) !important;
}
.poker-card.flipped .poker-card-inner {
  transform: rotateY(180deg) !important;
}
.poker-card-face {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  border-radius: 0.5rem !important;
  overflow: hidden !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45) !important;
  box-sizing: border-box !important;
}
.poker-card-back {
  background-color: #111 !important;
  background-image: url("/assets/carddeck.JPG") !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  border: 1px solid #3f3f46 !important;
  transform: rotateY(0deg) !important;
}
.poker-card-back.hint::after {
  content: "Tap to flip" !important;
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0.4rem !important;
  text-align: center !important;
  font-size: 0.65rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  color: #fff !important;
  text-shadow: 0 1px 3px #000 !important;
  pointer-events: none !important;
}
.poker-card-front {
  background: #fafafa !important;
  transform: rotateY(180deg) !important;
  border: 1px solid #d4d4d8 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  padding: 0.25rem 0.3rem !important;
  color: #18181b !important;
}
.poker-card-front.red { color: #dc2626 !important; }
.poker-card-corner {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  font-size: 0.65rem !important;
}
.poker-card-corner .suit { font-size: 0.7rem !important; }
.poker-card-corner.bl {
  transform: rotate(180deg) !important;
  align-self: flex-end !important;
}
.poker-card-center {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.35rem !important;
  line-height: 1 !important;
}
.poker-card.lg .poker-card-corner { font-size: 1.1rem !important; }
.poker-card.lg .poker-card-corner .suit { font-size: 1.2rem !important; }
.poker-card.lg .poker-card-center { font-size: 2.75rem !important; }
.poker-hand-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.25rem !important;
  align-items: center !important;
}

/* Members dashboard tabs: horizontal scroll on mobile */
.member-tabs-scroll {
  gap: 0;
  max-width: 100%;
}
.member-tabs-scroll::-webkit-scrollbar {
  height: 4px;
}
.member-tabs-scroll::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 4px;
}
@media (max-width: 767px) {
  .member-tabs-scroll .member-tab {
    font-size: 0.8125rem;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
}

/* ===== Website vs native app navigation ===== */
:root {
  --bottom-tabs-height: 3.5rem;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-tabs-total: calc(var(--bottom-tabs-height) + var(--safe-bottom));
}

/* Default (website / browser): hide bottom tabs, keep top nav */
#bottom-tabs {
  display: none !important;
}

/* Native Capacitor app only */
/* Native app keeps slim top header (logo / cart / avatar) — only hide website menus via JS */
html.is-native-app #navbar .nav-link,
body.is-native-app #navbar .nav-link {
  /* desktop links hidden by JS; leave rule as safety for link row */
}
html.is-native-app #mobile-menu,
body.is-native-app #mobile-menu {
  display: none !important;
}

html.is-native-app #bottom-tabs, body.is-native-app #bottom-tabs {
  display: block !important;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

html.is-native-app body, body.is-native-app {
  /* Keep top header (logo/cart/avatar) + bottom tabs safe area */
  padding-bottom: var(--bottom-tabs-total) !important;
}

/* Hero still needs full top offset under the slim header */
html.is-native-app .hero-bg, body.is-native-app .hero-bg {
  padding-top: var(--nav-total) !important;
}

html.is-native-app #success-toast, body.is-native-app #success-toast {
  bottom: calc(var(--bottom-tabs-total) + 1rem) !important;
}

.bottom-tab {
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
}

.bottom-tab-active {
  color: #f97316 !important;
}

.bottom-tab-active i {
  color: #f97316 !important;
}

/* ===== Native app top bar (logo / cart / avatar) ===== */
#native-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
  background: #000;
  border-bottom: 1px solid #27272a;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

html.is-native-app #native-topbar,
body.is-native-app #native-topbar {
  display: block !important;
}

.native-topbar-inner {
  height: 3.5rem;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.native-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.native-topbar-logo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  overflow: hidden;
  background: linear-gradient(to bottom right, #c2410f, #92400e);
  flex-shrink: 0;
}

.native-topbar-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.15);
}

.native-topbar-sb {
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 1.25rem;
  color: #fff;
}

.native-topbar-racing {
  font-weight: 600;
  letter-spacing: -0.06em;
  font-size: 0.85rem;
  color: #a1a1aa;
  margin-left: 0.15rem;
}

.native-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.native-topbar-cart {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: #18181b;
  border: 1px solid #3f3f46;
  color: #e4e4e7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.native-topbar-cart #cart-count-native {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #ea580c;
  color: #fff;
  font-size: 10px;
  font-family: ui-monospace, monospace;
  display: flex;
  align-items: center;
  justify-content: center;
}

.native-avatar-link {
  display: inline-flex;
  text-decoration: none;
}

.native-avatar {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  overflow: visible;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.native-avatar img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  object-fit: cover;
  background: #27272a;
}

.native-avatar-fallback {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: #ea580c;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.native-avatar-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 0 2px #09090b;
}

.native-login-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  border: 1px solid #3f3f46;
  color: #a1a1aa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* Native app: content clears both top header and bottom tabs */
html.is-native-app {
  /* Same top offset as website header */
  --nav-total: calc(var(--nav-row) + var(--safe-top));
}

html.is-native-app #navbar,
body.is-native-app #navbar {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 200 !important;
  background: #000 !important;
}



/* native: keep real website header, only menus hidden via JS */
html.is-native-app #navbar,
body.is-native-app #navbar {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
html.is-native-app #mobile-menu,
body.is-native-app #mobile-menu {
  display: none !important;
}
html.is-native-app #native-topbar {
  display: none !important;
}

/* Native app: hide website nav links / menu, keep logo + actions */
html.is-native-app #navbar a.nav-link,
html.is-native-app #navbar button.nav-link,
body.is-native-app #navbar a.nav-link,
body.is-native-app #navbar button.nav-link {
  display: none !important;
}
html.is-native-app #navbar a[href="join.html"],
body.is-native-app #navbar a[href="join.html"] {
  display: none !important;
}
html.is-native-app #navbar button[onclick*="toggleMobileMenu"],
body.is-native-app #navbar button[onclick*="toggleMobileMenu"] {
  display: none !important;
}

/* Native: exactly one header cart */
html.is-native-app #nav-cart-native {
  display: none !important;
}
html.is-native-app #nav-cart-desktop {
  display: inline-flex !important;
}
html.is-native-app #nav-cart-btn,
html.is-native-app #nav-cart-btn-mobile {
  /* menu carts stay in hidden mobile menu */
}


/* ===== Native cart sheet (Capacitor) ===== */
html.is-native-app #cart-drawer.native-cart-overlay,
body.is-native-app #cart-drawer.native-cart-overlay,
#cart-drawer.native-cart-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: stretch !important;
  background: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0 !important;
  margin: 0 !important;
}

#cart-drawer.native-cart-overlay > div.native-cart-sheet,
#cart-drawer.native-cart-overlay > div {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 24px) !important;
  max-height: calc(100vh - env(safe-area-inset-top, 0px) - 24px) !important;
  display: flex !important;
  flex-direction: column !important;
  border-left: none !important;
  border-radius: 16px 16px 0 0 !important;
  background: #1c1c1e !important;
  border-top: 1px solid #3a3a3c !important;
  margin: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  transform: translateY(0) !important;
}

#cart-drawer.native-cart-overlay > div > div:first-child {
  flex-shrink: 0 !important;
  padding: 10px 16px 12px !important;
  border-bottom: 1px solid #3a3a3c !important;
}

#cart-drawer.native-cart-overlay #cart-items {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px !important;
  max-height: none !important;
}

#cart-drawer.native-cart-overlay > div > div:last-child {
  flex-shrink: 0 !important;
  background: #1c1c1e !important;
  border-top: 1px solid #3a3a3c !important;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
}

.native-cart-grab {
  width: 36px;
  height: 5px;
  border-radius: 999px;
  background: #636366;
  margin: 0 auto 10px auto;
}

.native-cart-done {
  color: #f97316;
  font-weight: 600;
  font-size: 16px;
  background: none;
  border: none;
  padding: 4px 2px;
}

.native-cart-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(180, 83, 9, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  font-size: 13px;
  margin-bottom: 12px;
}

.native-cart-banner i { margin-top: 2px; color: #fbbf24; }
.native-cart-banner strong { display: block; color: #fde68a; margin-bottom: 2px; }
.native-cart-banner p { margin: 0; color: rgba(254, 243, 199, 0.85); font-size: 12px; line-height: 1.35; }

.native-cart-empty {
  text-align: center;
  padding: 28px 16px 16px;
  color: #8e8e93;
}
.native-cart-empty i {
  font-size: 36px;
  margin-bottom: 10px;
  display: block;
  color: #636366;
}

.native-cart-list {
  border-radius: 12px;
  overflow: hidden;
  background: #2c2c2e;
  border: 1px solid #3a3a3c;
}

.native-cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid #3a3a3c;
}
.native-cart-row:last-child { border-bottom: none; }
.native-cart-row-name { font-size: 15px; font-weight: 500; color: #f5f5f7; }
.native-cart-row-price { font-size: 13px; color: #f97316; margin-top: 2px; }
.native-cart-remove {
  border: none;
  background: none;
  color: #ff453a;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 4px;
  flex-shrink: 0;
}

.native-cart-checkout {
  border-radius: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  background: #3a3a3c !important;
  color: #8e8e93 !important;
  width: 100% !important;
}
