/*
 * Global styles: tokens, reset, typography, forms and a few components.
 * Styles that belong to one section or block live in its {% stylesheet %} tag.
 * Colors and fonts come from Theme settings (snippets/theme-styles.liquid).
 *
 * The look is minimal and editorial: square corners, 1px rules instead of shadows,
 * warm grays derived from the color scheme, and short, soft transitions.
 */

:root {
  --gutter: 1.5rem;
  --font-mono-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 150ms;
}

@media (min-width: 990px) {
  :root { --gutter: 2.5rem; }
}

/* Fallback colors, used only if the color scheme variables are missing */
:where(:root) {
  --color-background: #fdfdfc;
  --color-foreground: #21201c;
  --color-border: #e9e8e6;
}

/* Grays mixed from the scheme's text and background colors */
:root,
.color-scheme {
  --color-muted: color-mix(in srgb, var(--color-foreground) 70%, var(--color-background));
  --color-subtle: color-mix(in srgb, var(--color-foreground) 55%, var(--color-background));
  --color-hairline: color-mix(in srgb, var(--color-foreground) 16%, var(--color-background));
  --color-surface: color-mix(in srgb, var(--color-foreground) 3%, var(--color-background));
  --color-hover: color-mix(in srgb, var(--color-foreground) 6%, var(--color-background));
}

/* Reset */

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

* {
  margin: 0;
}

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body-family);
  font-style: var(--font-body-style);
  font-weight: var(--font-body-weight);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--color-foreground);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul[role="list"],
ol[role="list"] {
  padding: 0;
  list-style: none;
}

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

[hidden] {
  display: none !important;
}

::selection {
  color: var(--color-background);
  background: var(--color-foreground);
}

/*
 * Frame: the page column, with a 1px rule on each side that runs the full height
 * of the page. `.bleed-top` and `.bleed-bottom` draw horizontal rules that cross
 * the frame and run to the edges of the screen.
 */

.frame {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* The main area grows, so the footer stays at the bottom of short pages */
#main {
  flex: 1 0 auto;
}

@media (min-width: 750px) {
  body {
    margin-inline: 2rem;
  }
  .frame {
    max-width: var(--page-width);
    margin-inline: auto;
    border-inline: 1px solid var(--color-border);
  }
}

@media (min-width: 990px) {
  body {
    margin-inline: 4rem;
  }
}

:where(.bleed-top, .bleed-bottom) {
  position: relative;
}

.bleed-top::before,
.bleed-bottom::after {
  position: absolute;
  inset-inline: -100vw;
  height: 1px;
  content: "";
  background: var(--color-border);
  pointer-events: none;
}

.bleed-top::before {
  top: -1px;
}

.bleed-bottom::after {
  bottom: -1px;
}

.page-width {
  width: 100%;
  padding-inline: var(--gutter);
}

/* Typography */

h1,
h2,
h3 {
  font-family: var(--font-heading-family);
  font-style: var(--font-heading-style);
  font-weight: var(--font-heading-weight);
  color: var(--color-foreground);
  text-wrap: pretty;
}

h1 {
  font-size: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.125rem;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 0.2em;
  transition: color 100ms ease-out, text-decoration-color 100ms ease-out;
}

a:hover {
  text-decoration-color: currentColor;
}

.lead {
  max-width: 40rem;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--color-muted);
  text-wrap: pretty;
}

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

.label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
}

code,
.mono {
  font-family: var(--font-mono-family);
  font-size: 0.875em;
  letter-spacing: normal;
}

.rte > * + * {
  margin-block-start: 1em;
}

.rte :is(ul, ol) {
  padding-inline-start: 1.25em;
}

/* Layout helpers */

.color-scheme {
  color: var(--color-foreground);
  background: var(--color-background);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem 1.5rem;
}

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

.listing,
.account {
  padding-block: 4rem 6rem;
}

.account {
  max-width: 36rem;
}

.account__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Motion: blurs in and rises, used by the header dropdown */

