:root {
  --bg: #f3f1ee;
  --panel: #ffffff;
  --line: #e2ddd4;
  --text: #141414;
  --muted: #67615a;
  --tiffany: #5bbfb8;
  --gold: #a5844d;
  --shadow: 0 20px 50px rgba(20, 20, 20, 0.09);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0, rgba(255, 255, 255, 0.9), transparent 44%),
    radial-gradient(circle at 85% 18%, rgba(200, 231, 227, 0.36), transparent 40%),
    var(--bg);
}

.announce {
  background: #0d0d0d;
  color: #f4f4f4;
  text-align: center;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 13px;
  letter-spacing: 0.01em;
}

.site-header {
  max-width: 1340px;
  margin: 0 auto;
  padding: 16px 18px 10px;
}

.brand-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.brand-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.brand-logo {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(20, 20, 20, 0.16);
}

.brand {
  margin: 0;
  text-align: left;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(36px, 8vw, 96px);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #1f1f1f;
  border-radius: 999px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 13px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.header-btn.dark {
  background: #111;
  color: #fff;
  border-color: #111;
}

.header-btn.ghost {
  background: #fff;
}

.header-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(24, 24, 24, 0.12);
}

.sticky-zone {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(8px);
  background: rgba(243, 241, 238, 0.86);
  border-top: 1px solid rgba(226, 221, 212, 0.8);
  border-bottom: 1px solid rgba(226, 221, 212, 0.8);
}

.sticky-inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 10px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.category-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-item {
  border: 0;
  background: transparent;
  color: #1e1e1e;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  padding: 4px 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nav-item.active,
.nav-item:hover {
  border-color: var(--tiffany);
  color: var(--tiffany);
}

.sticky-sort {
  min-width: 170px;
}

.page {
  max-width: 1340px;
  margin: 0 auto;
  padding: 22px 18px 64px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.cat-card {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
  transform: translateY(0);
  transition: transform 0.35s ease;
}

.cat-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border-radius: 2px;
  box-shadow: var(--shadow);
}

.cat-name {
  text-align: center;
  font-size: 23px;
  letter-spacing: 0.03em;
  margin: 9px 0 0;
  font-family: 'Cormorant Garamond', serif;
}

.cat-card:hover {
  transform: translateY(-5px);
}

.editorial {
  --scroll-p: 0;
  margin-top: 36px;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  min-height: 250vh;
  position: relative;
  background: #0f1112;
  color: #f2f2f2;
  overflow: clip;
}

.editorial-stage {
  position: sticky;
  top: 0;
  height: 100vh;
}

.editorial-hero {
  position: absolute;
  inset: 0;
}

.editorial-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(calc(1.1 - var(--scroll-p) * 0.12));
  filter: brightness(calc(0.62 + var(--scroll-p) * 0.22)) saturate(calc(0.86 + var(--scroll-p) * 0.14));
  transition: transform 0.25s linear, filter 0.25s linear;
}

.editorial-overlay {
  position: absolute;
  left: min(7vw, 110px);
  right: min(7vw, 110px);
  bottom: min(10vh, 90px);
  display: grid;
  gap: 18px;
  opacity: clamp(0, calc(1.18 - var(--scroll-p) * 2.1), 1);
  transform: translateY(calc(var(--scroll-p) * -20px));
}

.editorial-overlay h2 {
  margin: 0;
  color: #fff;
  max-width: 16ch;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(48px, 8vw, 112px);
  line-height: 0.96;
  letter-spacing: 0.01em;
}

.editorial-overlay a {
  width: fit-content;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.82);
  padding-bottom: 2px;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.editorial-split {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: clamp(18px, 2vw, 34px);
  padding: min(8vh, 72px) min(6vw, 92px);
  opacity: clamp(0, calc((var(--scroll-p) - 0.3) * 2), 1);
  transform: translateY(calc((1 - var(--scroll-p)) * 26px));
}

.split-media {
  height: min(75vh, 760px);
  overflow: hidden;
}

