/* "Minimal" shop layout (stores.theme.layout = "minimal").
   A bare product grid, a tiny header, small uppercase type, square corners, a slide-out bag.
   Colours still come from the store theme (--paper, --ink). Everything is scoped to .theme-minimal,
   so the classic layout is untouched. */

.preview-banner {
  margin: 0;
  padding: 6px 16px;
  background: #f7c548;
  color: #1a1a1a;
  font: 600 0.8125rem/1.4 system-ui, sans-serif;
  text-align: center;
}

.theme-minimal {
  --m-pad: clamp(16px, 2.4vw, 32px);
  --m-small: 0.6875rem;
  --font-body: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font-display: var(--font-body);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.theme-minimal :focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

.theme-minimal h1,
.theme-minimal h2,
.theme-minimal h3 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--m-small);
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.theme-minimal a {
  text-underline-offset: 3px;
}

/* Header: categories left, name centre, bag right */
.m-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 0 var(--m-pad);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(8px);
}

.m-nav {
  display: flex;
  gap: 22px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.m-nav a,
.m-bag-button,
.m-footer a {
  font-size: var(--m-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: var(--ink);
}

.m-nav a:hover,
.m-footer a:hover {
  text-decoration: underline;
}

.m-wordmark {
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: var(--ink);
}

.m-logo {
  display: block;
  height: 26px;
  width: auto;
}

.m-bag-button {
  justify-self: end;
  border: 0;
  background: none;
  padding: 8px 0;
  font-family: inherit;
  cursor: pointer;
}

/* Page frame */
.m-page {
  padding: 8px var(--m-pad) 72px;
}

.m-page-head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 28px;
}

.m-page-head span {
  font-size: var(--m-small);
  color: var(--muted);
}

.m-empty {
  padding: 15vh 0;
  text-align: center;
  font-size: var(--m-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* The grid */
.m-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 48px 16px;
}

.m-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-decoration: none;
  color: var(--ink);
}

.m-card-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--paper);
}

.m-card-media img {
  object-fit: contain;
  transition: opacity 0.25s ease;
}

.m-card-media .mockup {
  width: 100%;
  height: 100%;
}

.m-card-alt {
  opacity: 0;
}

@media (hover: hover) {
  .m-card:hover .has-alt img:first-child {
    opacity: 0;
  }

  .m-card:hover .m-card-alt {
    opacity: 1;
  }
}

