/* River Plate Wingshooting theme — ports the design language of the
   reference Next.js storefront (reference/ims-stores) onto Bootstrap 5. */

:root {
  --rpw-background: #f5f0e8;
  --rpw-foreground: #1a1a1a;
  --rpw-card: #fbf7f1;
  --rpw-muted: #6d655a;
  --rpw-border: rgba(60, 74, 62, 0.16);
  --rpw-primary: #8b1a1a;
  --rpw-primary-dark: #701414;
  --rpw-secondary: #2b7a78;
  --rpw-accent: #d4682b;
  --rpw-olive: #3c4a3e;
  --rpw-khaki: #c4a76c;
  --rpw-copper: #a46b44;
  /* Single source of truth for the page's horizontal gutter: the header,
     the main content wrapper, the footer, and the full-bleed hero's overlay
     all read from it so the content column stays aligned at every width. */
  --rpw-gutter: 1rem;
}
@media (min-width: 992px) {
  :root { --rpw-gutter: 2.5rem; }
}

/* Shared content gutter (overrides the legacy 15px container padding). */
body > .container-fluid,
header.rpw-header > .container-fluid,
.footer .container-fluid {
  padding-left: var(--rpw-gutter);
  padding-right: var(--rpw-gutter);
}

body {
  background:
    radial-gradient(circle at top, rgba(139, 26, 26, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(196, 167, 108, 0.12), transparent 20%),
    var(--rpw-background);
  color: var(--rpw-foreground);
  /* The hero's viewport-edge breakout below (100vw) can be a hair wider than
     the visible viewport on browsers that include the scrollbar gutter in
     `vw`; clip that sliver instead of letting it open a horizontal scrollbar. */
  overflow-x: hidden;
}

/* Bootstrap component recolors.
   NOTE: the legacy theme (style.min.css, loaded before this file) hard-codes a
   blue palette (#36A2EB) with literal declarations and !important active-state
   rules, so Bootstrap 5 CSS-variable overrides alone never win. These rules use
   literal declarations with matching/greater specificity to take the cascade. */
.btn-primary {
  --bs-btn-bg: var(--rpw-primary);
  --bs-btn-border-color: var(--rpw-primary);
  --bs-btn-hover-bg: var(--rpw-primary-dark);
  --bs-btn-hover-border-color: var(--rpw-primary-dark);
  --bs-btn-active-bg: var(--rpw-primary-dark);
  --bs-btn-active-border-color: var(--rpw-primary-dark);
}
.btn-primary,
.btn-primary:disabled,
.btn-primary.disabled {
  color: #fff;
  background-color: var(--rpw-primary) !important;
  border-color: var(--rpw-primary) !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle {
  color: #fff;
  background-color: var(--rpw-primary-dark) !important;
  border-color: var(--rpw-primary-dark) !important;
}
.btn-primary:focus,
.btn-primary.focus,
.btn-primary:not(:disabled):not(.disabled):active:focus,
.btn-primary:not(:disabled):not(.disabled).active:focus {
  box-shadow: 0 0 0 0.125rem rgba(139, 26, 26, 0.35) !important;
}
.btn-outline-primary,
.btn-outline-primary:disabled,
.btn-outline-primary.disabled {
  color: var(--rpw-primary) !important;
  border-color: var(--rpw-primary) !important;
  background-color: transparent;
}
.btn-outline-primary:hover,
.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-primary:not(:disabled):not(.disabled).active,
.show > .btn-outline-primary.dropdown-toggle {
  color: #fff !important;
  background-color: var(--rpw-primary) !important;
  border-color: var(--rpw-primary) !important;
}
.btn-outline-primary:focus,
.btn-outline-primary.focus,
.btn-outline-primary:not(:disabled):not(.disabled):active:focus,
.btn-outline-primary:not(:disabled):not(.disabled).active:focus {
  box-shadow: 0 0 0 0.125rem rgba(139, 26, 26, 0.25) !important;
}
.btn-success {
  --bs-btn-bg: var(--rpw-secondary);
  --bs-btn-border-color: var(--rpw-secondary);
  --bs-btn-hover-bg: #226360;
  --bs-btn-hover-border-color: #226360;
}
.btn-success,
.btn-success:disabled,
.btn-success.disabled {
  color: #fff;
  background-color: var(--rpw-secondary) !important;
  border-color: var(--rpw-secondary) !important;
}
.btn-success:hover,
.btn-success:focus,
.btn-success.focus,
.btn-success:not(:disabled):not(.disabled):active,
.btn-success:not(:disabled):not(.disabled).active {
  color: #fff;
  background-color: #226360 !important;
  border-color: #226360 !important;
}
.btn-outline-success,
.btn-outline-success:disabled,
.btn-outline-success.disabled {
  color: var(--rpw-secondary) !important;
  border-color: var(--rpw-secondary) !important;
  background-color: transparent;
}
.btn-outline-success:hover,
.btn-outline-success:not(:disabled):not(.disabled):active,
.btn-outline-success:not(:disabled):not(.disabled).active {
  color: #fff !important;
  background-color: var(--rpw-secondary) !important;
  border-color: var(--rpw-secondary) !important;
}

/* Links: legacy theme paints anchors #36A2EB blue; use the deep red brand
   color instead. Class-based components (nav-link, btn, etc.) keep their own
   higher-specificity colors. */
a { color: var(--rpw-primary); }
a:hover { color: var(--rpw-primary-dark); }

/* Form focus: replace the legacy blue focus ring with a muted brand ring. */
.form-control:focus,
.form-select:focus {
  border-color: rgba(139, 26, 26, 0.4);
  box-shadow: 0 0 0 0.125rem rgba(139, 26, 26, 0.15);
}
.text-primary { color: var(--rpw-primary) !important; }
.badge.bg-primary { background-color: var(--rpw-olive) !important; }
.badge.bg-secondary { background-color: var(--rpw-khaki) !important; color: var(--rpw-foreground) !important; }

/* Header — copper bar matching riverplatewingshooting.com */
header.rpw-header {
  background: var(--rpw-copper);
  margin-bottom: 0 !important;
  padding-left: 0;
  padding-right: 0;
}
header.rpw-header h2,
header.rpw-header .nav-link { color: #fff; }
header.rpw-header .nav-link:hover { color: rgba(255, 255, 255, 0.85); }
header.rpw-header .header-logo-img { background: transparent; }
header.rpw-header h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 0;
}
header.rpw-header .header-logo { justify-content: flex-start; }

/* Header right cluster — calm, evenly spaced, reference-style */
.rpw-header-nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1.25rem;
}
header.rpw-header .rpw-header-nav .nav-link { padding: 0.25rem 0; }
.rpw-shop-link {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
  font-weight: 700;
}
.rpw-account-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 500;
}
header.rpw-header .rpw-header-nav .rpw-account-toggle { padding: 0.35rem 0.75rem; }
.rpw-account-toggle:hover,
.rpw-account-toggle:focus,
.rpw-account-toggle.show { background: rgba(20, 16, 12, 0.16); color: #fff; }
.rpw-account-toggle:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.35);
}
.rpw-account-toggle .material-icons { font-size: 1.35rem; }
.rpw-account-menu {
  min-width: 250px;
  border: 1px solid var(--rpw-border);
  border-radius: 0.65rem;
  box-shadow: 0 16px 40px rgba(35, 28, 20, 0.18);
  overflow: hidden;
}
.rpw-account-menu .dropdown-header {
  color: var(--rpw-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  font-weight: 700;
}
.rpw-account-email {
  display: block;
  margin-top: 0.15rem;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--rpw-olive);
}
.rpw-account-menu .dropdown-item { padding: 0.45rem 1rem; }
.rpw-account-menu .dropdown-item .material-icons {
  font-size: 1.05rem;
  margin-right: 0.5rem;
  color: var(--rpw-muted);
  vertical-align: text-bottom;
}
.rpw-account-menu .dropdown-item:active {
  background: var(--rpw-primary);
  color: #fff;
}
.rpw-account-menu .dropdown-item:active .material-icons { color: #fff; }

/* Cart pill — count sits inside the control, not floated over it */
.rpw-cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: var(--rpw-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.rpw-cart-pill:hover,
.rpw-cart-pill:focus { background: var(--rpw-primary-dark); color: #fff; }
.rpw-cart-pill .material-icons { font-size: 1.15rem; }
.rpw-cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #fff;
  color: var(--rpw-primary);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}
.rpw-store-disabled-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
}
.rpw-store-disabled-badge .material-icons { font-size: 14px; }
@media (max-width: 767.98px) {
  .rpw-header-nav { gap: 0.75rem; }
  .rpw-shop-link { letter-spacing: 0.1em; font-size: 0.78rem; }
  .rpw-cart-pill { padding: 0.35rem 0.7rem; }
  .rpw-store-disabled-badge { display: none; }
}

/* Lodge cards (from reference .wood-card / .texture) */
.wood-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(255,255,255,0.92));
  border: 1px solid var(--rpw-border);
  box-shadow: 0 16px 40px rgba(35, 28, 20, 0.08);
  border-radius: 0.75rem;
}
.texture { position: relative; }
.texture::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03), rgba(255,255,255,0.03)),
    repeating-linear-gradient(135deg, transparent 0, transparent 16px, rgba(60,74,62,0.025) 16px, rgba(60,74,62,0.025) 17px);
  border-radius: inherit;
}

