@font-face {
  font-family: "D-DIN";
  src: url("../fonts/D-DIN.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-cream: #fffbfa;
  --color-ink: #000000;
  --color-charcoal: #242424;
  --color-forest: #084d2d;
  --color-maroon: #550000;
  --color-taupe: #a89382;
  --color-neon: #f8ff0a;
  --color-mist: #f4f4f4;
  --color-hairline: #bfbfbf;
  --color-slate: #212529;

  --font-caption: "D-DIN", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Assistant", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--color-cream);
  color: var(--color-ink);
  font-family: var(--font-body);
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.caption {
  font-family: var(--font-caption);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Header */
.site-header {
  --header-bg: #fff;
  --header-fg: var(--color-maroon);
  position: relative;
  z-index: 30;
  background: var(--header-bg);
  padding: 1.25rem 1.5rem;
}

.site-header__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  row-gap: 0.75rem;
  color: var(--header-fg);
}

.site-header__nav > a.caption:hover,
.site-header__nav > a.caption:focus-visible,
.site-header__nav > a.caption[aria-expanded="true"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.site-header__logo {
  flex-shrink: 0;
}

/* Wordmark drawn in the nav text color via the SVG as a mask. */
.site-header__logo-mark {
  display: block;
  width: 170px;
  aspect-ratio: 191 / 14.5333;
  background-color: currentColor;
  -webkit-mask: url("../icons/logo-header-wordmark.svg") center / contain no-repeat;
  mask: url("../icons/logo-header-wordmark.svg") center / contain no-repeat;
}

.site-header__bag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-header__bag-icon {
  position: relative;
  display: flex;
  flex-shrink: 0;
}

/* Bag icon drawn in the nav text color via the SVG as a mask. */
.site-header__bag-glyph {
  display: block;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: url("../icons/bag.svg") center / contain no-repeat;
  mask: url("../icons/bag.svg") center / contain no-repeat;
}

/* Item count: a small filled circle on the icon's top-right corner, in the
   nav colour (so it inverts with the header when a menu is open). */
.site-header__bag-count {
  position: absolute;
  top: -6px;
  right: -7px;
  display: flex;
  box-sizing: border-box;
  height: 13px;
  min-width: 13px;
  padding: 0 3px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--header-fg);
  color: var(--header-bg);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0;
}

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

/* Hamburger (mobile only): three lines that turn into a cross when open. */
.site-header__menu-toggle {
  display: none;
  align-items: center;
  width: 44px;
  height: 32px;
  margin-left: -0.5rem;
  padding: 0 0.5rem;
  color: inherit;
}

.site-header__menu-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 1.25px;
  background: currentColor;
  transition: background-color 0.2s ease;
}

.site-header__menu-icon::before,
.site-header__menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.25px;
  background: currentColor;
  transition: transform 0.2s ease;
}

.site-header__menu-icon::before {
  transform: translateY(-6px);
}

.site-header__menu-icon::after {
  transform: translateY(6px);
}

.site-header__menu-toggle[aria-expanded="true"] .site-header__menu-icon {
  background-color: transparent;
}

.site-header__menu-toggle[aria-expanded="true"] .site-header__menu-icon::before {
  transform: rotate(45deg);
}

.site-header__menu-toggle[aria-expanded="true"] .site-header__menu-icon::after {
  transform: rotate(-45deg);
}

/* Below 906px: hamburger, logo and Bag only; everything else moves into the
   mobile menu. */
@media (max-width: 905.98px) {
  .site-header__nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .site-header__link {
    display: none;
  }

  .site-header__menu-toggle {
    display: flex;
    justify-self: start;
  }

  .site-header__logo-mark {
    width: 150px;
  }

  .site-header__bag {
    justify-self: end;
  }
}

/* Shop/Craft panels: full-screen term list, header turns maroon */
body.has-nav-panel-open {
  overflow: hidden;
}

body.has-nav-panel-open .site-header {
  --header-bg: var(--color-maroon);
  --header-fg: #fff;
  position: fixed;
  top: var(--wp-admin--admin-bar--height, 0px); /* Below WordPress's admin bar when logged in. */
  left: 0;
  right: 0;
}

.nav-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow-y: auto;
  background: var(--color-maroon);
  color: #fff;
  padding: calc(56px + 2.5rem + var(--wp-admin--admin-bar--height, 0px)) 1.5rem 2.5rem;
}

