/* ============================================================
   ELJIAH — theme.css
   Palette + all visual behavior. Ports 1:1 into Shopify assets/.
   ============================================================ */

:root {
  /* Core palette */
  --bg:        #ffffff;   /* white background            */
  --ink:       #000000;   /* black primary text          */
  --muted:     #4a4a4a;   /* dark grey secondary text    */
  --line:      #ececec;   /* hairline dividers           */

  /* Accents */
  --green:     #17a34a;   /* green accent                */
  --orange:    #f5811f;   /* orange accent               */

  /* Popout (chat-box) */
  --offwhite:  #f7f7f4;   /* off-white popout background  */
  --outline:   #2a2a2a;   /* popout outline (dark grey)   */
  --popout-ink: var(--muted);

  /* Layout */
  --header-h: 64px;
  --page-x: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.muted { color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--page-x);
  color: var(--ink);            /* everything sits on white now */
}
.brand {
  font-weight: 800; letter-spacing: .28em; font-size: 15px;
  text-decoration: none; color: inherit;
}
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a {
  color: inherit; text-decoration: none; font-size: 12px;
  letter-spacing: .18em; text-transform: uppercase;
}
.cart-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }

/* Services dropdown */
.nav-item { position: relative; display: flex; align-items: center; }
.nav-top::after { content: "▾"; font-size: 8px; margin-left: 6px; vertical-align: middle; }
/* invisible bridge so hover survives the gap to the panel */
.nav-item::before { content: ""; position: absolute; top: 100%; left: -8px; right: -8px; height: 18px; }
.subnav {
  position: absolute; top: calc(100% + 14px); left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--offwhite); border: 1px solid var(--outline);
  display: flex; flex-direction: column; min-width: 176px;
  box-shadow: 0 16px 34px rgba(0,0,0,.14);
  opacity: 0; visibility: hidden; z-index: 50;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.nav-item:hover .subnav, .nav-item:focus-within .subnav {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.subnav a {
  display: block; padding: 11px 16px; text-align: left; white-space: nowrap;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
}
.subnav a + a { border-top: 1px solid rgba(0,0,0,.08); }
.subnav a:first-child:hover { color: var(--green); }   /* accent */
.subnav a:last-child:hover  { color: var(--orange); }  /* accent */

/* ---------- Gallery ---------- */
.gallery-stage {
  position: relative;
  min-height: 100vh;
  background: var(--bg);         /* framed on a white background */
}
.gallery-pin {
  position: relative;
  min-height: 100vh; width: 100%;
  display: flex; align-items: center; justify-content: center;
}

/* Frameless gallery on white (+10% larger than the framed version) */
.gallery-frame {
  position: relative;
  width: min(704px, 73vw);
  aspect-ratio: 3 / 2;
}

/* Carousel (horizontal, one slide at a time), frameless */
.carousel { position: absolute; inset: 0; overflow: hidden; }
.carousel__track {
  display: flex; height: 100%; width: 300%;
  transition: transform .9s var(--ease);
  will-change: transform;
}
.slide { margin: 0; flex: 0 0 33.3333%; height: 100%; }
.slide img { width: 100%; height: 100%; object-fit: cover; }

.carousel__dots {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: -26px; z-index: 5;
  display: flex; gap: 8px;
}
.carousel__dots button {
  width: 22px; height: 3px; border: 0; padding: 0; cursor: pointer;
  background: rgba(0,0,0,.22); transition: background .3s;
}
.carousel__dots button[aria-current="true"] { background: var(--orange); }

/* Scroll cue */
.scroll-cue {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 7; display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted);
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
}
.scroll-cue i {
  width: 1px; height: 34px; background: currentColor;
  animation: cue 1.8s var(--ease) infinite;
  transform-origin: top;
}
@keyframes cue { 0%,100%{transform:scaleY(.35);opacity:.4} 50%{transform:scaleY(1);opacity:1} }

/* ---------- Products ---------- */
.products {
  position: relative; z-index: 10; background: var(--bg);
  padding: clamp(72px, 12vh, 160px) var(--page-x) clamp(72px, 12vh, 140px);
}
.product-row {
  display: grid;
  grid-template-columns: repeat(var(--count, 4), 1fr);
  gap: clamp(20px, 3vw, 56px);
  align-items: end;                 /* baseline the products so prices line up */
  max-width: 1500px; margin: 0 auto;
}