/* Hero */
.rpw-hero {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  min-height: 320px;
}
.rpw-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rpw-hero-overlay {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, rgba(20, 16, 12, 0.25), rgba(20, 16, 12, 0.72));
  color: #fff;
  padding: 4rem 2rem 2.5rem;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
/* Full-bleed variant (catalog page): escapes the content wrapper to span the
   whole viewport, reference-style. The legacy theme (style.min.css) caps
   .container-fluid at max-width:1350px and centers it, so a negative margin
   sized to --rpw-gutter only cancels the wrapper's own padding — it still
   leaves the wrapper's outer whitespace on wide viewports. The classic
   viewport-edge breakout (100vw width + 50% - 50vw margins) escapes that
   wrapper entirely regardless of its max-width, as long as the wrapper stays
   centered (it does, via Bootstrap's margin-inline:auto). Corners go square;
   the overlay copy keeps reading from --rpw-gutter so it stays aligned with
   the content column below. */
.rpw-hero--bleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-radius: 0;
}
.rpw-hero--bleed .rpw-hero-overlay {
  padding-left: var(--rpw-gutter);
  padding-right: var(--rpw-gutter);
}
.rpw-hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  color: var(--rpw-khaki);
  margin-bottom: 0.5rem;
}
.rpw-hero-overlay h1 {
  font-weight: 700;
  max-width: 34rem;
}
.rpw-hero-sub { color: rgba(255, 255, 255, 0.85); max-width: 40rem; }

