/* Global UX: navigation, cart, motion, mobile, conversion helpers */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.site--home-crafted {
  overflow-x: clip;
  scroll-padding-top: calc(var(--gisou-header-offset, var(--gisou-header-h, 4.25rem)) + env(safe-area-inset-top, 0px));
}

.site--home-crafted .gh-header.is-scrolled {
  box-shadow: 0 0.15rem 1rem rgba(26, 18, 12, 0.08);
}

body.mobile-nav-open,
body.cart-open {
  overflow: hidden;
}

body.cart-open {
  touch-action: none;
}

body.cart-open .gpdp-sticky,
body.cart-open .gh-footer {
  pointer-events: none;
}

/* Touch targets */
.gh-icon-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.gh-icon-btn,
.gh-fav__atc,
.gclp-card__atc,
.gpdp__atc,
.gpdp-sticky__btn,
.cart-drawer__close {
  min-height: 2.75rem;
  min-width: 2.75rem;
}

/* Focus visible */
:where(.gh-icon-btn, .gh-fav__atc, .gclp-card__atc, .gpdp__atc, .gpdp-focus__tab, .gh-nav__link, .btn):focus-visible {
  outline: 2px solid #c9a227;
  outline-offset: 2px;
}

/* Cart drawer (Gisou) */
.cart-drawer--gisou {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  font-family: var(--gisou-font, system-ui, sans-serif);
  pointer-events: none;
  visibility: hidden;
}

.cart-drawer--gisou:not([hidden]) {
  pointer-events: auto;
  visibility: visible;
}

.cart-drawer--gisou[hidden] {
  display: none !important;
}

.cart-drawer__backdrop {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(26, 18, 12, 0.42);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.32s ease;
}

.cart-drawer--gisou.is-open .cart-drawer__backdrop {
  opacity: 1;
}

.cart-drawer--gisou .cart-drawer__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: min(100vw, 26rem);
  max-width: 100%;
  height: 100%;
  max-height: 100dvh;
  margin: 0;
  padding: 0 !important;
  overflow: hidden;
  background: #fff;
  box-shadow: -0.35rem 0 2.5rem rgba(26, 18, 12, 0.14);
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'kern' 1, 'liga' 1;
}

@media (min-width: 768px) {
  .cart-drawer--gisou .cart-drawer__panel {
    width: min(32rem, 38vw);
  }
}

.cart-drawer--gisou.is-open .cart-drawer__panel {
  transform: translateX(0);
}

.cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(93, 51, 27, 0.08);
  background: #fff;
}

.cart-drawer__title {
  margin: 0;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1a120c;
}

.cart-drawer__title-count {
  font-weight: 600;
  letter-spacing: 0.06em;
  opacity: 0.65;
}

.cart-drawer__close {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  color: #1a120c;
  padding: 0.35rem;
  margin: -0.35rem -0.15rem -0.35rem 0;
  border-radius: 0.25rem;
}

.cart-drawer__main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.cart-drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.25rem 1.15rem 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.cart-drawer__main:has([data-cart-upsell]:not([hidden])) .cart-drawer__body {
  flex: 1 1 58%;
  min-height: 9rem;
}

.cart-drawer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 8rem;
  padding: 1.5rem 0.5rem 0.75rem;
}

.cart-drawer--gisou:has([data-cart-upsell]:not([hidden])) .cart-drawer__empty {
  min-height: auto;
  padding: 1.25rem 0.5rem 0.35rem;
}

.cart-drawer__empty[hidden] {
  display: none !important;
}

.cart-drawer__empty-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1a120c;
}

.cart-drawer__empty-hint {
  margin: 0;
  max-width: 16rem;
  font-family: var(--gisou-font-serif, Georgia, serif);
  font-size: 0.9rem;
  line-height: 1.55;
  font-weight: 400;
  color: rgba(26, 18, 12, 0.72);
}

.cart-drawer__lines {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cart-drawer--gisou .cart-drawer__lines {
  width: 100%;
}

.gh-cart-line {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(93, 51, 27, 0.06);
}

.gh-cart-line:last-child {
  border-bottom: none;
  padding-bottom: 0.35rem;
}

.gh-cart-line__media {
  display: block;
  width: 4.25rem;
  aspect-ratio: 1;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #f6f0e8;
  text-decoration: none;
  flex-shrink: 0;
}

.gh-cart-line__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gh-cart-line__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #f3ebe0, #e8ddd0);
}

