/* ==========================================================================
   Bsellsdigis storefront
   ========================================================================== */

:root {
  --black: #000;
  --white: #fff;
  --cream: #ecebe7;          /* announcement bar */
  --muted: #c4c4c4;          /* secondary text, sub-menu links */
  --faint: #8a8a8a;
  --line: #262626;
  --skeleton: #141414;
  --danger: #ff6b6b;

  --font-mono: "Courier New", Courier, monospace;
  --font-brand: "Exo 2", "Arial Black", Arial, sans-serif;

  --header-h: 58px;
  --gutter: 16px;
  --card-w: 44vw;
  --card-ratio: 1 / 2;       /* tall white product tiles, as in the reference */
  --card-zoom: 1.3;          /* enlarges photos inside the tile; 1 shows the whole photo */
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body:has(dialog[open]) { overflow: hidden; }

img { display: block; max-width: 100%; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--white);
  color: var(--black);
}
.skip-link:focus { top: 8px; }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--black);
}

.header__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-h);
  padding: 0 2px;
}

.header__actions { display: flex; justify-self: end; }

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}

.brand {
  font-family: var(--font-brand);
  font-weight: 800;
  font-style: italic;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -.005em;
  white-space: nowrap;
  color: var(--white);
}
.brand span { color: #e0e0e0; }

.bag-count {
  position: absolute;
  top: 5px;
  right: 2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--white);
  color: var(--black);
  font-size: 11px;
  line-height: 20px;
  text-align: center;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 2px 10px var(--gutter);
}

.search-bar input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--white);
  border-radius: 0;
  background: transparent;
  color: var(--white);
  font-size: 16px;               /* 16px stops iOS zooming into the field */
  -webkit-appearance: none;
  appearance: none;
}
.search-bar input::placeholder { color: var(--faint); }
.search-bar input:focus { outline: none; }
.search-bar input::-webkit-search-cancel-button { display: none; }

/* ---------- "Shop All" row ---------- */

.subnav {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 55px;
  background: #030303;
}
.subnav a { font-size: 14px; letter-spacing: .02em; padding: 8px 12px; }
.subnav a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Announcement marquee ---------- */

.marquee {
  display: flex;
  overflow: hidden;
  height: 48px;
  align-items: center;
  background: var(--cream);
  color: var(--black);
  user-select: none;
}

.marquee__group {
  display: flex;
  flex-shrink: 0;
  justify-content: space-around;
  min-width: 100%;
  animation: marquee 22s linear infinite;
}

.marquee__group span {
  padding-right: 2ch;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  padding: 72px var(--gutter);
  text-align: center;
}

