:root {
  --bg: #f9f7f4;
  --photo: #f1eee9;
  --line: #e4dfd8;
  --ink: #171615;
  --soft: #635e58;
  --muted: #938c84;
}

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

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  padding-bottom: 84px;
  -webkit-font-smoothing: antialiased;
}

/* Single minimal header */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 54px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(249, 247, 244, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.bag-trigger {
  background: none;
  border: 0;
  padding: 6px 0;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 14px 24px;
}

/* Editorial category text row — no pill clutter */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 24px;
  margin-bottom: 20px;
}

.cats {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.cats::-webkit-scrollbar {
  display: none;
}

.cat {
  flex-shrink: 0;
  background: none;
  border: 0;
  border-bottom: 1.5px solid transparent;
  padding: 4px 0;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.cat:hover {
  color: var(--ink);
}

.cat.active {
  color: var(--ink);
  font-weight: 500;
  border-bottom-color: var(--ink);
}

.note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* Clean sharp-edged product grid */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 12px;
}

.item {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.photo {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--photo);
  overflow: hidden;
}

.photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.photo img.is-contain {
  object-fit: contain;
  padding: 16px;
}

.item:hover .photo img {
  transform: scale(1.035);
}

.item-meta {
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.p-brand {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.p-name {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}

.p-bottom {
  margin-top: 4px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.p-price {
  font-size: 13.5px;
  color: var(--soft);
}

.p-add {
  background: none;
  border: 0;
  padding: 2px 0;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Custom link request */
.custom {
  margin-top: 64px;
  padding: 36px 0 28px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.custom-left h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.1;
}

.custom-left p {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--soft);
}

.custom-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.custom-form input,
.line-input {
  width: 100%;
  height: 40px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #c9c2b8;
  padding: 0 2px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}

.custom-form input:focus,
.line-input:focus {
  border-bottom-color: var(--ink);
}

.cta {
  height: 42px;
  padding: 0 22px;
  border: 0;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.cta:hover {
  background: #2e2c2a;
}

.cta-full {
  width: 100%;
}

.footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.footer a {
  color: var(--soft);
  text-decoration: none;
}

.footer a:hover {
  color: var(--ink);
}

/* Modal & Drawer */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(23, 22, 21, 0.42);
}

.modal {
  position: fixed;
  z-index: 50;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--bg);
}

.close-x {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 0;
  background: rgba(249, 247, 244, 0.9);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.close-x.static {
  position: static;
  background: none;
}

.modal-img-wrap {
  aspect-ratio: 1 / 1;
  background: var(--photo);
}

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

.modal-img-wrap img.is-contain {
  object-fit: contain;
  padding: 24px;
}

.modal-body {
  padding: 20px;
}

.modal-title {
  margin: 4px 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.1;
}

.modal-price {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--soft);
}

.modal-blurb {
  margin: 12px 0 18px;
  font-size: 13.5px;
  color: var(--soft);
}

.variants-wrap {
  margin-bottom: 18px;
}

.variants-label {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.variants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.v-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #cfc8be;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.v-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* Bottom bar */
.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bar-info {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-size: 13px;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.bar-cta {
  background: var(--bg);
  color: var(--ink);
  border: 0;
  height: 36px;
  padding: 0 16px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

/* Drawer */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(390px, 100vw);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.drawer-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-head h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
  font-weight: 500;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bag-empty {
  padding: 40px 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

.bag-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.bag-thumb {
  width: 52px;
  height: 64px;
  background: var(--photo);
  object-fit: cover;
  flex-shrink: 0;
}

.bag-thumb.is-contain {
  object-fit: contain;
  padding: 4px;
}

.bag-info {
  min-width: 0;
  flex: 1;
}

.bag-info strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bag-info span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.bag-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.bag-qty button {
  width: 24px;
  height: 24px;
  border: 1px solid #cfc8be;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.drawer-foot {
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.row.sub {
  color: var(--soft);
  font-size: 13px;
}

@media (min-width: 720px) {
  .header {
    padding: 0 32px;
  }
  .page {
    padding: 24px 32px 36px;
  }
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px 20px;
  }
  .custom {
    grid-template-columns: 1fr 1.2fr;
    align-items: end;
    gap: 40px;
  }
  .custom-form {
    flex-direction: row;
    align-items: end;
  }
  .custom-form input {
    flex: 1;
  }
}

@media (min-width: 1080px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 40px 22px;
  }
}