.product { position: relative; text-align: center; }
.product-media {
  position: relative;
  height: clamp(180px, 24vw, 320px); /* equal cells → prices align */
}
.product-media img {
  width: 100%; height: 100%; object-fit: contain;  /* cutout shots on white */
  transition: transform .55s var(--ease), filter .5s var(--ease);
}
.product:hover .product-media img { transform: scale(1.05); }

/* Price centered below product */
.product-price {
  margin-top: 22px;
  font-size: clamp(15px, 1.2vw, 19px);
  font-weight: 700;                 /* bold pricing */
  letter-spacing: .02em; color: var(--ink);
}
.product-price .tag { display: none; }   /* clean, price-only per reference */

/* ---------- Popout (creme chat-box) ---------- */
.popout {
  position: fixed; z-index: 60; width: 320px; max-width: 78vw;
  background: var(--offwhite);
  color: var(--popout-ink);
  border: 5px solid var(--outline);
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 14px 40px rgba(0,0,0,.18);
  padding: 14px 16px 16px;
  opacity: 0; pointer-events: none;
  transform: translateY(6px);
  font-family: "Courier New", ui-monospace, monospace; /* word-processor feel */
}

.popout.is-open { pointer-events: none; }

/* Dial-up render: line-by-line reveal (steps), no brightness twitch */
.popout.is-rendering {
  animation: dialupReveal .42s steps(16, end) forwards;
}
@keyframes dialupReveal {
  from { clip-path: inset(0 0 100% 0); opacity: 1; transform: translateY(0); }
  to   { clip-path: inset(0 0 0 0);   opacity: 1; transform: translateY(0); }
}
/* opened, steady state */
.popout.is-open:not(.is-rendering) {
  opacity: 1; transform: translateY(0); clip-path: inset(0);
  transition: opacity .18s var(--ease);
}

/* CRT scanline overlay visible only during render */
.popout__scan {
  position: absolute; inset: 0; border-radius: 6px; pointer-events: none;
  opacity: 0;
  background:
    repeating-linear-gradient(0deg,
      rgba(0,0,0,.08) 0px, rgba(0,0,0,.08) 1px,
      transparent 1px, transparent 3px);
}
.popout.is-rendering .popout__scan {
  animation: scan .42s steps(10,end);
}
@keyframes scan {
  0%   { opacity: .9; background-position: 0 0; }
  100% { opacity: 0; background-position: 0 40px; }
}

/* Text reveals one full line at a time (JS drives --lines via clip-path) */
.popout__inner {
  line-height: 20px;                 /* fixed line box so line-stepping is exact */
  clip-path: inset(0 0 var(--hide, 0px) 0);
}
.popout__name {
  font-weight: 700; font-size: 14px; letter-spacing: .04em;
  color: var(--green);                 /* green accent */
  line-height: 20px; text-transform: uppercase;
  padding-bottom: 6px; margin-bottom: 8px;
  border-bottom: 2px solid var(--orange);   /* orange accent divider */
}
.popout__desc {
  font-size: 12.5px; line-height: 20px; color: var(--popout-ink);
  white-space: normal;
}

