/* Tokens */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #111111;
  --muted: #777777;
  --soft: #aaa49a;
  --border: rgba(0, 0, 0, 0.1);
  --taupe: #6f665b;
  --error: #8f1f1f;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --gutter: clamp(16px, 3vw, 32px);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #e8e5df;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
}

main {
  animation: reveal 0.34s var(--ease);
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 9999;
  background: var(--surface);
  padding: 10px 12px;
  border: 1px solid var(--ink);
}

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

.price {
  font-variant-numeric: tabular-nums;
}

.kicker,
.nav a,
.text-link,
.icon-btn,
.back-link,
.mini-label,
.field label,
.selector-title,
.accordion summary {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  transition:
    transform 0.18s var(--ease),
    background 0.18s var(--ease),
    color 0.18s var(--ease),
    opacity 0.18s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--ink);
  color: var(--surface);
}

.btn.light {
  border-color: var(--surface);
  color: var(--surface);
}

.btn.block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.mobile-only {
  display: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 18px var(--gutter);
  background: rgba(247, 246, 242, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.header-left,
.header-actions,
.nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav {
  justify-content: center;
}

.back-link {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

.header-actions {
  justify-content: flex-end;
}

.icon-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.bag-count {
  font-size: 11px;
}

/* Home */
.hero {
  min-height: calc(100dvh - 76px);
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  position: relative;
  overflow: hidden;
}

.hero img {
  position: absolute;
  inset: 0;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
}

.hero-copy {
  position: relative;
  z-index: 1;
  color: var(--surface);
  padding: 0 var(--gutter) 7vh;
  max-width: 720px;
}

.hero h1,
.editorial h2,
.page-title h1 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0;
  font-size: clamp(42px, 7vw, 92px);
  line-height: 0.95;
  margin: 0 0 18px;
}

.hero p,
.editorial p,
.page-title p {
  font-size: 16px;
  max-width: 520px;
  margin: 0 0 24px;
  color: inherit;
}

.section {
  padding: 72px var(--gutter);
}

.editorial {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  gap: clamp(28px, 7vw, 96px);
  align-items: end;
}

.editorial img {
  aspect-ratio: 3 / 4;
}

.split-copy {
  max-width: 520px;
}

.kicker {
  color: var(--muted);
  margin-bottom: 14px;
}

.category-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
}

.category-tile {
  position: relative;
  min-height: 420px;
  background: #ddd;
  overflow: hidden;
}

.category-tile img {
  transition: transform 0.32s var(--ease);
}

.category-tile:hover img {
  transform: scale(1.03);
}

.category-tile span {
  position: absolute;
  left: 18px;
  bottom: 18px;
  color: var(--surface);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 22px;
}

.section-head h2,
.drawer h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  margin: 0;
}

.site-footer {
  padding: 44px var(--gutter);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.footer-links a,
.footer-links span {
  display: block;
  margin: 0 0 9px;
  color: var(--muted);
}

.footer-links strong {
  display: block;
  margin-bottom: 9px;
}

.newsletter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  max-width: 520px;
}

/* Collection */
.page-title {
  padding: 54px var(--gutter) 28px;
}

.toolbar {
  position: sticky;
  top: 81px;
  z-index: 20;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--gutter);
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.toolbar input,
.toolbar select,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0 12px;
  border-radius: 0;
}

.toolbar input {
  max-width: 360px;
}

.native-select {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

.custom-select {
  position: relative;
  min-width: 150px;
  flex: 0 0 auto;
}

.custom-select-trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0 36px 0 12px;
  text-align: left;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.custom-select-trigger::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  transform: translateY(-65%) rotate(45deg);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  display: none;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--border);
  background: var(--surface);
}

.custom-select.open .custom-select-menu {
  display: block;
}

.custom-select-menu button {
  width: 100%;
  display: block;
  padding: 11px 12px;
  text-align: left;
  font-size: 12px;
}

.custom-select-menu button:hover,
.custom-select-menu button.active {
  background: var(--bg);
}

.collection-wrap {
  padding: 24px var(--gutter) 80px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 12px;
}

.product-card {
  min-width: 0;
  position: relative;
}

.product-link {
  display: block;
}

.product-media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #e4e0d9;
}

.product-media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background-repeat: no-repeat;
  transition:
    opacity 0.24s var(--ease),
    transform 0.24s var(--ease);
}

.product-media img:nth-child(2) {
  opacity: 0;
}

.product-card:hover .product-media img {
  transform: scale(1.03);
}

.product-card:hover .product-media img:first-child {
  opacity: 0;
}

.product-card:hover .product-media img:nth-child(2) {
  opacity: 1;
}

.product-info {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding-top: 10px;
  font-size: 13px;
}

.product-info .muted {
  grid-column: 1 / -1;
}