.gh-cart-line__main {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 0.65rem;
  row-gap: 0.45rem;
  align-items: start;
}

.gh-cart-line__copy {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.gh-cart-line__title {
  margin: 0;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: #1a120c;
  text-decoration: none;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

a.gh-cart-line__title:hover {
  text-decoration: underline;
}

.gh-cart-line__variant {
  margin: 0.2rem 0 0;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: rgba(26, 18, 12, 0.48);
}

.gh-cart-line__row {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
}

.gh-cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(93, 51, 27, 0.12);
  border-radius: 999px;
  overflow: hidden;
  background: #faf8f5;
}

.gh-cart-qty__btn {
  appearance: none;
  border: none;
  background: transparent;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: #1a120c;
}

.gh-cart-qty__btn:hover {
  background: rgba(93, 51, 27, 0.08);
}

.gh-cart-qty__value {
  min-width: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.gh-cart-line__remove {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  text-decoration: none;
  color: rgba(26, 18, 12, 0.45);
  cursor: pointer;
}

.gh-cart-line__remove:hover {
  color: #1a120c;
}

.gh-cart-line__price {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: #1a120c;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  align-self: start;
}

.gh-cart-line__price-value {
  display: inline-block;
  white-space: nowrap;
}

.cart-drawer__upsell {
  flex: 0 0 auto;
  max-height: 7.25rem;
  padding: 0.45rem 0 0.35rem;
  border-top: 1px solid rgba(93, 51, 27, 0.08);
  background: linear-gradient(180deg, #faf8f5 0%, #fff 100%);
}

.cart-drawer__upsell[hidden] {
  display: none !important;
}

.cart-drawer__upsell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 1.15rem 0.35rem;
}

.cart-drawer__upsell-title {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(26, 18, 12, 0.55);
}

.cart-drawer__upsell-nav {
  display: flex;
  gap: 0.35rem;
}

.cart-drawer__upsell-arrow {
  appearance: none;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 1px solid rgba(93, 51, 27, 0.12);
  border-radius: 999px;
  background: #fff;
  color: rgba(26, 18, 12, 0.7);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.cart-drawer__upsell-arrow:hover {
  background: #f3ebe0;
}

.cart-drawer__upsell-track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 1.15rem 0.45rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
  cursor: grab;
}

.cart-drawer__upsell-track::-webkit-scrollbar {
  display: none;
}

.cart-drawer__upsell-track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.cart-drawer--gisou .gh-cart-upsell__card {
  flex: 0 0 min(17.5rem, 92%);
  width: min(17.5rem, 92%);
  max-width: 100%;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  min-width: 0;
  padding: 0.35rem 0.45rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(93, 51, 27, 0.06);
}

.cart-drawer--gisou .gh-cart-upsell__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 0.35rem;
  overflow: hidden;
  background: #f3ebe0;
  text-decoration: none;
}

.cart-drawer--gisou .gh-cart-upsell__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.cart-drawer--gisou .gh-cart-upsell__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  min-width: 0;
}

.cart-drawer--gisou .gh-cart-upsell__title {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: #1a120c;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-drawer--gisou .gh-cart-upsell__title:hover {
  text-decoration: underline;
}

.cart-drawer--gisou .gh-cart-upsell__price {
  margin: 0;
  width: 100%;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(26, 18, 12, 0.65);
  font-variant-numeric: tabular-nums;
}

.cart-drawer--gisou .gh-cart-upsell__price-value {
  display: inline-block;
  white-space: nowrap;
}