.split-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  clip-path: inset(
    calc((1 - var(--scroll-p)) * 18%)
    calc((1 - var(--scroll-p)) * 12%)
    calc((1 - var(--scroll-p)) * 12%)
    calc((1 - var(--scroll-p)) * 12%)
    round 2px
  );
  transform: translateY(calc((1 - var(--scroll-p)) * 30px)) scale(calc(1.08 - var(--scroll-p) * 0.08));
  filter: saturate(calc(0.88 + var(--scroll-p) * 0.14));
  transition: transform 0.25s linear, filter 0.25s linear;
}

.editorial-copy {
  display: grid;
  align-content: start;
  gap: 18px;
  max-width: 56ch;
  opacity: clamp(0, calc((var(--scroll-p) - 0.34) * 2.05), 1);
  transform: translateY(calc((1 - var(--scroll-p)) * 20px));
  transition: opacity 0.25s linear, transform 0.25s linear;
}

.editorial-copy p {
  margin: 0;
  line-height: 1.9;
  color: #e9e7e3;
  font-size: clamp(15px, 1.08vw, 18px);
}

.story-a {
  opacity: clamp(0, calc(1.1 - var(--scroll-p) * 1.45), 1);
  transform: translateY(calc(var(--scroll-p) * -8px));
}

.story-b {
  opacity: clamp(0, calc((var(--scroll-p) - 0.28) * 2.1), 1);
  transform: translateY(calc((1 - var(--scroll-p)) * 10px));
}

.editorial-copy a {
  width: fit-content;
  color: #f2f2f2;
  text-decoration: none;
  border-bottom: 1px solid rgba(242, 242, 242, 0.86);
  padding-bottom: 2px;
}

.toolbar {
  margin-top: 44px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 2px;
}

.count {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
}

.collection-title {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(30px, 3.8vw, 54px);
  font-weight: 500;
  text-align: center;
}

.toolbar-spacer {
  justify-self: end;
  width: 1px;
  height: 1px;
}

.select-wrap {
  display: grid;
  gap: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.select-wrap select {
  min-width: 164px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  color: #191919;
  text-transform: none;
}

.product-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 22px;
}

.card {
  border: 0;
  background: #fff;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 35px rgba(20, 20, 20, 0.08);
  transition: transform 0.36s ease, box-shadow 0.36s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 40px rgba(20, 20, 20, 0.11);
}

.sold-out-card {
  opacity: 0.78;
}

.cover-wrap {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #ece9e4;
  overflow: hidden;
  position: relative;
}

.cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge-row {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
  z-index: 4;
}

.badge {
  background: rgba(255, 255, 255, 0.88);
  color: #222;
  font-size: 11px;
  padding: 4px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  backdrop-filter: blur(5px);
}

.quick-view {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translate(-50%, 14px);
  border: 0;
  background: rgba(17, 17, 17, 0.92);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 8px 12px;
  opacity: 0;
  transition: all 0.28s ease;
  pointer-events: none;
}

.card:hover .quick-view {
  opacity: 1;
  transform: translate(-50%, 0);
}

.card-meta {
  padding: 12px;
  display: grid;
  gap: 4px;
}

.card-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.card-price {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.detail-dialog,
.auth-dialog,
.orders-dialog {
  width: min(1020px, 94vw);
  border: 0;
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
}

.detail-dialog::backdrop,
.auth-dialog::backdrop,
.orders-dialog::backdrop {
  background: rgba(10, 14, 20, 0.56);
}

.detail-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  min-height: min(84vh, 860px);
  position: relative;
}

.close {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  font-size: 24px;
  cursor: pointer;
  z-index: 3;
}

.detail-gallery {
  background: #f2f3f7;
  overflow: auto;
  max-height: 84vh;
}

.detail-media {
  width: 100%;
  display: block;
  margin-bottom: 10px;
  object-fit: cover;
}

.detail-meta {
  padding: 26px 24px;
  overflow: auto;
}

