/* =========================================================
   WILDWEST FURNITURE — STYLESHEET
   Organized top to bottom in the order things appear on
   the page. Search for the section comment you need.
   ========================================================= */

/* ---------- Fonts ----------
   Fraunces: a serif with real character (used sparingly, for
   headings only) — feels handmade/carpentered, not corporate.
   Work Sans: clean humanist sans for body text/UI, so long
   paragraphs and buttons stay easy to read. */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Work+Sans:wght@400;500;600;700&display=swap');

/* ---------- Design tokens ----------
   Every color and spacing value on the site should trace back
   to one of these variables. Change a value here, it updates
   everywhere — that's the whole point of CSS variables. */
:root {
  /* Colors — pulled directly from the logo's blue (#0071C1), so the
     header/logo and the rest of the site read as one brand instead
     of two clashing ones. */
  --color-bg:        #F5F8FC;   /* cool off-white, matches the logo's backdrop */
  --color-surface:   #FFFFFF;   /* cards sit on pure white for lift */
  --color-ink:       #1C2B3A;   /* dark navy — used for text and dark sections */
  --color-ink-soft:  #5C6B7A;   /* muted slate for secondary text */
  --color-border:    #D7E5F3;   /* soft light-blue border */
  --color-primary:      #0071C1;   /* the logo's exact blue — main accent, all CTAs */
  --color-primary-dark: #045690;   /* hover state for primary */
  --color-whatsapp:     #1A8A4C;   /* WhatsApp buttons stay green on purpose — universally recognized regardless of brand palette */
  --color-whatsapp-dark:#147A3D;
  --color-tint:     #E6F1FB;   /* light blue tint — badges, trust-strip background */

  /* Type scale */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, sans-serif;

  /* Spacing scale — used for padding/margin/gaps consistently */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Layout */
  --max-width: 1200px;
  --radius: 8px;
}

/* ---------- Reset ----------
   Browsers ship with inconsistent default styling. This strips
   that out so we start from a predictable baseline. */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
}

/* Accessibility: visible focus outline for keyboard users.
   Never remove focus states without replacing them — invisible
   focus is a real barrier for keyboard/screen-reader users. */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Reusable layout helpers ---------- */
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: var(--space-lg);
}

section {
  padding: var(--space-2xl) var(--space-md);
}

section > * {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}
.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-secondary {
  background: transparent;
  border-color: var(--color-ink);
  color: var(--color-ink);
}
.btn-secondary:hover {
  background: var(--color-ink);
  color: white;
}

.btn-whatsapp {
  background: var(--color-whatsapp);
  color: white;
}
.btn-whatsapp:hover {
  background: var(--color-whatsapp-dark);
}

.btn-link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  align-self: center;
}

/* ---------- Top bar (social + tagline, scrolls away) ---------- */
.top-bar {
  background: var(--color-ink);
  color: rgba(255,255,255,0.85);
  font-size: 0.8rem;
}

.top-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.4rem var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.top-bar-tagline {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-bar-socials {
  display: flex;
  gap: 0.9rem;
  flex-shrink: 0;
}

.top-bar-socials a {
  display: inline-flex;
  align-items: center;
  color: rgba(255,255,255,0.85);
  transition: color 0.15s ease, transform 0.15s ease;
}

.top-bar-socials a:hover {
  transform: translateY(-1px);
}

.top-bar-socials svg {
  display: block;
}

.top-bar-socials a:hover {
  color: white;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-ink);
  white-space: nowrap;
}

.logo-img {
  height: 44px;
  width: auto;
  display: block;
}

.logo-img-footer {
  height: 60px;
  margin-bottom: var(--space-sm);
  /* The logo has dark charcoal text ("WILD") that would be nearly
     invisible directly on our dark navy footer — this white backing
     card keeps every part of the logo legible regardless of what's
     behind it. */
  background: white;
  padding: 10px 16px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
  font-weight: 500;
}

.nav-links a {
  position: relative;
  padding: 0.25rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.2s ease;
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  width: 100%;
}

/* ---------- Shop category dropdown (desktop only — see notes near .nav-toggle) ---------- */
.nav-item-dropdown {
  position: relative;
}

.dropdown-caret {
  font-size: 0.7em;
  margin-left: 0.15rem;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 12px 24px rgba(28,43,58,0.12);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 60;
}

.nav-item-dropdown:hover .dropdown-menu,
.nav-item-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--color-ink);
  white-space: nowrap;
}

.dropdown-menu a:hover {
  background: var(--color-tint);
  color: var(--color-primary);
}

.dropdown-menu a::after {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.phone-link {
  font-weight: 600;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-ink);
  margin: 5px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Cart count badge */
.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.cart-total-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-ink);
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--color-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  min-height: 60vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: white;
}

/* The stack of images. Each slide is absolutely positioned to fill
   the whole hero, sitting exactly on top of the others — only the
   one with .active shows, via opacity. This is how a fade-crossfade
   works: they're all always "there," just invisible. */
.hero-slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hero-slide.active {
  opacity: 1;
}

/* Dark gradient overlay so white text stays readable regardless of
   which photo is showing. Sits above the slides, below the content. */
.hero-slides::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28,43,58,0.55), rgba(28,43,58,0.25));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.hero-dots {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 0.5rem;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid white;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  padding: 0;
}

.hero-dot.active {
  background: white;
}

.eyebrow {
  display: inline-block;
  background: rgba(241, 231, 214, 0.15);
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  margin-bottom: var(--space-md);
}

.hero-subtext {
  font-size: 1.15rem;
  margin-bottom: var(--space-lg);
  opacity: 0.95;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* ---------- Categories ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}

.category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(28,43,58,0.08);
}

