/* KASUMI usability layer. Keep the quiet paper, ink and warm neutral palette. */
:root {
  --header-offset: 194px;
  --focus-ring: #765d4a;
  --error-ink: #9a3d32;
}

html {
  scroll-padding-top: var(--header-offset);
  scrollbar-gutter: stable;
}

html.modal-is-open {
  overflow: hidden;
}

[id] {
  scroll-margin-top: var(--header-offset);
}

[hidden],
.hidden {
  display: none !important;
}

main,
.product-card,
.product-info,
.product-gallery,
.bag-line > div,
.checkout-layout > *,
.drawer-item-info {
  min-width: 0;
}

input,
select,
textarea {
  min-height: 48px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--focus-ring);
  outline-offset: 2px;
}

button,
a,
summary {
  -webkit-tap-highlight-color: rgba(118, 93, 74, .12);
}

/* The outer wrapper persists while its announcement and navigation scroll. */
#header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
}

#header .header {
  position: static;
}

.icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.count {
  right: 0;
  top: 1px;
  min-width: 16px;
  text-align: center;
  line-height: 1.5;
  background: var(--paper);
  border-radius: 50%;
}

.count:empty {
  display: none;
}

.nav {
  padding-bottom: 8px;
  gap: 28px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.skip {
  position: fixed;
  top: -100px;
  padding: 12px 18px;
  z-index: 120;
  border: 1px solid var(--ink);
}

.skip:focus {
  top: 8px;
}

/* Search, filters and cards keep usable targets on touch screens. */
.chip,
.swatch,
.filter-clear,
.size-guide-link {
  min-height: 44px;
}

.chip,
.swatch {
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.chip:hover,
.swatch:hover {
  border-color: var(--accent);
}

.chip.active,
.chip[aria-pressed="true"] {
  border-color: var(--ink);
}

.save {
  width: 44px;
  height: 44px;
  right: 8px;
  top: 8px;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 6px #25232108;
}

.save:hover,
.save[aria-pressed="true"] {
  background: #fff;
}

.product-title {
  overflow-wrap: anywhere;
}

.product-title a {
  display: inline-block;
}

.product-photo:focus-visible {
  outline-offset: 4px;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 0 0 20px;
  font-size: 13px;
  color: var(--muted);
}

.active-filters > span {
  overflow-wrap: anywhere;
}

.filter-clear,
.size-guide-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Product photography: full image plus clearly labelled detail crops. */
.product-gallery .product-main {
  overflow: hidden;
}

.product-gallery .product-main img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 4px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.gallery-thumb {
  display: block;
  flex: 0 0 82px;
  width: 82px;
  padding: 3px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.gallery-thumb img {
  height: 94px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.gallery-thumb[aria-pressed="true"] {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.gallery-thumb span {
  display: block;
  padding: 5px 0 2px;
  font-size: 11px;
}

.gallery-note {
  margin: 10px 4px 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.product-info .eyebrow {
  margin-bottom: 14px;
}

.product-info .field select {
  max-width: 100%;
}

.product-info .field:has(.size-guide-link) {
  margin-bottom: 16px;
}

.quantity {
  height: 46px;
  background: var(--paper);
}

.quantity button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.quantity button:hover:not(:disabled) {
  background: var(--soft);
}

.quantity input {
  width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0;
  font-size: 16px;
  -moz-appearance: textfield;
}

.quantity input::-webkit-inner-spin-button,
.quantity input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.wish-outline {
  min-height: 48px;
}

.wish-outline[aria-pressed="true"] {
  color: #865448;
  border-color: #ad8a7f;
}

.details summary {
  align-items: center;
  min-height: 44px;
  gap: 16px;
}

.details summary::after {
  flex-shrink: 0;
}

.product-specs dl,
dl.product-specs {
  display: grid;
  grid-template-columns: minmax(80px, .65fr) minmax(0, 1.35fr);
  gap: 10px 18px;
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.8;
}

.product-specs dt {
  color: var(--muted);
}

.product-specs dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.recent-section {
  border-top: 1px solid var(--line);
  padding-top: 48px;
}

/* Gift selection stays part of the store, with simple budget guidance. */
.gift-guide {
  padding: 28px 30px;
  margin-bottom: 30px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.gift-guide h2 {
  font-size: 29px;
  margin-bottom: 12px;
}

.gift-guide p {
  font-size: 13px;
  margin-bottom: 18px;
}

.gift-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gift-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid #d6cfc8;
  background: var(--paper);
  font-size: 13px;
}

.gift-option[aria-pressed="true"] {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
}

.gift-option:hover {
  border-color: var(--ink);
}

/* Dialogs share clear close controls and an independent scroll area. */
dialog {
  width: min(650px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

dialog h2 {
  font-size: clamp(28px, 4vw, 40px);
  padding-right: 42px;
}

dialog::backdrop {
  background: rgba(37, 35, 33, .46);
}

.dialog-close {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  float: right;
  font-size: 29px;
  line-height: 1;
  margin: -12px -12px 8px 12px;
}

.dialog-close:hover {
  background: var(--soft);
}

.zoom-dialog {
  width: min(1000px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  background: var(--soft);
}

.zoom-dialog img {
  max-height: calc(100dvh - 130px);
  object-fit: contain;
}

#size-guide .policy-table {
  margin: 20px 0;
}

#size-guide .policy-table th,
#size-guide .policy-table td {
  padding: 12px 10px;
}

dialog.cart-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: 440px;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  padding: 0;
  border-left: 1px solid var(--line);
  overflow: hidden;
  background: var(--paper);
}

.cart-drawer[open] {
  display: flex;
  flex-direction: column;
}

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

.drawer-head h2 {
  font-size: 28px;
  margin: 0;
  padding: 0;
}

.drawer-head .dialog-close {
  float: none;
  flex-shrink: 0;
  margin: 0 -8px 0 0;
}

#drawer-content {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 24px;
}

.drawer-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.drawer-item img {
  width: 84px;
  height: 108px;
  object-fit: cover;
}

.drawer-item > .line-price {
  grid-column: 2;
  text-align: right;
  font-size: 14px;
}

#drawer-status:empty {
  display: none;
}

#drawer-status:not(:empty) {
  padding: 12px;
  background: var(--soft);
}

.drawer-item-info h3 {
  font: 18px/1.4 var(--serif);
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.drawer-item-info p {
  margin-bottom: 8px;
  font-size: 13px;
}

.drawer-item-info .quantity {
  margin-top: 8px;
}

.drawer-item-info .remove {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 8px;
  margin-left: 4px;
}

.drawer-item-info .quantity + .remove {
  vertical-align: middle;
}

.drawer-footer {
  margin-top: 24px;
  padding: 24px 0 calc(24px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}

.drawer-footer .btn + .btn {
  margin-top: 10px;
}

.drawer-footer .note {
  margin-top: 12px;
  text-align: center;
}

.drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 55vh;
  padding: 40px 0;
}

.drawer-empty h3 {
  font: 30px/1.2 var(--serif);
}

.drawer-empty p {
  font-size: 14px;
}

.drawer-status {
  padding: 10px 14px;
  margin: 18px 0 0;
  background: var(--soft);
  font-size: 13px;
  line-height: 1.7;
}

.drawer-status:empty {
  display: none;
}

/* Purchase and checkout feedback stay legible after quantities change. */
.bag-actions {
  flex-wrap: wrap;
  gap: 12px;
}

.summary-box {
  top: var(--header-offset);
}

.bag-actions .remove {
  min-height: 44px;
  padding: 8px 4px;
}

.bag-stock-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

.form-error {
  padding: 12px 16px;
  margin: 14px 0 22px;
  border: 1px solid #d6aaa2;
  background: #fbf2ef;
  color: var(--error-ink);
  font-size: 13px;
  line-height: 1.7;
}

[aria-invalid="true"] {
  border-color: var(--error-ink);
}

.checkout-step,
.checkout-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.checkout-step [aria-current="step"],
.checkout-steps [aria-current="step"],
.checkout-steps .active {
  color: var(--ink);
  font-weight: 500;
}

.checkout-steps {
  list-style: none;
  padding-left: 0;
}

.checkout-steps li {
  min-width: 0;
}

fieldset.delivery-options {
  border: 0;
  padding: 0;
  margin: 0 0 30px;
  min-width: 0;
}

.delivery-options legend {
  padding: 0;
  margin-bottom: 15px;
  font: 25px/1.3 var(--serif);
}

.field-error {
  display: block;
  margin: 7px 0 0;
  color: var(--error-ink);
  font-size: 13px;
  line-height: 1.6;
}

.field-error:empty {
  display: none;
}

.checkout-review-note {
  font-size: 13px;
  line-height: 1.8;
  padding: 16px 18px;
  background: var(--soft);
  margin: 24px 0 18px;
}

.checkrow {
  min-height: 44px;
  padding: 5px 0;
  align-items: flex-start;
}

.checkrow input,
.radio-card input {
  min-height: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.checkrow input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
}

.radio-card {
  min-height: 56px;
}

.radio-card:has(input:checked) {
  border-color: var(--accent);
  background: #faf8f5;
}

.order-item > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.order-item > span:last-child,
.money-line > :last-child {
  flex-shrink: 0;
  white-space: nowrap;
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.journal-products {
  padding: 40px 0 60px;
  border-top: 1px solid var(--line);
}

.journal-products h2 {
  margin-top: 0;
}

.mobile-buy-bar {
  display: none;
}

@media (max-width: 1000px) and (min-width: 701px) {
  .head-tools {
    gap: 16px;
  }

  .nav {
    gap: 20px;
  }
}

@media (max-width: 700px) {
  :root {
    --header-offset: 128px;
  }

  .head-main {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 132px;
    gap: 4px;
    padding: 0 4%;
    height: 76px;
  }

  .head-left,
  .head-tools {
    gap: 0;
    min-width: 0;
  }

  .head-tools {
    width: 132px;
  }

  .head-main .logo {
    font-size: clamp(20px, 6vw, 25px);
    letter-spacing: .12em;
  }

  .head-main .logo small {
    font-size: 8px;
    letter-spacing: .4em;
  }

  .mobile-nav.open {
    max-height: calc(100vh - 110px);
    max-height: calc(100dvh - 110px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-nav a {
    min-height: 48px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .shop-controls {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 20px;
  }

  .shop-controls input,
  .shop-controls select {
    width: 100%;
    min-width: 0;
  }

  .toolbar {
    gap: 16px;
    padding-top: 20px;
  }

  .chips {
    gap: 8px;
  }

  .chip {
    padding: 8px 12px;
  }

  .toolbar select {
    min-height: 46px;
    max-width: 100%;
  }

  .save {
    width: 44px;
    height: 44px;
    right: 5px;
    top: 5px;
  }

  .product-tag {
    top: 14px;
  }

  .price .note {
    font-size: 10px;
  }

  .gift-guide {
    padding: 22px 20px;
    margin-bottom: 24px;
  }

  .gift-guide h2 {
    font-size: 27px;
  }

  .gift-options {
    gap: 8px;
  }

  .gift-option {
    flex: 1 1 120px;
    padding: 10px 12px;
  }

  .product-layout {
    gap: 28px;
    padding-bottom: 48px;
  }

  .product-info h1 {
    font-size: clamp(30px, 8vw, 36px);
    overflow-wrap: anywhere;
  }

  .product-info .field:has(.quantity) {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: center;
  }

  .product-info .field:has(.quantity) .fieldlegend {
    flex: 0 0 100%;
    margin-bottom: 0;
  }

  .product-info .field:has(.quantity) > .small {
    margin-left: 0 !important;
  }

  .gallery-thumb {
    flex-basis: 72px;
    width: 72px;
  }

  .gallery-thumb img {
    height: 82px;
  }

  .mobile-buy-bar {
    position: fixed;
    inset: auto 0 0;
    z-index: 25;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(148px, .9fr);
    align-items: center;
    gap: 16px;
    padding: 12px 5% calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .98);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 22px #25232106;
  }

  .mobile-buy-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: 15px/1.5 var(--serif);
  }

  .mobile-buy-price {
    display: block;
    font-size: 13px;
    margin-top: 2px;
  }

  .mobile-buy-bar button {
    min-height: 48px;
    padding: 10px 12px;
    letter-spacing: .04em;
    font-size: 12px;
  }

  body:has(.mobile-buy-bar:not(.hidden):not([hidden])) {
    padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  }

  body:has(.mobile-buy-bar:not(.hidden):not([hidden])) .toast {
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  dialog {
    padding: 24px;
  }

  dialog h2 {
    font-size: 29px;
  }

  .dialog-close {
    margin: -8px -8px 8px 8px;
  }

  dialog.cart-drawer {
    border-left: 0;
    width: min(440px, 100vw);
  }

  .drawer-head {
    padding: 18px 20px;
  }

  #drawer-content {
    padding: 0 20px;
  }

  .drawer-head h2 {
    font-size: 27px;
  }

  .summary-box {
    padding: 24px 20px;
    position: static;
  }

  .order-card,
  .account-panel {
    padding: 24px 20px;
  }

  .bag-line {
    gap: 14px;
  }

  .bag-line h3 {
    overflow-wrap: anywhere;
  }

  .store-links .btn {
    flex: 1 1 160px;
  }

  .journal-products {
    padding: 30px 0 45px;
  }

  .footer a:not(.logo) {
    padding: 6px 0;
    margin-bottom: 4px;
    min-height: 44px;
  }
}

@media (max-width: 360px) {
  .head-main {
    padding: 0 3%;
    gap: 2px;
  }

  .head-main .logo {
    font-size: 20px;
    letter-spacing: .09em;
  }

  .announcement {
    font-size: 9px;
    letter-spacing: .025em;
  }

  .grid {
    gap: 24px 10px;
  }

  .product-title {
    font-size: 15px;
  }

  .drawer-item {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 12px;
  }

  .drawer-item img {
    width: 68px;
    height: 90px;
  }

  .drawer-item-info .remove {
    margin-left: 0;
  }

  .mobile-buy-bar {
    grid-template-columns: minmax(0, 1fr) 145px;
    gap: 10px;
  }

  .policy-table th,
  .policy-table td {
    padding: 12px 6px;
    overflow-wrap: anywhere;
  }
}

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

  .product-photo:hover img,
  .category-tile:hover img {
    transform: none;
  }
}