/* List sits under the nav item that opened it (offset measured in nav.js). */
.nav-panel--aligned {
  padding-left: var(--panel-align, 1.5rem);
}

.nav-panel[hidden] {
  display: none;
}

.nav-panel__heading {
  margin: 0 0 1.75rem;
  font-weight: 400;
}

.nav-panel__list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-panel__list[hidden] {
  display: none;
}

/* Expand/collapse sections (Shop panel) */
.nav-panel__section + .nav-panel__section {
  margin-top: 2.5rem;
}

.nav-panel__section .nav-panel__heading {
  margin: 0;
}

.nav-panel__section .nav-panel__list {
  margin-top: 1.75rem;
}

.nav-panel__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0;
  color: inherit;
  transition: opacity 0.15s ease;
}

.nav-panel__toggle[aria-expanded="false"] {
  opacity: 0.6;
}

.nav-panel__toggle:hover,
.nav-panel__toggle:focus-visible {
  opacity: 1;
}

/* Plus when collapsed, minus when expanded. */
.nav-panel__icon {
  position: relative;
  width: 11px;
  height: 11px;
}

.nav-panel__icon::before,
.nav-panel__icon::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.nav-panel__icon::before {
  left: 0;
  right: 0;
  top: 5px;
  height: 1.5px;
}

.nav-panel__icon::after {
  top: 0;
  bottom: 0;
  left: 4.75px;
  width: 1.5px;
}

.nav-panel__toggle[aria-expanded="true"] .nav-panel__icon::after {
  display: none;
}

/* Mobile menu: one level at a time, sliding sideways between levels. */
.mobile-menu {
  overflow-x: hidden;
  padding: 0;
}

.mobile-menu__level {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: 100%;
  box-sizing: border-box;
  padding: calc(72px + 1.5rem + var(--wp-admin--admin-bar--height, 0px)) 1.5rem 2.5rem;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s ease, visibility 0s linear 0.3s;
}

.mobile-menu__level.is-current {
  transform: none;
  visibility: visible;
  transition: transform 0.3s ease, visibility 0s;
}

.mobile-menu__level.is-behind {
  transform: translateX(-100%);
}

.mobile-menu__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Light, airy type (white on maroon is rendered without extra weight). */
.mobile-menu {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mobile-menu__list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.mobile-menu__list > li > a,
.mobile-menu__list > li > button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 32px;
  padding: 0;
  color: inherit;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1px;
  text-align: left;
}

/* Chevron: this item opens its own level. */
.mobile-menu__back::before {
  content: "";
  width: 7px;
  height: 7px;
  border-top: 1.25px solid currentColor;
  border-right: 1.25px solid currentColor;
  transform: rotate(45deg);
}

.mobile-menu__back {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0;
  color: inherit;
  opacity: 0.75;
}

.mobile-menu__back::before {
  transform: rotate(-135deg);
}

/* Shop / Craft: the level's name is the back control, in place of a heading. */
.mobile-menu__back--titled {
  margin-bottom: 1.5rem;
  font-size: 15px;
  opacity: 1;
}

.mobile-menu__title {
  margin: 1.25rem 0 2rem;
  font-size: 15px;
}

.mobile-menu .nav-panel__list a {
  display: inline-block;
  padding: 0.25rem 0;
}

.mobile-menu .search-panel__form {
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

.mobile-menu .search-panel__form input[type="search"] {
  color: #fff;
  font-size: 15px;
}

.mobile-menu .search-panel__form input[type="search"]::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.mobile-menu .search-panel__form img {
  filter: invert(1);
}

@media (min-width: 906px) {
  .mobile-menu {
    display: none !important;
  }
}

/* Search panel: drops below the header */
.search-panel {
  background: #fff;
  padding: 0 1.5rem 1.25rem;
}

.search-panel[hidden] {
  display: none;
}

.search-panel__form {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--color-hairline);
  padding-bottom: 0.375rem;
}

.search-panel__form input[type="search"] {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0 2.5rem 0 0;
  font-family: var(--font-caption);
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #000;
  outline: none;
}

.search-panel__form input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.search-panel__form button {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
}

/* Homepage capsule sections: the image fills the screen below the header
   (framed on its subject, see ganga_jamni_image_focus()); the name and Shop
   Now sit just below it, so they only appear once the visitor scrolls. */