@keyframes blur-up {
  from { opacity: 0; filter: blur(8px); transform: translateY(12px); }
}

/* Buttons */

.button {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding-inline: 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--color-background);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  background: var(--color-foreground);
  border: 0;
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

.button:hover {
  background: color-mix(in srgb, var(--color-foreground) 80%, var(--color-background));
}

.button:active {
  background: var(--color-foreground);
}

.button--sm {
  height: 2rem;
  padding-inline: 0.75rem;
}

.button--secondary {
  color: var(--color-foreground);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--color-hairline);
}

.button--secondary:hover {
  background: var(--color-hover);
}

.button:disabled {
  pointer-events: none;
  opacity: 0.5;
}

:focus-visible {
  outline: 2px solid var(--color-foreground);
  outline-offset: 2px;
}

/* Forms */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

input:not([type="checkbox"], [type="radio"]),
select,
textarea {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 400;
  background: var(--color-background);
  border: 1px solid var(--color-hairline);
  border-radius: 0;
  transition: border-color var(--duration) var(--ease);
}

select {
  padding-inline-end: 2.25rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%238d8d86' stroke-width='1.5'%3E%3Cpath d='m1 1 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 10px 6px;
}

[dir="rtl"] select {
  background-position: left 0.875rem center;
}

input:not([type="checkbox"], [type="radio"]):hover,
select:hover,
textarea:hover {
  border-color: var(--color-subtle);
}

input:not([type="checkbox"], [type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: var(--color-foreground);
  outline: none;
}

:is(input, select, textarea):disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

::placeholder {
  color: var(--color-subtle);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--color-foreground);
}

fieldset {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

fieldset:disabled {
  opacity: 0.5;
}

.checkbox {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.875rem;
}

.field__error,
.alert {
  font-size: 0.875rem;
}

.alert {
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-hairline);
  border-inline-start: 2px solid var(--color-foreground);
}

/* Errors that arrive after a request float over the page, so they don't push content down. */
.toast {
  position: fixed;
  inset-inline: 1rem;
  bottom: 1rem;
  z-index: 60;
  max-width: 28rem;
  margin-inline: auto;
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--color-background);
  background: var(--color-foreground);
  animation: blur-up 200ms var(--ease);
}

/* Tables and totals */

table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
}

th,
td {
  padding: 0.75rem 0;
  text-align: start;
  border-block-end: 1px solid var(--color-border);
}

th {
  font-weight: 500;
  color: var(--color-muted);
}

.cart__totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  padding: 1.25rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
}

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

.cart__totals dt:last-of-type,
.cart__totals dd:last-of-type {
  padding-block-start: 0.75rem;
  font-weight: 500;
  color: var(--color-foreground);
  border-block-start: 1px solid var(--color-border);
}

/* Components */

.price {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.price s {
  font-weight: 400;
  color: var(--color-subtle);
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9375rem;
}

.product-card a {
  text-decoration: none;
}

.product-card a:hover {
  text-decoration: underline;
}

.product-card__media {
  margin-block-end: 0.75rem;
  overflow: hidden;
  background: var(--color-surface);
  outline: 1px solid var(--color-border);
}

.media-square {
  display: block;
  overflow: hidden;
  background: var(--color-surface);
  outline: 1px solid var(--color-border);
}

.product-card__media img,
.product-card__media svg,
.media-square img,
.media-square svg {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}

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

.collection-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.collection-card:hover span {
  text-decoration: underline;
}

.product-card .price {
  color: var(--color-muted);
}

.placeholder {
  background: var(--color-surface);
  fill: var(--color-hairline);
}

.pagination {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  padding-block-start: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

[aria-busy="true"] {
  pointer-events: none;
  opacity: 0.5;
}

/* The store name, shown when no logo is set */

.logo-text {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Accessibility */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100%;
  z-index: 60;
}

.skip-link:focus {
  top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    animation: none !important;
  }
}