.cart-drawer--gisou .gh-cart-upsell__atc {
  appearance: none;
  align-self: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 1px solid rgba(93, 51, 27, 0.18);
  border-radius: 999px;
  background: #fff;
  color: rgb(var(--gisou-brown-rgb, 83 38 12));
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.cart-drawer--gisou .gh-cart-upsell__atc:hover {
  background: rgb(var(--gisou-brown-rgb, 83 38 12));
  color: #fff;
  border-color: transparent;
}

.cart-drawer__foot {
  flex-shrink: 0;
  padding: 0.85rem 1.15rem calc(1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(93, 51, 27, 0.08);
  background: #faf8f5;
  box-shadow: 0 -0.35rem 1.25rem rgba(26, 18, 12, 0.04);
}

.cart-drawer__foot.is-empty .cart-drawer__promo-cap,
.cart-drawer__foot.is-empty .cart-drawer__summary,
.cart-drawer__foot.is-empty .cart-drawer__checkout {
  display: none;
}

.cart-drawer__promo-cap {
  margin: 0 0 0.65rem;
  font-size: 0.62rem;
  line-height: 1.4;
  font-weight: 500;
  color: rgba(26, 18, 12, 0.48);
  text-align: center;
}

.cart-drawer__summary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
  padding: 0;
}

.cart-drawer__summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: none;
  color: rgba(26, 18, 12, 0.62);
}

.cart-drawer__summary-row span:last-child,
.cart-drawer__summary-row strong,
.cart-drawer__summary-row [data-cart-subtotal],
.cart-drawer__summary-row [data-cart-discount],
.cart-drawer__summary-row [data-cart-total] {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #1a120c;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.cart-drawer__summary-row--discount span:last-child {
  color: #5d331b;
  font-weight: 600;
}

.cart-drawer__summary-row--due {
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(93, 51, 27, 0.1);
  color: #1a120c;
  font-weight: 600;
}

.cart-drawer__summary-row--due strong {
  font-size: 1.05rem;
  font-weight: 700;
}

.cart-drawer__checkout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  width: 100%;
  padding: 0.85rem 1rem;
  margin: 0 0 0.55rem;
  border: none;
  border-radius: 0.35rem;
  background: rgb(var(--gisou-brown-rgb, 83 38 12));
  color: #fff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.cart-drawer__checkout:hover:not(:disabled) {
  opacity: 0.92;
}

.cart-drawer__checkout:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cart-drawer__checkout-note {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: none;
  opacity: 0.88;
}

.cart-drawer__continue {
  display: block;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gisou-brown, #5d331b);
  text-decoration: none;
}

.cart-drawer__continue:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .cart-drawer--gisou .cart-drawer__panel {
    width: 100vw;
  }

  .cart-drawer__backdrop {
    display: none;
  }
}

/* Add-to-bag toast */
.gh-toast {
  position: fixed;
  left: 50%;
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(1rem);
  z-index: 2200;
  padding: 0.75rem 1.25rem;
  border-radius: 2rem;
  background: #1a120c;
  color: #fff;
  font-family: var(--gisou-font, system-ui, sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.gh-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.site--pdp-crafted .gh-toast {
  bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
}

/* Favorites track drag */
.gh-favorites__track {
  touch-action: pan-x;
  cursor: grab;
}

.gh-favorites__track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

/* PDP gallery swipe hint */
.gpdp__gallery-main {
  touch-action: pan-y pinch-zoom;
}

@media (max-width: 749px) {
  .gpdp__hero {
    padding-top: 0.5rem;
  }

  .gpdp__buy {
    padding-top: 0.25rem;
  }

  .gclp__grid {
    gap: 0.75rem 0.65rem;
  }

}

/* Conversion: subtle ATC feedback */
@keyframes gh-atc-pulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(0.97);
  }
  100% {
    transform: scale(1);
  }
}

.gh-fav__atc.is-added,
.gclp-card__atc.is-added,
.gpdp__atc.is-added,
.gpdp-sticky__btn.is-added {
  animation: gh-atc-pulse 0.35s ease;
}

.gh-header__cart-wrap,
.header-cart-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gh-cart-icon {
  display: block;
}

.gh-cart-count {
  position: absolute;
  top: 0.05rem;
  right: -0.05rem;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 1.05rem;
  width: 1.05rem;
  height: 1.05rem;
  padding: 0;
  border-radius: 50%;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.5625rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  color: #fff;
  background: rgb(var(--gisou-brown-rgb, 83 38 12));
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(26, 18, 12, 0.2);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.gh-cart-count[data-has-items='true']:not([hidden]) {
  min-width: 1.05rem;
  width: auto;
  padding: 0 0.28rem;
}

.gh-header__cart-wrap.has-cart-items .gh-cart-count,
.header-cart-wrap.has-cart-items .gh-cart-count,
.gh-cart-count[data-has-items='true'] {
  display: inline-flex;
}

.gh-cart-count[hidden] {
  display: none !important;
}
