/* ============================================================
   STEELO — Design Tokens
   ============================================================ */
:root {
  --sand:     #F0EAE1;
  --sand-100: #F5F0EB;
  --sand-200: #EDE3D8;
  --sand-300: #DFD2C5;
  --sand-400: #C9B9A9;
  --ink:      #1A1715;
  --ink-800:  #2D2926;
  --ink-600:  #433F3C;
  --ink-500:  #6B6460;
  --ink-400:  #8C7F77;
  --ink-300:  #A09890;
  --ink-200:  #C9BBB5;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--sand);
}

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: 'Montserrat', sans-serif;
  -webkit-font-smoothing: antialiased;
  /* Do NOT set overflow-x: hidden here — it fails to clip fixed elements.
     Instead the #page-wrap div clips content, and the cart lives inside
     a fixed viewport container so it never creates horizontal overflow. */
}

::selection { background: var(--sand-300); }

/* ============================================================
   PAGE WRAPPER — clips all scrollable content
   ============================================================ */
#page-wrap {
  overflow-x: hidden;
  position: relative;
}

/* ============================================================
   NAVBAR
   ============================================================ */
#navbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2.5rem;
  transition: background 0.5s, backdrop-filter 0.5s;
}
#navbar.scrolled {
  background: rgba(240, 234, 225, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--sand-300);
}

/* desktop nav links group */
.nav-desktop { display: flex; align-items: center; gap: 2.5rem; }

/* animated underline */
.nav-link { position: relative; text-decoration: none; }
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 0.3s;
}
.nav-link:hover::after { width: 100%; }

/* ============================================================
   HERO
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 1s ease forwards; }
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.3s; opacity: 0; }
.delay-3 { animation-delay: 0.5s; opacity: 0; }
.delay-4 { animation-delay: 0.7s; opacity: 0; }

@keyframes scrollPulse {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}
.scroll-line { animation: scrollPulse 2s ease-in-out infinite; }

.hero-display {
  font-family: 'Cormorant', Georgia, serif;
  font-weight: 300;
  line-height: 0.95;
  font-size: clamp(3.5rem, 7vw, 7rem);
  color: var(--ink);
}

/* ============================================================
   MARQUEE
   ============================================================ */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-track { animation: marquee 22s linear infinite; display: flex; width: max-content; }

/* ============================================================
   SECTION UTILITIES
   ============================================================ */
.section-line { width: 2.5rem; height: 1px; background: var(--ink); margin-bottom: 1.5rem; }

.stat-num {
  font-family: 'Cormorant', Georgia, serif;
  font-weight: 300;
  font-size: 2.5rem;
  color: var(--sand-400);
  line-height: 1;
}
.stat-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-top: 0.25rem;
}

/* ============================================================
   PRODUCT GRID
   ============================================================ */
.product-card { cursor: pointer; }

.product-card .img-primary { transition: opacity 0.6s ease; }

.product-card .img-secondary {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.product-card:hover .img-primary  { opacity: 0; }
.product-card:hover .img-secondary { opacity: 1; }

.product-card .card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26,23,21,0.72) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.5rem;
}
.product-card:hover .card-overlay { opacity: 1; }

/* ============================================================
   PRODUCT MODAL
   ============================================================ */
#product-modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(26,23,21,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
#product-modal.active {
  opacity: 1;
  pointer-events: all;
}

#modal-images-container {
  position: absolute; inset: 0;
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: zoom-in;
}

/* Modal thumbnail strip */
.modal-thumb {
  transition: opacity 0.2s;
  flex: 1;
  border: none;
  padding: 4px;
  box-sizing: border-box;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  height: 100px;
  border-right: 1px solid var(--sand-300);
  background: var(--sand-200);
}
.modal-thumb:last-child { border-right: none; }
.modal-thumb.active { opacity: 1; }
.modal-thumb.active::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--ink);
}
.modal-thumb:not(.active) { opacity: 0.45; }
.modal-thumb:hover:not(.active) { opacity: 0.75; }

/* ============================================================
   CART — lives inside #cart-root (fixed + overflow:hidden)
   so it never creates horizontal page overflow
   ============================================================ */
#cart-root {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;   /* passthrough when closed */
  overflow: hidden;       /* clips the sidebar transform */
}
#cart-root.active { pointer-events: all; }

#cart-overlay {
  position: absolute; inset: 0;
  background: rgba(26,23,21,0.4);
  opacity: 0;
  transition: opacity 0.35s;
  cursor: pointer;
}
#cart-root.active #cart-overlay { opacity: 1; }

#cart-sidebar {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 440px;
  max-width: 100vw;
  background: var(--sand-100);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 1px solid var(--sand-300);
  pointer-events: all;
}
#cart-root.active #cart-sidebar { transform: translateX(0); }

/* ============================================================
   INQUIRY MODAL
   ============================================================ */
#inquiry-modal {
  position: fixed; inset: 0; z-index: 70;
  display: none; align-items: center; justify-content: center;
  background: rgba(26,23,21,0.65);
  backdrop-filter: blur(6px);
  padding: 1.5rem;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.qty-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--sand-300);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  background: transparent;
}
.qty-btn:hover { background: var(--sand-200); border-color: var(--ink-300); }