:root {
  --header-height: 56px;
}

@media (max-width: 905.98px) {
  :root {
    --header-height: 72px;
  }
}

.capsule-section__media {
  position: relative;
  height: calc(100vh - var(--header-height) - var(--wp-admin--admin-bar--height, 0px));
  height: calc(100svh - var(--header-height) - var(--wp-admin--admin-bar--height, 0px));
  min-height: 320px;
  overflow: hidden;
}

.capsule-section__media > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.capsule-section__caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
}

.capsule-section__shop-now {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.capsule-section__shop-now img {
  width: 21px;
  height: 14px;
}

.accent-ink { color: var(--color-ink); }
.accent-neon { color: var(--color-neon); }
.accent-charcoal { color: var(--color-charcoal); }
.accent-forest { color: var(--color-forest); }

/* Footer */

.site-footer__main {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  background: var(--color-maroon);
  padding: 2.5rem 1.5rem 2rem;
}

.site-footer__logo img {
  width: 140px;
  height: 10.65px;
}

/* Campaign page */
.campaigns {
  padding-bottom: 3rem;
}

.campaigns__heading {
  margin: 0;
  padding: 3rem 1.5rem;
  font-weight: 400;
}

.campaigns__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1023px) {
  .campaigns__grid { grid-template-columns: repeat(2, 1fr); }
}

.campaign-card {
  position: relative;
  display: block;
  aspect-ratio: 500 / 705;
  overflow: hidden;
  outline: none;
}

.campaign-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.campaign-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  /* Colour detected from the campaign image; taupe if none could be found. */
  background: var(--campaign-color, var(--color-taupe));
  opacity: 0;
  transition: opacity 0.45s ease;
}

.campaign-card:hover .campaign-card__overlay,
.campaign-card:focus-visible .campaign-card__overlay {
  opacity: 1;
}

.campaign-card__name {
  margin: 0;
  font-weight: 400;
  text-align: center;
  color: var(--campaign-text, var(--color-charcoal));
}

/* Below 906px (touch): no hover. One full-screen campaign per view with its
   name always shown in white at the centre; pressing a card still flashes
   the campaign colour, as the desktop hover does. */
@media (max-width: 905.98px) {
  .campaigns__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .campaign-card {
    aspect-ratio: auto;
    height: calc(100vh - var(--header-height) - var(--wp-admin--admin-bar--height, 0px));
    height: calc(100svh - var(--header-height) - var(--wp-admin--admin-bar--height, 0px));
    min-height: 320px;
    -webkit-tap-highlight-color: transparent;
  }

  .campaign-card .campaign-card__overlay,
  .campaign-card:hover .campaign-card__overlay,
  .campaign-card:focus-visible .campaign-card__overlay {
    opacity: 1;
    background: transparent;
    transition: background-color 0.2s ease;
  }

  .campaign-card .campaign-card__name {
    color: #fff;
    text-shadow: 0 0 14px rgba(0, 0, 0, 0.25);
    transition: color 0.2s ease;
  }

  .campaign-card:active .campaign-card__overlay {
    background: var(--campaign-color, var(--color-taupe));
  }

  .campaign-card:active .campaign-card__name {
    color: var(--campaign-text, var(--color-charcoal));
    text-shadow: none;
  }
}

/* Campaign page (photos view) */
.campaign {
  padding-bottom: 3rem;
}

.campaign__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 3rem 1.5rem;
}

.campaign__title {
  margin: 0;
  font-weight: 400;
}

.campaign__read-more {
  padding: 0;
  color: inherit;
}

.campaign__read-more:hover,
.campaign__read-more:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.campaign__photos {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0 1.5rem;
}

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

@media (max-width: 559px) {
  .campaign__photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.campaign__photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--color-mist);
  /* A light, shared grade so the photos read as one collection. */
  filter: sepia(0.06) saturate(0.94) contrast(1.03);
}

/* Phones: full-screen photo viewer (campaign.js). Each photo is shown whole
   (uncropped) in the space below the bar; swipe sideways between photos. */
body.has-campaign-viewer {
  overflow: hidden;
}

.campaign-viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--color-cream);
}

.campaign-viewer[hidden] {
  display: none;
}