.quick-add {
  position: absolute;
  right: 10px;
  bottom: 64px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.88);
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border);
}

.empty {
  padding: 48px 0;
  color: var(--muted);
}

/* PDP */
.pdp {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 48px;
  padding: 32px var(--gutter) 80px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.gallery figure {
  margin: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.gallery img {
  animation: imageFade 0.24s var(--ease);
}

@keyframes imageFade {
  from {
    opacity: 0.65;
  }

  to {
    opacity: 1;
  }
}

.pdp-panel {
  position: sticky;
  top: 110px;
  align-self: start;
}

.pdp-panel h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 42px;
  line-height: 1;
  margin: 0 0 8px;
}

.selector {
  margin: 24px 0;
}

.selector-title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.swatches,
.sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch,
.size-chip {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0 12px;
}

.size-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.size-chip small {
  display: block;
  font-size: 9px;
  line-height: 1;
  color: var(--taupe);
}

.swatch.active,
.size-chip.active {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.size-chip.soldout {
  opacity: 0.38;
  cursor: not-allowed;
  text-decoration: line-through;
}

.accordion {
  border-top: 1px solid var(--border);
  margin-top: 28px;
}

.accordion details {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.accordion summary {
  cursor: pointer;
}

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

.size-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
  background: var(--surface);
}

.size-table th,
.size-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 400;
}

.size-table th {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* Cart */
.cart-line {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.cart-line img {
  aspect-ratio: 3 / 4;
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  margin-top: 10px;
}

.qty button {
  width: 34px;
  height: 34px;
}

.qty span {
  min-width: 34px;
  text-align: center;
}

.cart-footer {
  padding-top: 18px;
}

.total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.estimated-total {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* Checkout */
.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 48px;
  padding: 42px var(--gutter) 80px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.summary {
  background: var(--surface);
  padding: 20px;
  border: 1px solid var(--border);
  align-self: start;
}

.summary-line {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.summary-line img {
  width: 58px;
  aspect-ratio: 3 / 4;
}

.notice {
  border: 1px solid var(--border);
  padding: 14px;
  margin: 18px 0;
  color: var(--muted);
}

.care-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
}

.care-grid section {
  background: var(--surface);
  padding: 24px;
  min-height: 180px;
}

/* Drawers */
.overlay,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(17, 17, 17, 0.26);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease);
}

.overlay.active,
.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.search-panel {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: var(--bg);
  padding: 24px var(--gutter) 36px;
  transform: translateY(-100%);
  transition: transform 0.24s var(--ease);
  border-bottom: 1px solid var(--border);
}

.search-panel.active {
  transform: none;
}

.search-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-row input {
  flex: 1;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  min-height: 52px;
  font-size: 24px;
}

.search-results {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 22px;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 110;
  width: min(430px, 100%);
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.24s var(--ease);
  padding: 22px;
  overflow: auto;
  border-left: 1px solid var(--border);
}

.drawer.active {
  transform: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.drawer-nav {
  display: grid;
  gap: 10px;
}

.drawer .custom-select {
  width: 100%;
}

.quick-summary {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 16px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.quick-summary img {
  aspect-ratio: 3 / 4;
}

.quick-summary h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.05;
  margin: 0 0 8px;
}

.mini-size-list .size-chip {
  flex: 1 0 calc(25% - 8px);
}

.account-form {
  grid-template-columns: 1fr;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 140;
  transform: translate(-50%, 20px);
  opacity: 0;
  background: var(--ink);
  color: var(--surface);
  padding: 12px 16px;
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.toast.active {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Mobile */
@media (max-width: 980px) {
  .desktop-nav {
    display: none;
  }

  .mobile-only {
    display: inline-flex;
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  .brand {
    font-size: 15px;
  }

  .category-row,
  .product-grid,
  .search-results {
    grid-template-columns: repeat(2, 1fr);
  }

  .editorial,
  .pdp,
  .checkout,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .pdp-panel {
    position: static;
  }

  .gallery {
    gap: 8px;
  }

  .care-grid {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar {
    top: 73px;
  }

  .hide-mobile {
    display: none;
  }
}

@media (max-width: 620px) {
  .hero {
    min-height: 76dvh;
  }

  .section {
    padding: 52px 16px;
  }

  .product-grid {
    gap: 22px 8px;
  }

  .category-row,
  .care-grid,
  .footer-links {
    grid-template-columns: 1fr;
  }

  .category-tile {
    min-height: 310px;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .newsletter {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar input {
    max-width: none;
  }

  .toolbar .custom-select {
    width: 100%;
  }

  .pdp {
    padding-top: 18px;
  }

  .pdp-panel h1 {
    font-size: 34px;
  }

  .search-results {
    grid-template-columns: 1fr 1fr;
  }

  .header-actions {
    gap: 2px;
  }

  .icon-btn span:not(.bag-count) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
