/* Customer pages: neutral, photo-led, heavy wide type. */

/* Header: thin bar with a dark rule, over the photo on the home page */
.top {
  position: sticky; top: 0; z-index: 30;
  background: rgba(228, 226, 219, 0.88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-block-end: 1.5px solid var(--ink);
}
body[data-page="home"] .top { position: fixed; inset-inline: 0; background: rgba(228, 226, 219, 0.55); }
.top-in {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  min-height: 60px; padding-inline: clamp(16px, 3vw, 40px);
}
.brand {
  justify-self: start; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 1.15rem; font-weight: 900; font-stretch: 112%; text-transform: uppercase;
  letter-spacing: -0.01em; text-decoration: none;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand span { overflow: hidden; text-overflow: ellipsis; }
.brand-mark { height: 34px; width: auto; flex: none; filter: brightness(0); }
.foot-logo { display: block; width: min(300px, 70vw); height: auto; margin-block-end: 14px; }
.top-mid a, .top-link {
  font-size: 0.82rem; font-weight: 800; font-stretch: 105%; text-transform: uppercase;
  letter-spacing: 0.04em; text-decoration: none;
}
.top-mid a:hover, .top-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.top-end { justify-self: end; display: flex; align-items: center; gap: clamp(10px, 2vw, 22px); }
.cart-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.cart-link svg { display: none; }
.lang-pick {
  width: auto; min-height: 34px; padding: 0 24px 0 6px; border: 0; border-radius: 0;
  background: transparent; font-size: 0.82rem; font-weight: 700; cursor: pointer;
}
:root[dir="rtl"] .lang-pick { padding: 0 6px 0 24px; }
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--ink); color: #fff;
  font-size: 0.75rem; font-weight: 800; line-height: 1;
}
.badge:empty { display: none; }
@media (max-width: 640px) {
  .top-in { grid-template-columns: 1fr auto; }
  .top-mid { display: none; }
  .cart-link svg { display: block; }
  .cart-link span:not(.badge) { display: none; }
}