.campaign-viewer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(1rem + var(--wp-admin--admin-bar--height, 0px)) 1.5rem 1rem;
}

.campaign-viewer__close {
  min-height: 32px;
  padding: 0;
  color: inherit;
}

.campaign-viewer__track {
  flex: 1;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.campaign-viewer__track::-webkit-scrollbar {
  display: none;
}

.campaign-viewer__slide {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 1rem;
  box-sizing: border-box;
  scroll-snap-align: start;
}

.campaign-viewer__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: sepia(0.06) saturate(0.94) contrast(1.03); /* Same grade as the grid. */
}

@media (max-width: 905.98px) {
  .campaign__photo {
    cursor: pointer;
  }
}

/* Editorial ("Read More") view: the whole screen takes the campaign colour.
   Title far left, text centred with wide margins, Close far right. */
body.has-campaign-editorial {
  overflow: hidden;
}

.campaign-editorial {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
  background: var(--campaign-color, var(--color-taupe));
  color: var(--campaign-text, var(--color-charcoal));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}

.campaign-editorial.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0s;
}

.campaign-editorial__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 350px) minmax(0, 1fr);
  column-gap: 1.5rem;
  min-height: 100%;
  padding: 1.25rem 1.5rem;
}

.campaign-editorial__title,
.campaign-editorial__close {
  position: sticky;
  top: 0;
  align-self: start;
  margin: 0;
  padding-top: 0.25rem;
}

.campaign-editorial__title {
  grid-column: 1;
  justify-self: start;
}

.campaign-editorial__close {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  color: inherit;
}

.campaign-editorial__close:hover,
.campaign-editorial__close:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.campaign-editorial__content {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  width: 100%;
  max-width: 350px;
  padding: 18vh 0 12vh;
  text-align: justify;
}

.campaign-editorial__content p {
  margin: 0 0 1.6em;
  font-size: 14px;
  line-height: 1.8;
  letter-spacing: 0.5px;
}

.campaign-editorial__content p:last-child {
  margin-bottom: 0;
}

.campaign-editorial__content .campaign-editorial__credit {
  margin-top: 3em;
  font-size: 12px;
  line-height: 1.7;
  opacity: 0.75;
}

@media (max-width: 767px) {
  .campaign-editorial__inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .campaign-editorial__close {
    grid-column: 2;
  }

  .campaign-editorial__content {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 4rem 0 3rem;
  }
}

/* About page: an editorial scroll on brand maroon. Text sections use the
   Campaign Read More treatment (narrow, centred, justified); full-width
   videos sit between them and fade in as they reach the screen (about.js). */
.about {
  padding: 18vh 0 12vh;
  background: var(--color-maroon);
  color: #fff;
}

.about__text,
.about__outro {
  padding: 0 1.5rem;
}