/* ---------- Cart button / badge ---------- */
.cart-btn {
  font: inherit; background: none; border: 0; cursor: pointer; color: var(--ink);
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px; padding: 0;
}
.cart-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--orange); color: #fff; font-size: 10px; letter-spacing: 0;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Product detail dropdown (accordion) ---------- */
.pdp {
  overflow: hidden; max-height: 0;
  transition: max-height .5s var(--ease);
  max-width: 1500px; margin: 0 auto;
}
.pdp.open { max-height: 660px; }
.pdp__inner {
  display: grid; grid-template-columns: 300px 1fr; gap: clamp(24px, 4vw, 56px);
  padding: 44px 0 12px; margin-top: 40px; border-top: 1px solid var(--line);
}
.pdp__media { display: flex; align-items: flex-start; justify-content: center; }
.pdp__media img { max-height: 320px; width: auto; object-fit: contain; }
.pdp__name { font-size: clamp(20px, 2vw, 26px); text-transform: uppercase; letter-spacing: .03em; }
.pdp__price { font-weight: 700; font-size: 19px; margin: 8px 0 18px; }
.pdp__desc { color: var(--muted); max-width: 48ch; line-height: 1.6; margin-bottom: 24px; }
.pdp__label {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.pdp__label .req { color: var(--orange); }
.sizes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.size {
  min-width: 46px; height: 42px; padding: 0 12px; font: inherit; font-size: 13px;
  border: 1px solid var(--outline); background: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .2s, background .2s, color .2s;
}
.size:hover { border-color: var(--green); }
.size.selected { background: var(--ink); color: #fff; border-color: var(--ink); }
.pdp__actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--outline); }
.qty button { width: 40px; height: 44px; border: 0; background: #fff; cursor: pointer; font-size: 18px; line-height: 1; }
.qty button:hover { color: var(--green); }
.qty span { width: 42px; text-align: center; font-weight: 700; }
.btn-add {
  height: 44px; padding: 0 28px; border: 0; cursor: pointer;
  background: var(--green); color: #fff; font: inherit; font-size: 12px;
  letter-spacing: .16em; text-transform: uppercase; transition: background .25s;
}
.btn-add:hover { background: #128a3d; }
.btn-add:disabled { background: #cfcfcf; cursor: not-allowed; }
.pdp__close {
  background: none; border: 0; cursor: pointer; color: var(--muted);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; text-decoration: underline;
}
.product.is-active .product-media img { transform: scale(1.05); }
.product.is-active::after { width: 42px !important; }

/* ---------- Cart drawer ---------- */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 70;
  opacity: 0; transition: opacity .3s var(--ease);
}
.cart-overlay.show { opacity: 1; }
.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(410px, 92vw);
  background: var(--bg); z-index: 71; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .38s var(--ease);
  box-shadow: -20px 0 50px rgba(0,0,0,.18);
}
.cart-drawer.open { transform: translateX(0); }
.cart-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 24px; border-bottom: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: .18em; font-size: 13px;
}
.cart-close { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--ink); }
.cart-items { flex: 1; overflow-y: auto; padding: 4px 24px; }
.cart-empty { padding: 48px 24px; color: var(--muted); text-align: center; letter-spacing: .06em; }
.cart-line {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px;
  padding: 18px 0; border-bottom: 1px solid var(--line); align-items: start;
}
.cart-line img { height: 64px; width: 64px; object-fit: contain; background: var(--offwhite); }
.cart-line__name { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.cart-line__meta { color: var(--muted); font-size: 11px; margin: 4px 0 8px; }
.qty--sm button { width: 28px; height: 28px; font-size: 14px; }
.qty--sm span { width: 30px; font-size: 12px; }
.cart-line__right { text-align: right; }
.cart-line__price { font-weight: 700; font-size: 13px; }
.cart-line__remove {
  display: block; margin-top: 8px; margin-left: auto; background: none; border: 0;
  color: var(--muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; text-decoration: underline;
}
.cart-line__remove:hover { color: var(--orange); }
.cart-foot { padding: 20px 24px 24px; border-top: 1px solid var(--line); }
.cart-subtotal {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 16px;
}
.cart-subtotal span:last-child { font-weight: 700; font-size: 16px; }
.btn-checkout {
  width: 100%; height: 48px; border: 0; cursor: pointer; background: var(--ink); color: #fff;
  font: inherit; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; transition: background .25s;
}
.btn-checkout:hover { background: var(--green); }
.cart-note { text-align: center; color: var(--muted); font-size: 10px; margin: 12px 0 0; letter-spacing: .1em; text-transform: uppercase; }

@media (max-width: 720px) {
  .pdp__inner { grid-template-columns: 1fr; }
  .pdp.open { max-height: 1100px; }
}

/* ---------- Footer ---------- */
.site-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px var(--page-x); border-top: 1px solid var(--line);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
}

/* ---------- Responsive: collapse dense rows on small screens ---------- */
@media (max-width: 720px) {
  .product-row { grid-template-columns: repeat(min(var(--count,2), 2), 1fr); }
  .product-row[data-count="1"] { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .carousel__track { transition: none; }
  .popout.is-rendering { animation: none; }
  .scroll-cue i { animation: none; }
}