.detail-meta h2 {
  margin-top: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 40px;
  line-height: 1.1;
}

.detail-meta p {
  white-space: pre-wrap;
  line-height: 1.7;
  color: #2e3340;
}

.price {
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 16px 0;
}

.craft-section {
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  padding: 12px 0;
  margin-top: 10px;
}

.material-text {
  margin: 6px 0 0;
}

.add-bag-btn {
  width: 100%;
  border: 0;
  background: #111;
  color: #fff;
  border-radius: 999px;
  padding: 12px 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.add-bag-btn:disabled {
  background: #a5a5a5;
  cursor: not-allowed;
}

.trust-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: #5a5a5a;
}

.checkout-panel {
  margin-top: 10px;
}

.pay-section {
  border-top: 1px dashed var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.pay-title {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.wallet,
.paypal {
  margin-top: 6px;
  min-height: 24px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.wallet-ready {
  color: #1f6f52;
  font-weight: 700;
}

.auth-card {
  background: #fff;
  padding: 24px;
  position: relative;
  display: grid;
  gap: 12px;
}

.auth-close {
  top: 10px;
}

.auth-card h2 {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
}

.auth-subtitle {
  margin: 0;
  color: var(--muted);
}

.auth-modes {
  display: flex;
  gap: 8px;
}

.auth-mode {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.auth-mode.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form label {
  display: grid;
  gap: 4px;
}

.auth-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.forgot-link {
  justify-self: start;
  border: 0;
  background: transparent;
  padding: 0;
  margin-top: -2px;
  color: #5d5d5d;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

.auth-btn {
  border: 1px solid #111;
  background: #111;
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.auth-btn.ghost {
  background: #fff;
  color: #111;
  border-color: var(--line);
}

.auth-status {
  min-height: 22px;
  margin: 0;
  color: #1f6f52;
  font-size: 14px;
}

.auth-status.error {
  color: #af2f2f;
}

.orders-card {
  background: #fff;
  padding: 24px;
  position: relative;
}

.orders-card h2 {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
}

.orders-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  max-height: min(70vh, 700px);
  overflow: auto;
}

.order-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.order-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(20, 20, 20, 0.08);
}

.order-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.order-id {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.order-status {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  font-weight: 700;
}

.order-status.paid {
  color: #1f6f52;
}

.order-status.pending {
  color: #9a6a12;
}

.order-status.failed {
  color: #af2f2f;
}

@media (max-width: 1120px) {
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editorial {
    min-height: auto;
    width: auto;
    margin-left: 0;
    background: #111316;
    padding: 24px 0;
  }
  .editorial-stage {
    position: static;
    height: auto;
  }
  .editorial-overlay {
    position: static;
    transform: none;
    opacity: 1;
    padding: 20px 18px 10px;
  }
  .editorial-overlay h2 {
    font-size: clamp(38px, 8vw, 58px);
  }
  .editorial-split {
    position: static;
    grid-template-columns: 1fr;
    opacity: 1;
    transform: none;
    padding: 8px 18px 20px;
  }
  .split-media {
    height: auto;
    max-height: 60vh;
  }
  .split-media img {
    min-height: 300px;
    height: 100%;
    clip-path: none;
  }
  .toolbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .collection-title { text-align: left; }
}

@media (max-width: 760px) {
  .site-header,
  .page,
  .sticky-inner { padding-left: 12px; padding-right: 12px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-card { grid-template-columns: 1fr; }
  .detail-gallery { max-height: 50vh; }
  .brand-row { grid-template-columns: 1fr; }
  .header-actions { justify-self: center; }
  .category-nav { gap: 12px; }
  .brand-wrap { justify-content: center; gap: 10px; }
  .brand-logo { width: 96px; height: 96px; }
  .editorial-copy {
    opacity: 1;
    transform: none;
  }
  .split-media img,
  .editorial-hero img {
    transform: none;
    filter: saturate(1);
    clip-path: none;
  }
}