.hero__eyebrow {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.hero__title {
  max-width: 11ch;
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 800;
  font-style: italic;
  font-size: clamp(3rem, 13vw, 8rem);
  line-height: .95;
  letter-spacing: -.01em;
}

.hero__subtitle {
  max-width: 36ch;
  margin: 26px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.hero__cta {
  margin-top: 36px;
  padding: 6px 0;
  border-bottom: 1px solid var(--white);
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ---------- Sections ---------- */

.section-title {
  margin: 0;
  padding: 30px var(--gutter) 20px;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: .02em;
  text-align: center;
}

.section-actions {
  display: flex;
  justify-content: center;
  padding: 52px var(--gutter) 64px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 24px;
  border: 1px solid var(--white);
  border-radius: 2px;
  font-size: 14px;
  letter-spacing: .02em;
  text-align: center;
  transition: background-color .2s, color .2s, opacity .2s;
}
.btn--light { background: var(--white); color: var(--black); }
.btn--light:hover { background: var(--cream); }
.btn--ghost { background: transparent; color: var(--white); }
.btn--ghost:hover { background: var(--white); color: var(--black); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Product cards ---------- */

.rail {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  padding: 0 var(--gutter);
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > li { flex: 0 0 var(--card-w); scroll-snap-align: start; }
.rail > .list-message { flex: 1 0 100%; }

@media (hover: hover) and (pointer: fine) {
  .rail { scrollbar-width: thin; scrollbar-color: #3a3a3a transparent; padding-bottom: 12px; }
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  row-gap: 28px;
  padding: 0 var(--gutter);
}

.card { display: block; height: 100%; }

.card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--card-ratio);
  background: var(--white);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Melt near-white photo backgrounds (JPEG "white" is often 248-254) into the tile. */
  filter: brightness(1.03);
  mix-blend-mode: multiply;
  transform: scale(var(--card-zoom));
  transition: transform .6s var(--ease);
}
.card:hover .card__media img { transform: scale(calc(var(--card-zoom) * 1.05)); }

.card__info { padding: 14px 20px 0; }

.card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 19px;
  overflow-wrap: anywhere;
}

.card__price {
  margin: 0;
  font-size: 13px;
  line-height: 19px;
}

.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 5px 8px;
  background: var(--black);
  color: var(--white);
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.card--skeleton .card__media { background: var(--skeleton); animation: pulse 1.4s ease-in-out infinite; }
.card--skeleton .card__info span {
  display: block;
  height: 12px;
  margin-top: 8px;
  background: var(--skeleton);
  animation: pulse 1.4s ease-in-out infinite;
}
.card--skeleton .card__info span:last-child { width: 60%; }

@keyframes pulse { 50% { opacity: .5; } }

.list-message {
  grid-column: 1 / -1;
  padding: 48px var(--gutter);
  color: var(--muted);
  text-align: center;
}

/* ---------- Policy ---------- */

.policy__body {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--gutter) 72px;
  color: var(--muted);
}
.policy__body h3 {
  margin: 32px 0 8px;
  color: var(--white);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.policy__body p { margin: 0; }

/* ---------- Footer ---------- */

.footer {
  padding: 40px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  text-align: center;
}
.footer__social { display: flex; justify-content: center; gap: 8px; }
.footer__social a { display: grid; place-items: center; width: 44px; height: 44px; transition: opacity .2s; }
.footer__social a:hover { opacity: .7; }
.footer__social svg { width: 24px; height: 24px; }
.footer__social .stroke-icon { stroke-width: 1.6; }
.footer__social .fill-icon { fill: currentColor; stroke: none; }
.footer__copy { margin: 16px 0 0; color: var(--faint); font-size: 12px; letter-spacing: .04em; }

/* ---------- Dialogs: shared ---------- */

dialog {
  padding: 0;
  border: 0;
  background: var(--black);
  color: var(--white);
}
dialog::backdrop { background: rgba(0, 0, 0, .3); }

.close-btn {
  position: absolute;
  top: 8px;
  left: 2px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid #dedede;
  border-radius: 50%;
  background: var(--black);
}
.close-btn svg { width: 16px; height: 16px; stroke-width: 1.1; }
.close-btn--static { position: static; }

/* ---------- Drawers (menu, bag) ---------- */

.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: calc(100% - 20px);
  max-width: 440px;
  height: 100%;
  max-height: none;
  margin: 0;
}
.drawer--right { inset: 0 0 0 auto; }
.drawer[open] { animation: slide-from-left .35s var(--ease); }
.drawer--right[open] { animation-name: slide-from-right; }

@keyframes slide-from-left { from { transform: translateX(-100%); } }
@keyframes slide-from-right { from { transform: translateX(100%); } }

.drawer__inner {
  height: 100%;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
}

.menu { padding: 54px 18px 40px; }

.menu__link {
  display: block;
  padding: 12px 0;
  font-size: 28px;
  line-height: 34px;
  letter-spacing: .01em;
}

.menu__sub { margin: -7px 0 5px; }
.menu__sub a {
  display: block;
  padding: 6px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: .04em;
}

.menu a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

/* Bag */

.bag { display: flex; flex-direction: column; }

.bag__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 8px 18px;
  border-bottom: 1px solid var(--line);
}
.bag__title { margin: 0; font-size: 20px; font-weight: 400; letter-spacing: .02em; }

.bag__items { flex: 1; overflow-y: auto; padding: 0 18px; }
.bag__empty { flex: 1; padding: 32px 18px; color: var(--muted); }

.line-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.line-item img, .line-item__ph { width: 72px; height: 72px; object-fit: contain; background: var(--white); }
.line-item__name { margin: 0; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.line-item__price { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.line-item__remove { padding: 8px; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.line-item__remove:hover { color: var(--white); }

.bag__footer { padding: 18px 18px 24px; border-top: 1px solid var(--line); }

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  font-size: 15px;
  letter-spacing: .02em;
}

/* ---------- Modals (product, order) ---------- */

.modal {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
}
.modal[open] { animation: fade-up .3s var(--ease); }

@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } }

.modal__inner {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal__title { margin: 0 0 20px; font-size: 24px; font-weight: 400; letter-spacing: .02em; }

/* Product */

.product__media { background: var(--white); aspect-ratio: 1 / 1; }
.product__media img { width: 100%; height: 100%; object-fit: contain; filter: brightness(1.03); mix-blend-mode: multiply; }

.product__info { padding: 24px 20px calc(32px + env(safe-area-inset-bottom)); }
.product__category { margin: 0 0 10px; color: var(--muted); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.product__name { margin: 0; font-size: 24px; font-weight: 400; line-height: 1.25; letter-spacing: .01em; overflow-wrap: anywhere; }
.product__price { margin: 10px 0 0; font-size: 17px; letter-spacing: .02em; }
.product__stock { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.product__stock.is-out { color: var(--danger); }
.product__description { margin: 22px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; white-space: pre-line; }
.product__description:empty { display: none; }
.product__actions { display: grid; gap: 10px; margin-top: 28px; }

/* Order */

.order { padding: 76px 20px calc(32px + env(safe-area-inset-bottom)); }

.order__items { margin-bottom: 18px; border-top: 1px solid var(--line); }
.order__items .line-item { grid-template-columns: 56px 1fr; }
.order__items .line-item img, .order__items .line-item__ph { width: 56px; height: 56px; }

.order__form { display: grid; gap: 16px; margin-top: 8px; }

.field { display: grid; gap: 8px; }
.field__label { color: var(--muted); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.field input {
  height: 50px;
  padding: 0 14px;
  border: 1px solid #555;
  border-radius: 2px;
  background: transparent;
  color: var(--white);
  font-size: 16px;
}
.field input::placeholder { color: #666; }
.field input:focus { border-color: var(--white); outline: none; }
.field input[aria-invalid="true"] { border-color: var(--danger); }

.form-error { margin: 0; color: var(--danger); font-size: 14px; }
.form-note { margin: 0; color: var(--faint); font-size: 12px; text-align: center; }
.order__thanks { margin: 0 0 28px; color: var(--muted); line-height: 1.65; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 2px;
  background: var(--white);
  color: var(--black);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .25s, transform .25s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Larger screens ---------- */

@media (min-width: 640px) {
  :root { --card-w: 30vw; --gutter: 24px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .modal {
    width: min(920px, calc(100% - 48px));
    height: fit-content;       /* a modal <dialog> is fixed with inset: 0, so auto would fill the screen */
    border: 1px solid var(--line);
    max-height: min(760px, calc(100% - 48px));
    margin: auto;
  }
  .modal--order { width: min(480px, calc(100% - 48px)); }
  .modal__inner { height: auto; max-height: min(760px, calc(100vh - 48px)); }
  .product { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .product__info { padding: 72px 32px 32px; }
  .order { padding: 76px 32px 32px; }
}

@media (min-width: 1024px) {
  :root { --card-w: 23vw; --card-ratio: 2 / 3; --header-h: 72px; --gutter: 40px; }
  .brand { font-size: 34px; }
  .header__bar { padding: 0 24px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 40px; }
  .section-title { font-size: 28px; padding-top: 56px; padding-bottom: 36px; }
}

@media (min-width: 1440px) {
  :root { --card-w: 330px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee__group { animation: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