/* Catalog */
.rpw-section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--rpw-muted);
  margin-bottom: 0.25rem;
}
.rpw-page-title { color: var(--rpw-olive); font-weight: 700; }
.category-nav { background: transparent !important; border-bottom-color: var(--rpw-border) !important; box-shadow: none !important; }
.category-nav .nav-link { color: var(--rpw-olive); border: 1px solid var(--rpw-border); margin-right: 0.5rem; background: rgba(255,255,255,0.6); }
.category-nav .nav-link:hover { background-color: rgba(139, 26, 26, 0.08); }
.category-nav .nav-link.active { background-color: var(--rpw-olive) !important; color: #fff; border-color: var(--rpw-olive); }
.category-header { border-bottom-color: var(--rpw-khaki) !important; }
.category-header h4 { color: var(--rpw-olive); }
.category-header .back-to-top:hover { color: var(--rpw-primary); }

.product-card.wood-card { border-radius: 0.85rem; }
.product-card { border: 1px solid var(--rpw-border); }
.product-card:hover { box-shadow: 0 16px 40px rgba(35, 28, 20, 0.14); }
.product-card .price, .rpw-price { color: var(--rpw-primary); font-weight: 700; }
.product-card .swiper-container { background-color: var(--rpw-card); border-bottom: 1px solid var(--rpw-border); }
.rpw-card-eyebrow {
  color: var(--rpw-secondary);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* Order confirmation — hero variants */
.rpw-hero--lite,
.rpw-hero--lite .rpw-hero-overlay { min-height: 220px; }
.rpw-hero--lite .rpw-hero-overlay { padding: 2.5rem 2rem 2rem; }
.rpw-confirm-check {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--rpw-secondary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 0 0 0 6px rgba(43, 122, 120, 0.35);
}
.rpw-confirm-check .material-icons { font-size: 1.75rem; }
.rpw-order-chip {
  display: inline-block;
  align-self: flex-start;
  margin-top: 1rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(196, 167, 108, 0.6);
  border-radius: 999px;
  background: rgba(20, 16, 12, 0.35);
  color: var(--rpw-khaki);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Order confirmation — journey tracker */
.rpw-stepper {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}
.rpw-step {
  flex: 1 1 0;
  position: relative;
  text-align: center;
}
.rpw-step::before,
.rpw-step::after {
  content: "";
  position: absolute;
  top: 1.1rem;
  width: 50%;
  height: 2px;
  background: var(--rpw-border);
}
.rpw-step::before { left: 0; }
.rpw-step::after { right: 0; }
.rpw-step:first-child::before,
.rpw-step:last-child::after { content: none; }
.rpw-step.is-done::before,
.rpw-step.is-done::after,
.rpw-step.is-current::before { background: var(--rpw-secondary); }
.rpw-step-marker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--rpw-card);
  border: 2px solid var(--rpw-border);
  color: var(--rpw-muted);
}
.rpw-step-marker .material-icons { font-size: 1.1rem; }
.rpw-step.is-done .rpw-step-marker,
.rpw-step.is-current .rpw-step-marker {
  background: var(--rpw-secondary);
  border-color: var(--rpw-secondary);
  color: #fff;
}
.rpw-step.is-current .rpw-step-marker { box-shadow: 0 0 0 4px rgba(43, 122, 120, 0.2); }
.rpw-step-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--rpw-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.rpw-step.is-done .rpw-step-label,
.rpw-step.is-current .rpw-step-label { color: var(--rpw-olive); }
@media (max-width: 575.98px) {
  .rpw-step-label { font-size: 0.68rem; letter-spacing: 0.04em; }
  .rpw-step-marker { width: 1.9rem; height: 1.9rem; }
  .rpw-step::before,
  .rpw-step::after { top: 0.95rem; }
}

/* Order confirmation — line items and totals */
.rpw-order-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
}
.rpw-order-item + .rpw-order-item { border-top: 1px solid var(--rpw-border); }
.rpw-order-item:first-child { padding-top: 0; }
.rpw-order-item:last-child { padding-bottom: 0; }
.rpw-order-item-img {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  object-fit: contain;
  padding: 0.25rem;
  background: #fff;
  border: 1px solid var(--rpw-border);
  border-radius: 0.5rem;
}
.rpw-order-item-details { min-width: 0; }
.rpw-order-item-name { font-weight: 600; margin-bottom: 0.15rem; }
.rpw-order-item-meta { font-size: 0.85rem; color: var(--rpw-muted); }
.rpw-order-item-price {
  margin-left: auto;
  white-space: nowrap;
  font-weight: 700;
  color: var(--rpw-primary);
}
.rpw-total-charged {
  color: var(--rpw-primary);
  font-weight: 700;
  font-size: 1.15rem;
}
.rpw-spinner { color: var(--rpw-secondary); }

