:root {
  scrollbar-width: thin;
  scrollbar-color: var(--crema, #c08a3e) rgba(46, 43, 38, 0.72);
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: rgba(46, 43, 38, 0.72);
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--crema, #c08a3e) 84%, var(--cream, #f7f4ee) 16%),
    var(--crema, #c08a3e)
  );
  background-clip: padding-box;
  box-shadow: inset 0 1px 0 rgba(247, 244, 238, 0.28), inset 0 -1px 2px rgba(26, 24, 21, 0.2);
  transition: filter 0.14s ease;
}

::-webkit-scrollbar-thumb:hover { filter: brightness(1.1); }
::-webkit-scrollbar-thumb:active { filter: brightness(1.16) saturate(1.05); }
::-webkit-scrollbar-corner { background: rgba(46, 43, 38, 0.72); }

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 32px 5%;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: padding 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

/* The glass stays behind the controls and menu panels. */
.site-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(46, 43, 38, 0.76);
  backdrop-filter: blur(20px) saturate(190%) brightness(110%);
  -webkit-backdrop-filter: blur(20px) saturate(190%) brightness(110%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.site-nav.scrolled::before { opacity: 1; }

.site-nav.scrolled {
  padding-top: 16px !important;
  padding-bottom: 16px !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.1), 0 12px 40px rgba(0, 0, 0, 0.2) !important;
}

.site-nav > * { position: relative; z-index: 1; }
.site-nav > .glass-filter-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

@media (min-width: 821px) {
  .site-nav::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 249, 234, 0.055), rgba(255, 255, 255, 0.008) 48%, rgba(255, 249, 234, 0.025));
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .site-nav.scrolled::after { filter: url(#smiths-glass-displacement); opacity: 1; }
  @media (prefers-reduced-motion: reduce) {
    .site-nav::after { transition: none; }
  }
}

.site-nav .nav-mark {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  line-height: 0;
  text-decoration: none;
}

.site-nav .nav-mark-logo {
  display: block;
  width: 92px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1799 / 634;
  transition: opacity 0.2s ease;
}

.site-nav .nav-mark:hover .nav-mark-logo { opacity: 0.9; }

/* Service forms keep a steady nav at the top of the page. */
.page-shell:has(> .form-container .form-page-title) > .site-nav {
  --nav-offset: 0;
  position: relative !important;
  z-index: 100;
  padding: 32px 5%;
  transition: none !important;
}

.page-shell:has(> .form-container .form-page-title) > .site-nav::before {
  display: none;
}

.page-shell:has(> .form-container .form-page-title) > .site-nav.scrolled {
  padding-top: 32px !important;
  padding-bottom: 32px !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}

.page-shell:has(> .form-container .form-page-title) > .site-nav + .form-container {
  margin-top: 0 !important;
}

.page-shell:has(> .form-container .form-page-title) > .site-nav .nav-cta {
  padding: 0;
}

.detail-description a:link,
.detail-description a:visited,
.detail-description a:hover,
.detail-description a:active {
  color: var(--crema, #c08a3e);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.detail-description a:focus-visible {
  outline: 2px solid var(--crema, #c08a3e);
  outline-offset: 3px;
  border-radius: 2px;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 140px 5% 28px;
  border-top: 1px solid rgba(247, 244, 238, 0.08);
  background: var(--surface, #2e2b26);
}

.footer-inner { max-width: 1240px; margin: 0 auto; }
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 48px; padding-bottom: 44px; }
.site-footer a.footer-logo { display: inline-flex; align-items: center; margin-bottom: 14px; text-decoration: none; }
.site-footer .footer-logo-image { display: block; width: 160px; max-width: 100%; height: auto; aspect-ratio: 1799 / 634; }
.footer-tagline { max-width: 320px; margin: 0 0 22px; color: var(--ink-soft, #a39b90); font-size: 13.5px; line-height: 1.65; }
.footer-social { display: flex; gap: 12px; }
.footer-social a { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid rgba(247, 244, 238, 0.15); border-radius: 50%; color: var(--ink-soft, #a39b90); transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease; }
.footer-social a:hover { border-color: var(--crema, #c08a3e); color: var(--crema, #c08a3e); transform: translateY(-2px); }
.footer-social svg { width: 16px; height: 16px; }
.footer-heading { margin: 0 0 18px; color: var(--cream, #f7f4ee); font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.footer-col ul { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.footer-col a { color: var(--ink-soft, #a39b90); font-size: 13.5px; line-height: 1.5; text-decoration: none; transition: color 0.2s ease; }
.footer-col a:hover { color: var(--crema, #c08a3e); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 26px; border-top: 1px solid rgba(247, 244, 238, 0.08); }
.footer-bottom span { color: var(--ink-soft, #a39b90); font-size: 12px; letter-spacing: 0.02em; }
.footer-legal {
  position: static;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  width: auto;
  margin: 0;
  padding: 0;
}
.footer-legal a { color: var(--ink-soft, #a39b90); font-size: 12px; text-decoration: none; }
.footer-legal a:hover { color: var(--crema, #c08a3e); }

.form-privacy-notice {
  margin: 10px 0 0;
  color: var(--ink-soft, #a39b90);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
.form-privacy-notice a { color: var(--crema, #c08a3e); text-underline-offset: 3px; }
.form-card .form-privacy-notice { color: var(--text-gray, #515151); }
.form-card .form-privacy-notice a { color: #8a5b1f; }
.form-card.submitted > .form-privacy-notice { display: none; }

.cart-added-toast {
  position: fixed;
  z-index: 89;
  right: 24px;
  bottom: 88px;
  width: max-content;
  max-width: min(360px, calc(100vw - 32px));
  padding: 13px 17px 13px 29px;
  overflow-wrap: anywhere;
  border: 1px solid rgba(247, 244, 238, 0.2);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(63, 56, 46, 0.9), rgba(35, 32, 28, 0.92));
  -webkit-backdrop-filter: blur(18px) saturate(175%);
  backdrop-filter: blur(18px) saturate(175%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 12px 32px rgba(0, 0, 0, 0.28);
  color: var(--cream, #f7f4ee);
  font: 500 13px/1.4 var(--font-body, 'Inter', sans-serif);
  opacity: 0;
  visibility: hidden;
  transform: translateY(7px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  pointer-events: none;
}

.cart-added-toast::before {
  content: "";
  position: absolute;
  top: 19px;
  left: 15px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--crema, #c08a3e);
}

.cart-added-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
}

@media (max-width: 620px) {
  .cart-added-toast { right: 16px; bottom: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  .cart-added-toast { transition: none; }
}

.form-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--crema, #c08a3e);
  color: #1a1815;
  font: 600 14px var(--font-body, 'Inter', sans-serif);
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}
.form-home-link[hidden] { display: none; }
.form-home-link:hover { background: #d09849; transform: translateY(-1px); }
.form-home-link:focus-visible { outline: 3px solid var(--crema, #c08a3e); outline-offset: 3px; }

@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .site-nav { padding: 20px; }
  .site-nav.scrolled { padding-top: 12px !important; padding-bottom: 12px !important; }
  .site-nav .nav-mark-logo { width: clamp(70px, 22.6vw, 88px); }
  .page-shell:has(> .form-container .form-page-title) > .site-nav { padding: 20px; }
  .page-shell:has(> .form-container .form-page-title) > .site-nav.scrolled {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
  }
  .site-nav .nav-links { display: none; }
  .footer-about, .footer-services { display: none; }
}

@media (max-width: 560px) {
  .site-footer { padding: 56px 6% 24px; }
  .footer-top { grid-template-columns: 1fr; gap: 34px; }
  .footer-bottom { align-items: flex-start; flex-direction: column; }
  .site-footer .footer-logo-image { width: 148px; }
}

/* Product detail gallery sizing lives in a served stylesheet so it updates
   without waiting for the server's cached HTML template to restart. */
.detail-grid-roaster { row-gap: 0; }
.detail-grid-roaster > .roaster-gallery-section {
  grid-column: 1 / -1;
  justify-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(247, 244, 238, 0.25);
}
.roaster-gallery-section .roaster-gallery-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Auto margins offset a stage wider than its parent; let flex centering apply. */
  margin-inline: 0;
  width: min(1260px, calc(100vw - 40px));
  height: min(788px, calc(100svh - 80px));
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
}
.roaster-gallery-section .roaster-gallery-stage > img {
  display: block;
  flex: none;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-width: min(calc(100% - 32px), 1170px);
  max-height: min(calc(100% - 32px), 698px);
  object-fit: contain;
  border-radius: 14px;
}
.roaster-gallery-section .detail-gallery {
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: min(100%, calc(100vw - 40px));
  gap: 8px;
}
.roaster-gallery-section .detail-gallery-rail {
  flex: 0 1 auto;
  width: max-content;
  max-width: min(520px, calc(100vw - 140px));
  min-width: 0;
  justify-content: safe center;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.roaster-gallery-section .detail-gallery-rail::-webkit-scrollbar { display: none; }
.roaster-gallery-section .detail-gallery-scroll { flex: 0 0 44px; }
.roaster-gallery-section .detail-gallery-thumb {
  flex-basis: 58px;
  width: 58px;
  height: 58px;
}

@media (max-width: 800px) {
  .detail-grid-roaster { row-gap: 28px; }
  .detail-grid-roaster > .roaster-gallery-section { margin-top: 0; }
  .roaster-gallery-section .roaster-gallery-stage {
    width: min(945px, calc(100vw - 24px));
    height: min(608px, calc(100svh - 80px));
    max-height: none;
    aspect-ratio: auto;
  }
  .roaster-gallery-section .roaster-gallery-stage > img {
    max-width: min(calc(100% - 24px), 855px);
    max-height: min(calc(100% - 24px), 518px);
    border-radius: 10px;
  }
  .roaster-gallery-section .detail-gallery {
    width: max-content;
    max-width: min(100%, calc(100vw - 24px));
  }
  .roaster-gallery-section .detail-gallery-rail { max-width: calc(100vw - 136px); }
}