.about__text > *,
.about__outro > * {
  width: min(350px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.about h2 {
  margin-top: 0;
  margin-bottom: 2.5em;
  font-family: var(--font-caption);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-align: center;
  text-transform: uppercase;
}

.about p {
  margin-top: 0;
  margin-bottom: 1.6em;
  font-size: 14px;
  line-height: 1.8;
  letter-spacing: 0.5px;
  text-align: justify;
}

.about p:last-child {
  margin-bottom: 0;
}

.about__film {
  margin: 12vh 0;
}

.about__film .wp-block-video {
  margin: 0;
}

.about__film video {
  display: block;
  width: 100%;
  height: auto;
}

/* Videos fade up into place as they reach the screen (about.js). */
.about.has-reveal .about__film {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.about.has-reveal .about__film.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .about.has-reveal .about__film {
    transform: none;
  }
}

/* Cart: the footer sits at the bottom of the screen when the content is short. */
body.woocommerce-cart {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
}

body.woocommerce-cart > main {
  flex: 1 0 auto;
}

/* Empty bag: a simple line drawing of a bag in place of WooCommerce's icon,
   then the newest products as catalog cards. */
.wc-block-cart__empty-cart__title.with-empty-cart-icon::before {
  width: 72px;
  height: 72px;
  -webkit-mask: url("../icons/bag-empty.svg") center / contain no-repeat;
  mask: url("../icons/bag-empty.svg") center / contain no-repeat;
}

.empty-bag__products {
  margin-top: 4rem;
  padding: 0;
}

/* Product catalog (category, craft, shop and product search pages) */
.catalog {
  padding-bottom: 3rem;
}

.catalog__heading {
  margin: 0;
  padding: 3rem 1.5rem;
  font-weight: 400;
}

.catalog__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 1.5rem;
  row-gap: 3rem;
  padding: 0 1.5rem;
}

@media (max-width: 1023px) {
  .catalog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 559px) {
  .catalog__grid { grid-template-columns: minmax(0, 1fr); }
}

.catalog__empty {
  margin: 0;
  padding: 0 1.5rem;
}

.product-card__link {
  display: block;
}

.product-card__link:focus-visible {
  outline: 1px solid var(--color-maroon);
  outline-offset: 4px;
}

.product-card__link:hover .product-card__details,
.product-card__link:focus-visible .product-card__details {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.product-card__media {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--color-mist);
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.875rem;
}

.product-card__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.product-card__name {
  margin: 0;
  font-weight: 400;
}

.product-card__details {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  align-self: flex-start;
}

.product-card__details img {
  width: 21px;
  height: 14px;
}

/* Size picker + Add to Cart (card and product page) */
.add-to-cart {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
}

.size-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.size-picker__option {
  position: relative;
  cursor: pointer;
}

.size-picker__option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.size-picker__option span {
  display: block;
  min-width: 44px;
  padding: 0.55rem 0.8rem;
  text-align: center;
  border: 1px solid var(--color-hairline);
  color: var(--color-charcoal);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.size-picker__option:hover span {
  border-color: var(--color-charcoal);
}

.size-picker__option input:checked + span {
  border-color: var(--color-maroon);
  color: var(--color-maroon);
}

.size-picker__option input:focus-visible + span {
  outline: 1px solid var(--color-maroon);
  outline-offset: 2px;
}

.add-to-cart__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  background: var(--color-maroon);
  color: #fff;
  transition: opacity 0.15s ease;
}

.add-to-cart__button:hover {
  opacity: 0.88;
}

.add-to-cart__button:disabled {
  opacity: 0.5;
  cursor: default;
}

.add-to-cart__status {
  min-height: 1em;
  margin: 0;
  color: var(--color-maroon);
}

.add-to-cart__status:empty {
  display: none;
}

/* Appears once the item is in the bag, so checkout is one tap away. */
.add-to-cart__checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--color-maroon);
  color: var(--color-maroon);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.add-to-cart__checkout:hover,
.add-to-cart__checkout:focus-visible {
  background: var(--color-maroon);
  color: #fff;
}

.add-to-cart__checkout[hidden] {
  display: none;
}

/* Product details page */
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: start;
  gap: 3rem;
  padding: 3rem 1.5rem;
}

.product-detail > .woocommerce-notices-wrapper {
  grid-column: 1 / -1;
}

.product-detail__track {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}

.product-detail__gallery-nav {
  display: none;
}

.product-detail__image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--color-mist);
}

.product-detail__info {
  position: sticky;
  top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 480px;
}

.product-detail__heading {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-detail__name,
.product-detail__price {
  margin: 0;
  font-weight: 400;
}

.product-detail__description p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: 0.5px;
  color: var(--color-charcoal);
}

.product-detail__shipping {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-hairline);
}

.product-detail__shipping h2,
.product-detail__shipping p {
  margin: 0;
  font-weight: 400;
}

.product-detail__shipping p {
  color: var(--color-charcoal);
}

/* 906px and below: one column, images become a horizontal carousel. */
@media (max-width: 906px) {
  .product-detail {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .product-detail__info {
    position: static;
    max-width: none;
  }

  .product-detail__track {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .product-detail__track::-webkit-scrollbar {
    display: none;
  }

  .product-detail__track > .product-detail__image {
    flex: 0 0 100%;
    scroll-snap-align: start;
  }

  .product-detail__gallery-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1rem;
  }
}

.product-detail__arrow {
  width: 44px;
  height: 32px;
  padding: 0;
  background: url("../icons/arrow-black.svg") center / 21px 14px no-repeat;
  transition: opacity 0.15s ease;
}

.product-detail__arrow--prev {
  transform: scaleX(-1);
}

.product-detail__arrow:disabled {
  opacity: 0.25;
  cursor: default;
}

.product-detail__dots {
  display: flex;
  gap: 0.25rem;
}

.product-detail__dot {
  width: 24px;
  height: 24px;
  padding: 0;
  position: relative;
}

.product-detail__dot::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--color-charcoal);
  transition: background-color 0.15s ease;
}