.category-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.category-card h3 {
  font-size: 1.1rem;
  margin: var(--space-sm) var(--space-sm) 0.25rem;
}

.category-card p {
  margin: 0 var(--space-sm);
  color: var(--color-ink-soft);
  font-size: 0.9rem;
}

.price-from {
  display: block;
  margin: 0.75rem var(--space-sm) var(--space-sm);
  font-weight: 600;
  color: var(--color-primary);
}

/* ---------- Product grid / cards ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
}

.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.product-card-body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.product-card-body h3 {
  font-size: 1.05rem;
}

.product-specs {
  color: var(--color-ink-soft);
  font-size: 0.85rem;
}

.product-price {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-top: auto;
  padding-top: 0.5rem;
}

/* ---------- Offers / sale pricing ---------- */
.price-original {
  display: inline-block;
  text-decoration: line-through;
  color: var(--color-ink-soft);
  font-size: 0.95rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.price-sale {
  margin-top: 0;
  padding-top: 0;
  margin-left: 0.5rem;
}

.sale-badge {
  display: inline-block;
  background: var(--color-whatsapp);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.product-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.product-card-actions .btn {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  flex: 1;
  justify-content: center;
}

/* ---------- Featured products / offers ---------- */
.offers {
  background: var(--color-tint);
}

/* ---------- Category filter bar (shop.html) ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-lg);
}

.filter-btn {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  border-color: var(--color-primary);
}

.filter-btn.active {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: white;
}

/* ---------- Quote form ---------- */
.quote-form {
  max-width: 640px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row-full {
  grid-column: 1 / -1;
}

.quote-form label {
  font-weight: 600;
  font-size: 0.9rem;
}

.quote-form input,
.quote-form select,
.quote-form textarea {
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--color-surface);
  color: var(--color-ink);
}

.quote-form textarea {
  resize: vertical;
}

.quote-form button[type="submit"] {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: var(--space-sm);
}

@media (max-width: 600px) {
  .quote-form {
    grid-template-columns: 1fr;
  }
}

/* ---------- Cart page ---------- */
.cart-row {
  display: grid;
  grid-template-columns: 2fr auto auto auto;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.cart-row-info h3 {
  font-size: 1rem;
}

.cart-row-info p {
  color: var(--color-ink-soft);
  font-size: 0.85rem;
}

.cart-row-qty {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cart-row-qty button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: white;
  cursor: pointer;
  font-size: 1rem;
}

.cart-row-total {
  font-weight: 600;
  white-space: nowrap;
}

.cart-row-remove {
  background: none;
  border: none;
  color: var(--color-ink-soft);
  cursor: pointer;
  font-size: 1rem;
}

.cart-row-remove:hover {
  color: var(--color-primary);
}

#cart-empty {
  text-align: center;
  padding: var(--space-xl) 0;
  color: var(--color-ink-soft);
}

.cart-summary {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 2px solid var(--color-ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.cart-total-label {
  font-size: 1.25rem;
}

.cart-total-label span {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-primary);
}

@media (max-width: 600px) {
  .cart-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "info remove"
      "qty total";
  }
  .cart-row-info { grid-area: info; }
  .cart-row-remove { grid-area: remove; }
  .cart-row-qty { grid-area: qty; }
  .cart-row-total { grid-area: total; text-align: right; }
}

/* ---------- Custom quote CTA (homepage) ---------- */
.quote-cta {
  background: var(--color-ink);
  color: white;
  text-align: center;
}

.quote-cta-content {
  max-width: 560px;
}

.quote-cta h2 {
  margin-bottom: var(--space-sm);
}

.quote-cta p {
  color: rgba(255,255,255,0.75);
  margin-bottom: var(--space-lg);
}

/* ---------- Trust strip ---------- */
.trust-strip {
  background: var(--color-tint);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
}

.trust-item h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  color: var(--color-primary-dark);
}

.trust-item p {
  color: var(--color-ink-soft);
  font-size: 0.95rem;
}

/* ---------- Workshop CTA ---------- */
.workshop {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.workshop-image {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Embedded Google Map (replaces the workshop photo once config.js is set) */
.map-frame {
  width: 100%;
  height: 360px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

#contact-map {
  max-width: 720px;
  margin-top: var(--space-lg);
}

.workshop-content h2 {
  margin-bottom: var(--space-sm);
}

.workshop-content p {
  color: var(--color-ink-soft);
  margin-bottom: var(--space-lg);
}

/* ---------- Newsletter ---------- */
.newsletter {
  background: var(--color-ink);
  color: white;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.newsletter h2 {
  margin-bottom: 0.5rem;
}

.newsletter p {
  opacity: 0.9;
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
}

.newsletter-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.newsletter-form .form-message {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-ink);
  color: rgba(255,255,255,0.85);
  padding: var(--space-xl) var(--space-md) var(--space-md);
}

.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-lg);
  padding-bottom: var(--space-lg);
}

.footer-brand .logo {
  color: white;
  margin-bottom: var(--space-sm);
  display: block;
}

.footer-brand p {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  max-width: 320px;
}

.footer-links h4 {
  color: white;
  font-size: 0.95rem;
  margin-bottom: var(--space-sm);
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: var(--space-md);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

/* =========================================================
   RESPONSIVE — mobile-first overrides at the bottom.
   Below 800px: stack columns, show hamburger nav.
   ========================================================= */
@media (max-width: 800px) {
  .nav-links,
  .nav-actions .phone-link {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
    gap: var(--space-sm);
  }

  /* On mobile there's no hover, so the dropdown just becomes a
     permanently-visible sub-list under "Shop" instead of a flyout. */
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
    margin-top: 0.25rem;
  }

  .cart-total-header {
    display: none;
  }

  .top-bar-tagline {
    display: none;
  }

  .workshop,
  .newsletter {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}