.m-card-name {
  margin-top: 12px;
  max-width: 100%;
  font-size: var(--m-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-card:hover .m-card-name {
  text-decoration: underline;
}

.m-card-price {
  margin-top: 2px;
  font-size: var(--m-small);
  color: var(--muted);
}

/* Product page */
.theme-minimal .m-pdp {
  max-width: 1320px;
  margin: 0 auto;
}

.theme-minimal .m-pdp .crumbs {
  display: none;
}

.theme-minimal .pdp {
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: clamp(24px, 5vw, 80px);
  padding-top: 8px;
}

.theme-minimal .pdp-media,
.theme-minimal .thumbs button {
  background: var(--paper);
}

.theme-minimal .pdp-media img {
  object-fit: contain;
}

.theme-minimal .thumbs button[aria-pressed="true"] {
  outline: 1px solid var(--ink);
}

.theme-minimal .zoom-button {
  border-radius: 0;
  font-size: var(--m-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.theme-minimal .pdp-info {
  position: sticky;
  top: 72px;
  max-width: 420px;
}

.theme-minimal .pdp-title {
  font-size: 0.8125rem;
  font-weight: 600;
}

.theme-minimal .pdp-price {
  font-size: 0.8125rem;
  font-weight: 400;
  margin: 6px 0 28px;
}

.theme-minimal .option {
  margin-bottom: 22px;
}

.theme-minimal .option legend {
  font-weight: 400;
  font-size: var(--m-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.theme-minimal .option-current {
  color: var(--ink);
}

.theme-minimal .option-swatches,
.theme-minimal .option-pills {
  gap: 6px;
}

.theme-minimal .option-swatches button {
  width: 24px;
  height: 24px;
  border-radius: 0;
}

.theme-minimal .option-swatches button[aria-pressed="true"] {
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.2),
    0 0 0 2px var(--paper),
    0 0 0 3px var(--ink);
}

.theme-minimal .option-pills button {
  min-width: 48px;
  padding: 9px 10px;
  border-radius: 0;
  font-weight: 400;
  font-size: var(--m-small);
  letter-spacing: 0.06em;
}

.theme-minimal .add-to-cart {
  margin-top: 4px;
  padding: 15px;
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  font-size: var(--m-small);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.theme-minimal .add-to-cart:hover:not(:disabled) {
  background: color-mix(in srgb, var(--ink) 82%, var(--paper));
}

.theme-minimal .pdp-note,
.theme-minimal .pdp-delivery,
.theme-minimal .pdp-collections {
  font-size: var(--m-small);
  color: var(--muted);
}

.theme-minimal .pdp-description {
  font-size: 0.8125rem;
  border-top: 0;
  padding-top: 0;
  margin-top: 28px;
}

.theme-minimal .related {
  margin-top: 96px;
}

.theme-minimal .shelf-head {
  justify-content: center;
  gap: 24px;
  margin-bottom: 28px;
}

.theme-minimal .shelf-head h2 {
  font-size: var(--m-small);
}

.theme-minimal .shelf-head a {
  font-weight: 400;
  font-size: var(--m-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Other pages (cart, collections list, shipping & returns, thank-you, 404) keep their structure, restyled */
.theme-minimal .page {
  padding: 16px var(--m-pad) 72px;
}

.theme-minimal .page-head h1,
.theme-minimal .empty h1,
.theme-minimal .empty h2 {
  font-size: 0.8125rem;
}

.theme-minimal .crumbs {
  font-size: var(--m-small);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.theme-minimal .button {
  padding: 14px 24px;
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  font-size: var(--m-small);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.theme-minimal .button:hover {
  background: color-mix(in srgb, var(--ink) 82%, var(--paper));
}

.theme-minimal .policy h2,
.theme-minimal .order-summary h2,
.theme-minimal .collection-card h2 {
  font-size: var(--m-small);
}

.theme-minimal .collection-links a {
  border-radius: 0;
}

.theme-minimal .cart-summary {
  background: none;
  border: 1px solid var(--line);
}

.theme-minimal .cart-thumb,
.theme-minimal .cart-thumb img {
  background: var(--paper);
  object-fit: contain;
}

.theme-minimal .cart-line-title {
  font-weight: 500;
  font-size: var(--m-small);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.theme-minimal .cart-line-qty select {
  border-radius: 0;
}

.theme-minimal .cart-total {
  font-size: 0.875rem;
}

.theme-minimal .cart-error {
  border-left-color: var(--ink);
  background: var(--tint);
}

/* Footer */
.m-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px var(--m-pad) 40px;
}

.m-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
}

.m-footer p {
  margin: 0;
  font-size: var(--m-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Slide-out bag */
html.bag-open {
  overflow: hidden;
}

.m-bag {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.m-bag-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: color-mix(in srgb, var(--ink) 25%, transparent);
  cursor: pointer;
  animation: m-fade 0.2s ease;
}

.m-bag-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100%);
  overflow-y: auto;
  padding: 0 var(--m-pad) 32px;
  background: var(--paper);
  color: var(--ink);
  animation: m-slide 0.25s ease;
}

.m-bag-panel:focus {
  outline: none;
}

.m-bag-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  margin-bottom: 8px;
  background: var(--paper);
  font-size: var(--m-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.m-bag-close {
  border: 0;
  background: none;
  padding: 8px 0;
  font: inherit;
  color: var(--ink);
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.m-bag-panel .cart {
  display: block;
}

.m-bag-panel .cart-line {
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px 14px;
}

.m-bag-panel .cart-thumb {
  width: 72px;
}

.m-bag-panel .cart-line-total {
  grid-column: 2 / -1;
  text-align: left;
  font-weight: 400;
}

.m-bag-panel .cart-summary {
  margin-top: 20px;
  padding: 18px;
}

.m-bag-panel .empty {
  padding: 48px 0;
  text-align: center;
}

@keyframes m-slide {
  from {
    transform: translateX(100%);
  }
}

@keyframes m-fade {
  from {
    opacity: 0;
  }
}

/* Smaller screens */
@media (max-width: 1400px) {
  .m-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .m-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .theme-minimal .pdp {
    grid-template-columns: 1fr;
  }

  .theme-minimal .pdp-info {
    position: static;
    max-width: none;
  }
}

@media (max-width: 700px) {
  .m-header {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand bag"
      "nav nav";
    row-gap: 0;
    padding-top: 6px;
  }

  .m-wordmark {
    grid-area: brand;
  }

  .m-bag-button {
    grid-area: bag;
  }

  .m-nav {
    grid-area: nav;
    padding: 4px 0 10px;
  }

  .m-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 12px;
  }
}

.theme-minimal .cart-line-variant,
.theme-minimal .cart-line-price,
.theme-minimal .cart-hint,
.theme-minimal .link-button {
  font-size: var(--m-small);
}

/* Collection long-form text in the minimal layout */
.theme-minimal .story {
  margin: 64px auto 0;
  font-size: var(--m-small);
}

.theme-minimal .story h2 {
  font-family: inherit;
  font-size: var(--m-small);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.theme-minimal .story a {
  color: inherit;
}