.product-detail__dot[aria-current="true"]::before {
  background: var(--color-charcoal);
}

/* Size Chart: underlined text link above the sizes, opening a minimal chart.
   Desktop: centred panel over a soft backdrop. Phones: full-screen sheet. */
.product-detail__size-chart {
  align-self: flex-start;
  margin-bottom: -0.75rem;
  padding: 0;
  color: var(--color-charcoal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.product-detail__size-chart:hover,
.product-detail__size-chart:focus-visible {
  color: var(--color-maroon);
}

body.has-size-chart {
  overflow: hidden;
}

.size-chart {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(36, 36, 36, 0.35);
}

.size-chart[hidden] {
  display: none;
}

.size-chart__panel {
  width: 100%;
  max-width: 620px;
  max-height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 1.5rem 1.5rem 2rem;
  background: var(--color-cream);
  color: var(--color-charcoal);
}

.size-chart__bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}

.size-chart__title {
  margin: 0;
  font-weight: 400;
  color: var(--color-maroon);
}

.size-chart__close {
  padding: 0;
  color: inherit;
}

.size-chart__close:hover,
.size-chart__close:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.size-chart__unit {
  margin: 0.5rem 0 2rem;
  font-size: 11px;
  opacity: 0.7;
}

.size-chart__table {
  width: 100%;
  border-collapse: collapse;
}

.size-chart__table th,
.size-chart__table td {
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid var(--color-hairline);
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
}

.size-chart__table thead th {
  color: var(--color-maroon);
  border-bottom-color: var(--color-charcoal);
}

.size-chart__table tbody th {
  padding-left: 0;
  text-align: left;
}

/* Size columns share the width evenly; the measurement names take the rest. */
.size-chart__table thead th:not(:first-child) {
  width: 15%;
}

@media (max-width: 905.98px) {
  .size-chart {
    padding: 0;
    align-items: stretch;
  }

  .size-chart__panel {
    max-width: none;
    padding: calc(1.25rem + var(--wp-admin--admin-bar--height, 0px)) 1.5rem 2rem;
  }

  .size-chart__table th,
  .size-chart__table td {
    padding: 0.85rem 0.25rem;
    font-size: 12px;
  }
}

/* Craft detail page: vertical image scroller left, name + description right */
.craft {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

.craft__images {
  display: flex;
  flex-direction: column;
}

.craft__image {
  display: block;
  width: 100%;
  height: auto;
}

.craft__info {
  position: sticky;
  top: 0;
  padding: 8rem 1.5rem 4rem;
}

.craft__info > * {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.craft__name {
  margin-top: 0;
  margin-bottom: 2rem;
  font-size: 15px;
  font-weight: 400;
  color: var(--color-maroon);
}

.craft__description p {
  margin: 0 0 1.2em;
  font-size: 14px;
  line-height: 1.8;
  letter-spacing: 0.5px;
  color: var(--color-charcoal);
}

.craft__description p:last-child {
  margin-bottom: 0;
}

/* Below 906px: one editorial column in the About page's rhythm (name,
   paragraph, image, paragraph, image …), ordered by each element's
   --story-order; the desktop columns dissolve via display: contents. */
@media (max-width: 905.98px) {
  .craft {
    display: flex;
    flex-direction: column;
    padding: 18vh 0 12vh;
  }

  .craft__images,
  .craft__info,
  .craft__description {
    display: contents;
  }

  .craft__name,
  .craft__description .craft__paragraph {
    width: min(350px, 100% - 3rem);
    margin-left: auto;
    margin-right: auto;
  }

  .craft__name {
    order: 0;
    margin-top: 0;
    margin-bottom: 2.5em;
    text-align: center;
  }

  /* Every step after the first paragraph is spaced 12vh from the one before. */
  .craft__description .craft__paragraph {
    order: var(--story-order);
    margin-top: 12vh;
    margin-bottom: 0;
    text-align: justify;
  }

  .craft__description .craft__paragraph:first-child {
    margin-top: 0;
  }

  .craft__image {
    order: var(--story-order);
    margin: 12vh 0 0;
  }
}