.form-input {
  width: 100%; padding: 0.75rem 1rem;
  border: 1px solid var(--sand-300);
  background: transparent;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  color: var(--ink);
  transition: border-color 0.2s;
  outline: none;
  box-sizing: border-box;
}
.form-input:focus { border-color: var(--ink); }
.form-input::placeholder { color: var(--ink-300); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  width: 100%; padding: 1rem;
  background: var(--ink);
  color: var(--sand-100);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--ink-800); }

.btn-outline {
  width: 100%; padding: 1rem;
  background: transparent;
  color: var(--ink);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--ink);
  transition: background 0.2s;
}
.btn-outline:hover { background: var(--sand-200); }

/* ============================================================
   CHECKOUT MODAL
   ============================================================ */
#checkout-modal {
  position: fixed; inset: 0; z-index: 70;
  display: none; align-items: center; justify-content: center;
  background: rgba(26,23,21,0.65);
  backdrop-filter: blur(6px);
  padding: 1.5rem;
}

.checkout-panel {
  width: 100%; max-width: 560px;
  max-height: 90vh;
  background: var(--sand-100);
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}

.checkout-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid var(--sand-300);
  flex-shrink: 0;
}
.checkout-header button {
  background: none; border: none; cursor: pointer;
  padding: 0.25rem; color: var(--ink); margin-top: 0.25rem;
}

.checkout-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--ink-400);
  margin: 0 0 0.75rem;
}

.checkout-steps {
  display: flex; align-items: center; gap: 0.4rem;
}
.checkout-step-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--sand-300); transition: background 0.3s;
}
.checkout-step-dot.active { background: var(--ink); }
.checkout-step-line {
  width: 28px; height: 1px; background: var(--sand-300);
}

.checkout-body {
  flex: 1; overflow-y: auto;
  padding: 1.75rem 2rem 2rem;
}

.checkout-title {
  font-family: 'Cormorant', Georgia, serif;
  font-weight: 300; font-size: 2rem;
  color: var(--ink); margin: 0 0 1.75rem; line-height: 1.1;
}

.checkout-section-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.6rem; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--ink-400);
  margin: 0 0 0.875rem;
}

.checkout-field {
  display: flex; flex-direction: column; gap: 0.4rem;
  margin-bottom: 1rem;
}
.checkout-field label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--ink-500);
}

.checkout-field-row {
  display: flex; gap: 0.75rem; margin-bottom: 0;
}
.checkout-field-row .checkout-field { margin-bottom: 1rem; }

.checkout-total-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 1rem 0; border-top: 1px solid var(--sand-300);
  margin-top: 0.5rem;
  font-family: 'Cormorant', Georgia, serif; font-weight: 300;
  font-size: 1.5rem; color: var(--ink);
}
.checkout-total-row span:first-child {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-400);
  font-size: 0.65rem;
}

.checkout-note {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300; font-size: 0.78rem;
  line-height: 1.7; color: var(--ink-400);
  margin: 1rem 0 0;
}

.checkout-card-preview {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem; background: var(--sand-200);
  margin-bottom: 1.5rem;
}

.checkout-card-input {
  font-family: 'Montserrat', monospace;
  letter-spacing: 0.1em;
}

.checkout-confirm-icon {
  width: 3rem; height: 3rem;
  border: 1px solid var(--ink); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem;
}

@media (max-width: 768px) {
  #checkout-modal { padding: 0; align-items: flex-end; }
  .checkout-panel { max-width: 100%; max-height: 92vh; border-radius: 0; }
  .checkout-field-row { flex-direction: column; gap: 0; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  #products-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 768px) {
  /* Product modal — stack vertically */
  #product-modal > div { flex-direction: column !important; }
  #modal-img-panel { width: 100% !important; height: 100vw; min-height: 360px; flex: none !important; }
  #modal-images-container > div { padding: 0 !important; }
  #modal-images-container img { object-fit: cover !important; cursor: zoom-in; }
  #product-modal > div > div:last-child { width: 100% !important; padding: 1.75rem 1.5rem 2rem !important; overflow-y: auto; }
  #modal-name { font-size: 2.25rem !important; }

  #navbar { padding: 1.25rem 1.5rem; }
  .nav-desktop { display: none; }
  #hero { flex-direction: column !important; min-height: unset !important; }
  #hero > .hero-left  { width: 100% !important; padding: 6rem 1.5rem 2rem !important; }
  #hero > .hero-right { display: none !important; }
  #hero-mobile-img    { display: block !important; width: 100% !important; }
  #about { padding: 4rem 1.5rem !important; }
  #about .philosophy-grid { grid-template-columns: 1fr !important; gap: 2.5rem !important; }
  .craft-grid { grid-template-columns: 1fr !important; }
  .craft-grid > div:last-child { padding: 3rem 1.5rem !important; }
  footer { padding: 2.5rem 1.5rem !important; }
  footer .footer-row { flex-direction: column !important; }
  footer .footer-links { gap: 1.5rem !important; }
  #cart-sidebar { width: 100%; }
}
@media (max-width: 640px) {
  #products-grid { grid-template-columns: 1fr !important; }
  #collection .collection-header { padding: 0 1.5rem 2rem !important; }
  #collection .grid-wrap { padding: 0 !important; }
  #hero img { object-position: center center !important; }
}