/* Footer */
.footer { background: transparent; color: var(--rpw-muted); border-top: 1px solid var(--rpw-border); padding-top: 2rem; margin-top: 3rem; }
.footer p { margin-bottom: 1rem; }
.footer .copyright {
  background: transparent;
  border-top: 1px solid var(--rpw-border);
  color: var(--rpw-muted);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  padding: 0.85rem 0 1.25rem;
}

/* Auth pages */
.rpw-auth-card { max-width: 420px; margin: 3rem auto; }

/* Toasts (add-to-cart, cart warnings/errors) - self-contained, theme-owned.
   Not built on Noty: Noty's own container positioning CSS (#noty_layout__*)
   ships purged from the minified legacy stylesheet (style.min.css keeps only
   #noty_layout__topRight), so Noty's 'topCenter' layout had no position: fixed
   rule and rendered as a plain block at the end of <body> - invisible unless
   scrolled all the way down. */
.rpw-toast-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: min(92vw, 380px);
  pointer-events: none;
}
.rpw-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.98));
  border: 1px solid var(--rpw-border);
  border-left: 4px solid var(--rpw-secondary);
  border-radius: 0.75rem;
  box-shadow: 0 16px 40px rgba(35, 28, 20, 0.18);
  color: var(--rpw-foreground);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-0.75rem);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.rpw-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.rpw-toast--success { border-left-color: var(--rpw-secondary); }
.rpw-toast--error { border-left-color: var(--rpw-primary); }
.rpw-toast--warning { border-left-color: var(--rpw-khaki); }
.rpw-toast__icon {
  flex-shrink: 0;
  font-size: 1.4rem;
  line-height: 1.4rem;
  color: var(--rpw-secondary);
}
.rpw-toast--error .rpw-toast__icon { color: var(--rpw-primary); }
.rpw-toast--warning .rpw-toast__icon { color: var(--rpw-copper); }
.rpw-toast__body { font-size: 0.9rem; }
.rpw-toast__body strong { color: var(--rpw-olive); }