/* Home: full-screen photo with a huge headline */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden;
  display: flex; align-items: flex-end; background: #cfccc3;
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0) 45%);
}
.hero-in {
  position: relative; z-index: 1; width: 100%;
  padding: 0 clamp(16px, 8vw, 160px) clamp(32px, 7vh, 72px);
}
.hero-title {
  margin: 0; max-width: 11ch; overflow-wrap: anywhere;
  color: #ece9e1; text-transform: uppercase;
  font-size: clamp(3rem, 10vw, 8.5rem); font-weight: 900; font-stretch: 125%;
  line-height: 0.92; letter-spacing: -0.02em;
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.no-photo .hero-title { color: var(--ink); }
:root[dir="rtl"] .hero-title { line-height: 1.3; letter-spacing: 0; font-size: clamp(2.6rem, 9vw, 6.5rem); }
.hero-cta {
  display: inline-block; margin-top: 22px; padding: 12px 22px;
  background: #ece9e1; color: var(--ink); text-decoration: none;
  font-size: 0.85rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
}
.hero-cta:hover { background: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

/* Home: the hats */
.shop { padding-block: clamp(40px, 8vw, 88px) 64px; scroll-margin-top: 60px; }
.shop-head { display: grid; gap: 8px; margin-block-end: 28px; border-block-end: 1.5px solid var(--ink); padding-block-end: 16px; }
.shop-head h2 {
  margin: 0; font-size: clamp(2rem, 6vw, 3.6rem); font-weight: 900; font-stretch: 125%;
  text-transform: uppercase; line-height: 1;
}
.shop-head p { margin: 0; max-width: 60ch; color: var(--muted); }
.grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 14px;
}
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 22px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card-link { display: block; text-decoration: none; }
.ph { position: relative; overflow: hidden; aspect-ratio: 4 / 5; background: #d8d5cd; }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card-link:hover .ph img { transform: scale(1.04); }
.is-out .ph img { filter: grayscale(0.8); opacity: 0.6; }
.flag {
  position: absolute; inset-block-start: 10px; inset-inline-start: 10px;
  padding: 3px 9px; background: var(--ink); color: #fff;
  font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
}
.flag.warn { background: var(--danger); }
.card-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 12px; }
.card-name {
  margin: 0; font-size: 0.95rem; font-weight: 800; line-height: 1.25;
  text-transform: uppercase; letter-spacing: 0.01em;
}
.card-price { margin: 0; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Size tags, struck through when sold out */
.tags { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 8px; border: 1.5px solid var(--ink);
  color: var(--ink); font-size: 0.75rem; font-weight: 800; line-height: 1.6;
}
.tag.out { border-color: var(--line); color: var(--faint); text-decoration: line-through; }

/* Hat page */
.hat-page { padding-block: 24px 64px; }
.back { display: inline-block; margin-block-end: 14px; color: var(--muted); }
.hat-grid { display: grid; gap: 24px; }
@media (min-width: 860px) {
  .hat-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: start; }
  .hat-info { position: sticky; top: 84px; }
}
.gallery { margin-inline: -16px; }
@media (min-width: 860px) { .gallery { margin-inline: 0; } }
.slides {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  background: #d8d5cd;
}
.slides::-webkit-scrollbar { display: none; }
.slides img, .slide-empty { flex: 0 0 100%; aspect-ratio: 4 / 5; object-fit: cover; scroll-snap-align: center; }
.dots { display: flex; justify-content: center; gap: 8px; padding-block: 12px 0; }
.dots button {
  width: 10px; height: 10px; padding: 0; border-radius: 50%;
  border: 1.5px solid var(--felt); background: transparent; cursor: pointer;
}
.dots button[aria-current] { background: var(--felt); }
.hat-info h1 { margin: 0 0 8px; font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; font-stretch: 120%; text-transform: uppercase; line-height: 1; }
.price { margin: 0; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.desc { margin: 14px 0 0; max-width: 60ch; color: var(--muted); white-space: pre-line; }
.sizes { border: 0; padding: 0; margin: 24px 0 0; min-width: 0; }
.sizes legend { padding: 0; margin-block-end: 10px; font-weight: 700; }
.size-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.size { position: relative; }
.size input { position: absolute; opacity: 0; pointer-events: none; }
.size > span {
  display: inline-grid; place-items: center; min-width: 58px; min-height: 48px; padding: 0 14px;
  border: 1.5px solid var(--felt); border-radius: var(--r-s);
  background: var(--paper); font-weight: 700; cursor: pointer;
}
.size input:checked + span { background: var(--felt); color: #fff; }
.size input:focus-visible + span { outline: 3px solid var(--band); outline-offset: 2px; }
.size.out > span { border-color: var(--line); background: transparent; color: var(--faint); text-decoration: line-through; cursor: not-allowed; }
.stock-note { min-height: 1.6em; margin: 12px 0 0; color: var(--muted); }
.stock-note.low { color: var(--danger); font-weight: 650; }
.buy-row { display: flex; gap: 12px; margin-top: 12px; }
.buy-row .btn { flex: 1; }

/* Cart and checkout */
.cart-page { padding-block: 24px 56px; }
.cart-page h1, .ty h1, .empty h1 { margin: 0 0 20px; font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 900; font-stretch: 120%; text-transform: uppercase; line-height: 1; }
.cart-grid { display: grid; gap: 32px; }
@media (min-width: 860px) {
  .cart-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: start; }
}
.lines { list-style: none; padding: 0; margin: 0; border-block-start: 1px solid var(--line); }
.line {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px;
  padding-block: 16px; border-block-end: 1px solid var(--line);
}
.line-ph { display: block; aspect-ratio: 4 / 5; border-radius: var(--r-s); overflow: hidden; background: #d8d5cd; }
.line-ph img { width: 100%; height: 100%; object-fit: cover; }
.line-name { font-weight: 650; text-decoration: none; }
.line-meta { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; }
.line-problem { margin: 6px 0 0; color: var(--danger); font-size: 0.92rem; font-weight: 600; }
.line-actions { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.line-total { margin: 0; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.line.is-out .line-ph { opacity: 0.5; }
.checkout {
  padding: 20px;
  background: var(--paper); border: 1px solid var(--line);
}
.checkout h2 { margin: 0 0 12px; font-size: 1.2rem; font-weight: 900; font-stretch: 115%; text-transform: uppercase; }
.cod { margin: 0 0 20px; padding: 10px 14px; border-inline-start: 4px solid var(--ink); background: var(--stone); border-radius: var(--r-s); }
.sum { margin: 20px 0 16px; display: grid; gap: 8px; }
.sum div { display: flex; justify-content: space-between; gap: 12px; }
.sum dt { color: var(--muted); }
.sum dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.sum .sum-total { padding-top: 10px; border-top: 1px solid var(--line); }
.sum .sum-total dt { color: var(--ink); font-weight: 700; }
.sum .sum-total dd { font-size: 1.25rem; font-weight: 800; }
.checkout .notice { margin-block-end: 12px; }

/* Thank you */
.ty { max-width: 560px; padding-block: 32px 64px; }
.ty-label { margin: 0; color: var(--muted); }
.ty-code {
  display: inline-block; margin: 4px 0 18px; padding: 6px 14px;
  border: 2px dashed var(--felt); border-radius: var(--r-s);
  font-size: 2rem; font-weight: 900; font-stretch: 115%; letter-spacing: 0.04em;
}
.ty-items { list-style: none; padding: 0; margin: 20px 0; border-top: 1px solid var(--line); }
.ty-items li { display: flex; justify-content: space-between; gap: 12px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.ty-total { font-weight: 800; }
.ty .hint { margin-block-end: 20px; }

/* Footer */
.foot {
  margin-top: 24px; padding: 28px 0 calc(28px + env(safe-area-inset-bottom));
  background: var(--felt); color: rgba(255, 255, 255, 0.8);
}
.foot p { margin: 0 0 6px; }
.foot-name { color: #fff; font-weight: 900; font-stretch: 115%; font-size: 1.3rem; text-transform: uppercase; }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 10px !important; }
.foot a { color: #fff; }

/* Discounts */
.was { color: var(--muted); font-weight: 500; text-decoration-thickness: 1.5px; }
.now.sale { color: var(--danger); font-weight: 800; }
.card-price .was { display: block; font-size: 0.8rem; text-align: end; }
.sale-badge {
  position: absolute; inset-block-start: 10px; inset-inline-end: 10px;
  padding: 3px 9px; background: var(--danger); color: #fff;
  font-size: 0.78rem; font-weight: 900; letter-spacing: 0.02em;
}
.price .sale-badge { position: static; display: inline-block; vertical-align: middle; margin-inline-start: 8px; }

/* Three-line menu button and the category side menu */
.top-start { justify-self: start; display: flex; align-items: center; gap: 12px; min-width: 0; }
.menu-btn {
  display: inline-grid; gap: 5px; align-content: center; justify-items: center;
  width: 40px; height: 40px; padding: 0; border: 0; background: transparent; cursor: pointer; flex: none;
}
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--ink); }
.drawer-back { position: fixed; inset: 0; z-index: 40; background: rgba(20, 20, 20, 0.35); }
.drawer {
  position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 41;
  width: min(340px, 86vw); padding: 18px 24px; overflow-y: auto;
  background: var(--stone); border-inline-end: 1.5px solid var(--ink);
  animation: slide-in 0.22s ease-out;
}
:root[dir="rtl"] .drawer { animation-name: slide-in-rtl; }
@keyframes slide-in { from { transform: translateX(-100%); } }
@keyframes slide-in-rtl { from { transform: translateX(100%); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-block-end: 16px; }
.drawer-title { margin: 0; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.drawer-close { width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.drawer ul { list-style: none; margin: 0; padding: 0; }
.drawer li { border-block-end: 1.5px solid var(--ink); }
.drawer a {
  display: block; padding: 16px 0; text-decoration: none;
  font-size: 1.5rem; font-weight: 900; font-stretch: 120%; text-transform: uppercase; line-height: 1.1;
}
.drawer a:hover, .drawer a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
body.menu-open { overflow: hidden; }
