/* ==========================================================================
   Trainwreck Messiah — WordPress / WooCommerce integration layer.

   app.css ships the design system (preflight, tokens, components). This file
   only adds:
     a) styles for markup with no equivalent in the design system
        (WooCommerce blocks, notices, forms, checkout, account, thank you),
     b) functional rules (drawer state, reveal fallbacks, hidden controls).
   It never restyles an element that carries design-system classes.
   ========================================================================== */

figure {
  margin: 0;
}

@media screen and (min-width: 783px) {
  body.admin-bar .site-header {
    top: 32px;
  }
}

.mobile-menu a {
  color: var(--cream);
  font: clamp(34px, 7vw, 60px) var(--font-display);
  text-align: left;
  text-transform: uppercase;
}

[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   0. Base layer for WordPress-generated markup only
   The design's own base layer (app.css) applies to the same elements, so the
   rules below intentionally mirror it for markup that WordPress renders with
   no source equivalent. They are scoped to theme-* wrappers wherever the same
   element also exists in the design.
   -------------------------------------------------------------------------- */

#theme-cart-drawer p,
#theme-cart-drawer li,
#theme-cart-drawer span,
#theme-cart-drawer button {
  font-size: max(14px, 1em);
}

/* --------------------------------------------------------------------------
   1. Site shell
   -------------------------------------------------------------------------- */

.site-logo-img {
  height: var(--logo-height, 56px) !important;
  width: auto !important;
  display: block;
  object-fit: contain;
}

@media (max-width: 700px) {
  .site-header .site-logo-img {
    height: 46px !important;
  }

  .site-header .site-logo-text {
    line-height: 46px;
  }
}

.site-logo-text {
  line-height: var(--logo-height, 56px);
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  text-transform: uppercase;
  color: var(--cream);
}

.theme-site-main {
  min-height: 50vh;
}

body.theme-no-hero .theme-site-main {
  padding-top: var(--header-height, 92px);
}

body.theme-home .theme-site-main {
  padding-top: 0;
}

/* The design renders the footer logo at 96px regardless of the header
   logo height (--logo-height). */
.site-footer .site-logo-img {
  height: 96px !important;
}



/* --------------------------------------------------------------------------
   2. Source component completion
   The design system references a few decoration classes whose rules were
   never part of the shipped stylesheet; their geometry is reproduced here.
   -------------------------------------------------------------------------- */

.lightbox .close {
  position: absolute;
  top: 24px;
  right: 24px;
  color: var(--cream);
}

/* --------------------------------------------------------------------------
   3. Reveal / motion fallbacks
   -------------------------------------------------------------------------- */

body.is-customizer [data-reveal],
.no-js [data-reveal],
.theme-motion-off [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
}

.theme-back-to-top {
  transition-property: transform, opacity;
}

/* --------------------------------------------------------------------------
   4. Cart drawer
   -------------------------------------------------------------------------- */

#theme-cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 49;
  background: hsl(var(--foreground) / 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

body.cart-open #theme-cart-overlay {
  opacity: 1;
  visibility: visible;
}

body.admin-bar #theme-cart-drawer {
  top: var(--wp-admin--admin-bar--height, 32px);
  height: calc(100% - var(--wp-admin--admin-bar--height, 32px));
}

#theme-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 28rem;
  height: 100%;
  background: hsl(var(--background));
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

body.cart-open #theme-cart-drawer {
  transform: none;
}

.theme-cart-notice {
  margin: 0;
  padding: 12px 24px;
  font: 500 13px/1.5 var(--font-label);
  color: var(--cream);
  background: hsl(var(--primary) / 0.2);
  border-bottom: 1px solid var(--line);
}

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

#theme-cart-drawer .theme-cart-items {
  flex: 1;
  overflow: auto;
  padding: 1.5rem;
}

#theme-cart-drawer .theme-cart-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.theme-cart-line {
  display: flex;
  gap: 1rem;
}

.theme-cart-line + .theme-cart-line {
  margin-top: 1.5rem;
}

.theme-cart-thumb {
  width: 5rem;
  height: 6rem;
  flex-shrink: 0;
  overflow: hidden;
  background: hsl(var(--secondary));
}

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

.theme-cart-line__info {
  flex: 1;
  min-width: 0;
}

.theme-cart-line__name {
  font-size: 0.875rem;
  font-weight: 500;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--cream);
}

.theme-cart-line__price {
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.125rem;
  color: hsl(var(--caramel-deep));
}

.theme-cart-line__controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.theme-cart-qty-btn {
  padding: 0.25rem;
  color: var(--cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-cart-qty-btn:hover {
  background: hsl(var(--secondary));
}

.theme-cart-qty-btn svg {
  width: 0.75rem;
  height: 0.75rem;
}

.theme-cart-qty-value {
  font-size: 0.875rem;
  width: 1.5rem;
  text-align: center;
  color: var(--cream);
}

.theme-cart-remove {
  margin-left: auto;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  transition: color 0.3s;
}

.theme-cart-remove:hover {
  color: hsl(var(--foreground));
}

.theme-cart-footer {
  margin-top: auto;
  flex-shrink: 0;
  padding: 1.5rem;
  border-top: 1px solid hsl(var(--border));
}

.theme-cart-line__variant {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.15rem;
}

/* --------------------------------------------------------------------------
   5. WooCommerce — notices, buttons, forms
   -------------------------------------------------------------------------- */

.woocommerce-notices-wrapper,
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  list-style: none;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.wc-block-components-notice-banner {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--cream);
  padding: 18px 22px;
  margin: 0 0 20px;
  font: 500 13px/1.6 var(--font-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  border-radius: 0;
}

.woocommerce-error {
  border-color: var(--crimson);
  background: hsl(var(--primary) / 0.14);
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
  display: none;
}

.woocommerce-message a,
.woocommerce-info a,
.woocommerce-error a {
  color: var(--gold);
  text-decoration: underline;
}

.woocommerce-error li {
  margin: 0;
}

/* Hide duplicate feedback only where the drawer already reports it. */
.single-product .woocommerce-message,
#theme-cart-drawer .woocommerce-message {
  display: none;
}

/* "View cart" injected by WooCommerce after an AJAX add is not in the design. */
.woocommerce-page a.added_to_cart.wc-forward,
.single-product a.added_to_cart.wc-forward,
body a.added_to_cart.wc-forward {
  display: none !important;
}

.single_add_to_cart_button.button:disabled,
.single_add_to_cart_button.button.disabled,
.add_to_cart_button.button:disabled,
.add_to_cart_button.button.disabled,
.single_add_to_cart_button:disabled,
.single_add_to_cart_button.disabled {
  cursor: not-allowed !important;
  opacity: 0.4 !important;
  pointer-events: none !important;
}

.single_add_to_cart_button.button:disabled:hover,
.single_add_to_cart_button.button.disabled:hover,
.add_to_cart_button.button:disabled:hover,
.add_to_cart_button.button.disabled:hover {
  opacity: 0.4 !important;
}

.ajax_add_to_cart.theme-btn-loading {
  opacity: 0.6 !important;
  pointer-events: none !important;
  cursor: wait !important;
}

.single-product .single_add_to_cart_button.loading::after,
.ajax_add_to_cart.loading::after {
  display: none !important;
}

/* --------------------------------------------------------------------------
   6. Product cards
   -------------------------------------------------------------------------- */

.theme-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 55px;
}

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

@media (max-width: 700px) {
  .theme-product-grid {
    grid-template-columns: 1fr;
  }
}

/* The shop section on the homepage is a fixed 3-up grid. */
.theme-home-shop .theme-product-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .theme-home-shop .theme-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .theme-home-shop .theme-product-grid {
    grid-template-columns: 1fr;
  }
}

.theme-product-card-wrap {
  display: block;
  height: 100%;
}

.theme-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.theme-product-card__media {
  position: relative;
  aspect-ratio: 3 / 4;
  width: 100%;
  overflow: hidden;
  background: hsl(var(--secondary));
}

.theme-product-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 600ms ease-out;
}

.theme-product-card:hover .theme-product-card__media img {
  transform: scale(1.06);
}

.theme-product-card__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, hsl(var(--dark-1) / 0.5), hsl(var(--dark-1) / 0) 55%, transparent);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}

.theme-product-card:hover .theme-product-card__veil {
  opacity: 1;
}

.theme-product-card__cta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.25rem;
  transform: translateY(0.5rem);
  opacity: 0;
  transition: all 0.5s;
  pointer-events: none;
}

.theme-product-card:hover .theme-product-card__cta {
  transform: none;
  opacity: 1;
}

.theme-product-card__cta span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cream);
  background: hsl(var(--dark-1) / 0.7);
  backdrop-filter: blur(4px);
  padding: 0.5rem 1rem;
  border: 1px solid hsl(var(--cream-1) / 0.2);
  font-size: 13px;
}

.theme-product-card__cta svg {
  width: 16px;
  height: 16px;
}

.theme-product-card__info {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  flex-grow: 1;
  min-width: 0;
}

.theme-product-card__info > div {
  min-width: 0;
}

/* cs-label supplies the label font; only the colour token is added. */
.theme-product-card__category {
  color: hsl(var(--caramel-deep));
}

/* Typography comes from the source utilities (font-display text-2xl) passed
   through in the template; only the price's shrink behaviour is added. */
.theme-product-card__price {
  flex-shrink: 0;
}

.theme-product-card__price .price,
.theme-product-card__price .woocommerce-Price-amount {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.theme-product-card__price del {
  opacity: 0.55;
  margin-right: 0.35rem;
}

.theme-product-card__stock {
  font: 500 12px var(--font-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--crimson);
  display: block;
  margin-top: 0.35rem;
}

.theme-product-card__action {
  margin: 0 1.25rem 1.25rem;
  position: relative;
  z-index: 3;
}

.theme-product-card__action .add_to_cart_button,
.theme-product-card__action .brand-button,
.theme-product-card__action .theme-card-add {
  width: 100%;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   7. Single product
   -------------------------------------------------------------------------- */

.single-product .theme-site-main {
  padding-top: var(--header-height, 92px);
}

.theme-product-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 4rem;
  align-items: start;
  padding-bottom: 6rem;
  padding-top: 1rem;
}

.theme-product-gallery,
.theme-product-info {
  min-width: 0;
  max-width: 100%;
}

.theme-product-gallery__main {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: hsl(var(--secondary));
}

.theme-product-gallery__main img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.theme-product-thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  max-width: 100%;
}

.theme-product-thumbnails button {
  width: 84px;
  height: 105px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: hsl(var(--secondary));
  flex-shrink: 0;
}

.theme-product-thumbnails button.is-active {
  border-color: var(--crimson);
}

.theme-product-thumbnails img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.theme-product-breadcrumb {
  padding: 1.5rem 0;
  font: 400 14px var(--font-body);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.theme-product-breadcrumb a {
  color: inherit;
  transition: color 0.3s;
}

.theme-product-breadcrumb a:hover {
  color: hsl(var(--foreground));
}

.theme-product-breadcrumb span.sep {
  opacity: 0.5;
}

.theme-product-info__category {
  font: 500 14px var(--font-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--caramel-deep));
}

.theme-product-info__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.25rem, 4vw, 3.75rem);
  line-height: 1.05;
  margin: 0.75rem 0 1.25rem;
  color: var(--cream);
}

.theme-product-info__price {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 500;
  color: var(--cream);
}

.theme-product-info__price del {
  opacity: 0.5;
  font-size: 1.25rem;
}

.theme-product-info__price ins {
  text-decoration: none;
}

.theme-product-info__description {
  color: hsl(var(--muted-foreground));
  line-height: 1.7;
  margin-bottom: 2rem;
  font-size: 1rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.theme-product-info__stock {
  display: inline-block;
  font: 500 12px var(--font-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--crimson);
  border: 1px solid var(--crimson);
  padding: 6px 10px;
  margin-bottom: 1rem;
}

.theme-product-info__label {
  font: 500 14px var(--font-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.75rem;
  display: block;
}

.theme-option-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.5rem;
}

.theme-add-to-cart-area {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.theme-add-to-cart-area .single_add_to_cart_button {
  flex: 1 1 auto;
  min-width: 160px;
}

.single-product .theme-add-to-cart-area {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Layout/typography for the quantity control come from the source utilities
   passed in theme_quantity_html(); only the input chrome is set here. */
.theme-qty-minus,
.theme-qty-plus {
  color: var(--cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-qty-input {
  background: transparent;
  border: 0;
  color: var(--cream);
  -moz-appearance: textfield;
  /* The design shows a static value here; the theme uses a real numeric
     input so WooCommerce reads the quantity. Its intrinsic width is wider
     than the source's label, so the control is sized to match it. */
  width: 3.25rem;
  flex: 0 0 auto;
}

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

.single-product form.cart.theme-simple-cart,
.single-product form.cart.theme-variations-form {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.single-product .theme-qty-block {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.theme-product-details [data-product-details-body] .woocommerce-product-details__short-description,
.theme-product-details [data-product-details-body] .woocommerce-variation-description,
.theme-product-details [data-product-details-body] > p,
.theme-product-details [data-product-details-body] > div:not([class]) {
  display: none;
}

.single-product .woocommerce-variation-description {
  display: none;
}

.theme-product-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .theme-product-actions {
    flex-direction: row;
  }
}

.theme-product-actions > * {
  flex: 1;
}

.theme-product-details {
  margin-top: 2.5rem;
  border-top: 1px solid hsl(var(--border));
}

.theme-product-details > button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  text-align: left;
  color: var(--cream);
}

.theme-product-details > button svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s;
}

.theme-product-details > button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.theme-product-details__body {
  padding-bottom: 1.5rem;
  font-family: var(--font-body);
}

.theme-product-details__body ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.theme-product-details__body li {
  font-size: 15px;
  color: hsl(var(--muted-foreground));
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  overflow-wrap: break-word;
}

.theme-product-details__body li::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--crimson);
  border-radius: 50%;
  margin: 0.5rem 0.75rem 0 0;
  flex-shrink: 0;
}

.theme-product-details__rule {
  border-top: 1px solid hsl(var(--border));
}

.theme-product-details .woocommerce-product-details__short-description,
.theme-product-details .woocommerce-variation-description,
.theme-product-info .posted_in {
  overflow-wrap: break-word;
  word-break: break-word;
}

.theme-related-products {
  padding: 5rem 0;
  border-top: 1px solid hsl(var(--border));
}

.theme-related-products__head {
  text-align: center;
  margin-bottom: 3rem;
}

.theme-related-products__eyebrow {
  font: 500 14px var(--font-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--caramel-deep));
}

.theme-related-products__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.25rem, 4vw, 3rem);
  margin-top: 0.75rem;
  color: var(--cream);
}

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

@media (max-width: 900px) {
  .theme-product-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .theme-related-grid {
    grid-template-columns: 1fr;
  }
}

/* Variations table: stack label above control. */
.single-product .variations,
.single-product .variations tbody {
  display: block;
  width: 100%;
  border: 0;
}

.single-product .variations tbody tr {
  display: block;
  width: 100%;
}

.single-product .variations tbody td {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
}

.single-product .variations tbody td.label {
  padding-bottom: 0.25rem;
}

.single-product .variations tbody td.value {
  padding-top: 0;
  padding-bottom: 1rem;
}

.single-product .variations label {
  font: 500 14px var(--font-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.theme-attr-select-hidden {
  display: none !important;
}

.theme-variations-table-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.theme-variation-attribute + .theme-variations-table-hidden {
  margin-top: 0;
}

/* The pill chrome comes from the design's .size-option class; the selected
   state reuses the design's .is-selected modifier. */
.theme-attr-pill.is-selected {
  background: var(--crimson);
}

.theme-attr-pill.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.single-product .single_variation_wrap {
  margin-top: 0;
}

.single-product .woocommerce-variation-price {
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--cream);
}

.single-product .woocommerce-variation-availability {
  margin-bottom: 1rem;
  font: 500 12px var(--font-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   8. Shop archive / pagination / sorting
   -------------------------------------------------------------------------- */

.theme-archive-head {
  padding: 2rem 0 0;
}

.theme-shop-hero {
  padding: 2rem 0 0;
}

.theme-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 60px 0 0;
  flex-wrap: wrap;
}

.theme-pagination .page-numbers,
.woocommerce-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  font: 500 14px var(--font-label);
  color: var(--cream);
}

.theme-pagination .page-numbers.current,
.theme-pagination .page-numbers:hover,
.woocommerce-pagination .page-numbers.current {
  background: var(--crimson);
  border-color: var(--crimson);
  color: var(--cream);
}

.woocommerce-result-count,
.woocommerce-ordering {
  font: 500 13px var(--font-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.woocommerce-ordering select,
.theme-archive-tools select {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--cream);
  font: 500 13px var(--font-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 14px;
}

.theme-archive-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 40px;
}

/* --------------------------------------------------------------------------
   9. Cart page / account / empty states
   -------------------------------------------------------------------------- */

body.woocommerce-cart .theme-site-main,
body.woocommerce-account .theme-site-main,
body.theme-thankyou-page .theme-site-main {
  padding-top: var(--header-height, 92px);
  padding-bottom: 4rem;
}

body.woocommerce-cart .woocommerce,
body.woocommerce-account .woocommerce {
  width: 100%;
  max-width: none;
}

.woocommerce-cart-form,
.wc-block-cart-items,
.woocommerce-orders-table {
  width: 100%;
}

.woocommerce table.shop_table,
body.theme-thankyou-page .woocommerce-order-details table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid hsl(var(--border));
  background: var(--surface);
  color: var(--cream);
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td,
body.theme-thankyou-page .woocommerce-order-details table th,
body.theme-thankyou-page .woocommerce-order-details table td {
  padding: 16px 18px;
  border-bottom: 1px solid hsl(var(--border));
  text-align: left;
  font-family: var(--font-body);
  font-size: 15px;
}

.woocommerce table.shop_table thead th,
body.theme-thankyou-page .woocommerce-order-details table thead th {
  font: 500 13px var(--font-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.woocommerce a.remove {
  color: var(--crimson) !important;
  border: 0;
  font-size: 0;
  display: inline-block;
  width: 22px;
  height: 22px;
  position: relative;
}

.woocommerce a.remove::after {
  content: "×";
  font-size: 22px;
  line-height: 1;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--crimson);
}

.woocommerce .cart-collaterals,
.woocommerce-cart .cart-collaterals {
  margin-top: 40px;
}

.woocommerce .cart_totals h2,
.woocommerce-checkout-review-order h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   10. Checkout block
   -------------------------------------------------------------------------- */

body.woocommerce-checkout .theme-site-main {
  padding-top: var(--header-height, 92px);
  padding-bottom: 4rem;
}

body.woocommerce-checkout .entry-content {
  max-width: 100%;
}

body.woocommerce-checkout .wc-block-checkout {
  display: block;
  width: 100%;
  max-width: none;
}

@media (min-width: 768px) {
  body.woocommerce-checkout .wc-block-components-sidebar-layout.wc-block-checkout.is-large,
  body.woocommerce-checkout .wc-block-components-sidebar-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
  }
}

body.woocommerce-checkout .wc-block-checkout__main,
body.woocommerce-checkout .wc-block-checkout__sidebar {
  min-width: 0;
  width: 100%;
  max-width: none;
}

body.woocommerce-checkout .wc-block-components-notice-banner {
  grid-column: 1 / -1;
}

body.woocommerce-checkout .wc-block-checkout__sidebar,
body.woocommerce-checkout .wc-block-components-order-summary {
  background: var(--surface);
  border: 1px solid hsl(var(--border));
  padding: 2rem;
}

body.woocommerce-checkout .wc-block-components-order-summary {
  border: 0;
  padding: 0;
}

body.woocommerce-checkout .wc-block-components-title,
body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-title,
body.woocommerce-checkout h2 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 1.5rem;
  color: var(--cream);
}

body.woocommerce-checkout .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-select select,
body.woocommerce-checkout .wc-blocks-components-select__select,
body.woocommerce-checkout .wc-block-components-textarea textarea,
body.woocommerce-checkout .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input {
  width: 100% !important;
  max-width: none !important;
  background: hsl(var(--input)) !important;
  border: 1px solid hsl(var(--border)) !important;
  border-radius: 0 !important;
  color: var(--cream) !important;
  font-family: var(--font-body) !important;
  font-size: 16px !important;
  box-shadow: none !important;
}

body.woocommerce-checkout .wc-block-components-text-input input:focus,
body.woocommerce-checkout .wc-block-components-select select:focus,
body.woocommerce-checkout .wc-blocks-components-select__select:focus,
body.woocommerce-checkout .wc-block-components-textarea textarea:focus,
body.woocommerce-checkout .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus {
  border-color: var(--crimson) !important;
  outline: 2px solid hsl(var(--primary) / 0.4) !important;
  outline-offset: 1px;
}

body.woocommerce-checkout .wc-block-components-text-input label,
body.woocommerce-checkout .wc-block-components-select label,
body.woocommerce-checkout .wc-block-components-checkbox label,
body.woocommerce-checkout .wc-block-components-radio-control__label {
  color: hsl(var(--muted-foreground)) !important;
  font-family: var(--font-label) !important;
  font-size: 13px !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button,
body.woocommerce-checkout .wc-block-components-button.wc-block-components-checkout-place-order-button {
  background: var(--crimson) !important;
  border: 1px solid var(--crimson) !important;
  border-radius: 0 !important;
  color: var(--cream) !important;
  min-height: 50px;
  font: 600 14px var(--font-label) !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover {
  background: var(--cream) !important;
  color: #0B0B0C !important;
}

body.woocommerce-checkout .wc-block-cart-items__row,
body.woocommerce-checkout .wc-block-components-order-summary-item {
  border-color: hsl(var(--border));
}

body.woocommerce-checkout .wc-block-components-totals-item__label,
body.woocommerce-checkout .wc-block-components-totals-item__value {
  color: var(--cream);
  font-family: var(--font-body);
}

/* Cart block on the cart page. */
body.woocommerce-cart .wc-block-cart__main,
body.woocommerce-cart .wc-block-cart__sidebar {
  min-width: 0;
}

@media (min-width: 768px) {
  body.woocommerce-cart .wc-block-components-sidebar-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
  }
}

/* --------------------------------------------------------------------------
   11. Thank you page
   -------------------------------------------------------------------------- */

body.theme-thankyou-page {
  overflow-x: hidden;
}

body.theme-thankyou-page .woocommerce-order {
  width: 100%;
}

body.theme-thankyou-page .woocommerce-order h2,
body.theme-thankyou-page .woocommerce-order-details__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  text-transform: uppercase;
  padding: 0 0 1rem 0;
  color: var(--cream);
}

body.theme-thankyou-page .woocommerce-order-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
}

body.theme-thankyou-page .woocommerce-order-overview li {
  flex: 1 1 180px;
  border: 1px solid hsl(var(--border));
  background: var(--surface);
  padding: 18px 20px;
  font: 500 12px/1.7 var(--font-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

body.theme-thankyou-page .woocommerce-order-overview li strong {
  display: block;
  font: 400 20px var(--font-display);
  letter-spacing: 0;
  color: var(--cream);
  margin-top: 6px;
  text-transform: none;
}

body.theme-thankyou-page .woocommerce-order-details table {
  table-layout: fixed;
}

body.theme-thankyou-page .woocommerce-order-details tfoot th {
  text-align: left;
}

body.theme-thankyou-page .woocommerce-order-details tfoot td {
  text-align: right;
}

body.theme-thankyou-page .woocommerce-customer-details {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

body.theme-thankyou-page .woocommerce-customer-details address {
  max-width: 480px;
  overflow-wrap: break-word;
  font-family: var(--font-body);
  font-style: normal;
  color: hsl(var(--muted-foreground));
}

body.theme-thankyou-page .woocommerce-notice {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--cream);
  padding: 16px 20px;
  margin-bottom: 24px;
}

/* --------------------------------------------------------------------------
   12. Forms without a design-system equivalent
   -------------------------------------------------------------------------- */

.theme-form-status {
  margin: 0;
  font: 500 13px var(--font-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.theme-form-status.is-error {
  color: var(--crimson);
}

.theme-contact-form .form-grid label > span {
  white-space: nowrap;
}

.theme-contact-form .field-error {
  border-color: var(--crimson) !important;
}

.theme-contact-success h3 {
  font-family: var(--font-display);
  font-size: 28px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.theme-honeypot {
  position: absolute !important;
  left: -9999px;
  top: 0;
  height: 0 !important;
  width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   13. Journal
   -------------------------------------------------------------------------- */

.theme-journal-hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.theme-journal-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.theme-journal-hero__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, hsl(var(--background)), hsl(var(--background) / 0.55), hsl(var(--background) / 0.2));
}

.theme-journal-hero__inner {
  position: relative;
  z-index: 10;
  padding-bottom: 4rem;
  padding-top: 11rem;
}

.theme-journal-hero__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  line-height: 1;
  max-width: 68rem;
  margin-top: 1.25rem;
  color: var(--cream);
}

.theme-journal-body {
  padding: 4rem 0 6rem;
  max-width: 68rem;
}

.theme-journal-copy {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  font-size: 1.125rem;
  line-height: 1.75;
}

.theme-journal-inline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 3.5rem 0;
}

@media (min-width: 768px) {
  .theme-journal-inline {
    grid-template-columns: 1fr 1fr;
  }
}

.theme-journal-inline img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.theme-journal-nav {
  display: grid;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid hsl(var(--border));
}

@media (min-width: 640px) {
  .theme-journal-nav {
    grid-template-columns: 1fr 1fr;
  }
}

.theme-journal-nav a {
  border: 1px solid hsl(var(--border));
  padding: 1.5rem;
  display: block;
  transition: transform 0.3s;
    color: var(--cream);
}

.theme-journal-nav a:hover {
  transform: translateY(-2px);
}

.theme-journal-nav a.is-next {
  text-align: right;
}

.theme-journal-nav svg {
  width: 20px;
  height: 20px;
  margin-bottom: 1rem;
}

.theme-journal-nav a.is-next svg {
  margin-left: auto;
}

.theme-journal-nav .label {
  display: block;
  font: 500 12px var(--font-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.theme-journal-nav strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   14. 404
   -------------------------------------------------------------------------- */

.theme-404 {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 6rem 0;
}

.theme-404 h1 {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 9rem);
  line-height: 1;
  color: var(--cream);
}

.theme-404 p {
  font-size: 1.25rem;
  margin: 1rem 0 2rem;
}

.theme-404 a {
  color: var(--crimson);
  text-decoration: underline;
  font: 600 14px var(--font-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   15. Page content fallback (About/Contact/etc. without a dedicated template)
   -------------------------------------------------------------------------- */

.theme-page-content {
  padding: 3rem 0 5rem;
}

.theme-page-content .page-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1;
  margin-bottom: 2rem;
  color: var(--cream);
}

.theme-page-content .entry-content > * + * {
  margin-top: 1.25rem;
}

.theme-page-content .entry-content a {
  color: var(--gold);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   16. Screen reader text
   -------------------------------------------------------------------------- */

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background: var(--surface);
  color: var(--cream);
  clip: auto;
  clip-path: none;
  height: auto;
  left: 8px;
  top: 8px;
  width: auto;
  padding: 12px 18px;
  z-index: 100000;
}

/* --------------------------------------------------------------------------
   17. Product card overlay hit area
   -------------------------------------------------------------------------- */

.theme-product-card > .theme-card-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
}

.theme-product-card *:not(.theme-card-link):not(.theme-product-card__action):not(.theme-product-card__action *) {
  pointer-events: none;
}

.theme-product-card__action,
.theme-product-card__action * {
  pointer-events: auto;
}

.theme-product-card__action {
  position: relative;
  z-index: 3;
}

/* --------------------------------------------------------------------------
   18. WooCommerce quantity inputs outside the theme wrapper
   -------------------------------------------------------------------------- */

.woocommerce .quantity input.qty,
.woocommerce-page .quantity input.qty {
  background: hsl(var(--input));
  border: 1px solid hsl(var(--border));
  color: var(--cream);
  padding: 10px;
  width: 4.5rem;
}

/* --------------------------------------------------------------------------
   19. Checkout / cart block buttons & notices
   -------------------------------------------------------------------------- */

body.woocommerce-checkout .wc-block-components-button:not(.wc-block-components-checkout-place-order-button) {
  border-radius: 0 !important;
  font-family: var(--font-label) !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.woocommerce-checkout .wc-block-components-radio-control__input:checked,
body.woocommerce-checkout .wc-block-components-checkbox__input:checked {
  background-color: var(--crimson) !important;
  border-color: var(--crimson) !important;
}

body.woocommerce-checkout .wc-block-components-checkout-step__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  color: var(--cream);
}

@media (max-width: 767px) {
  body.woocommerce-checkout .wc-block-components-sidebar-layout {
    display: block;
  }

  .theme-product-layout {
    grid-template-columns: 1fr;
  }

  body.woocommerce-checkout .wc-block-checkout__sidebar {
    padding: 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   20. Product action row + secondary button
   -------------------------------------------------------------------------- */

.theme-qty-row {
  margin-bottom: 1.5rem;
}

.theme-add-to-cart-area .theme-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 50px;
  padding: 14px 24px;
  border: 1px solid var(--cream);
  font: 600 14px var(--font-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
  background: transparent;
  transition: transform 0.3s, background-color 0.3s, color 0.3s;
}

.theme-add-to-cart-area .theme-btn-secondary:hover {
  background: var(--cream);
  color: #0B0B0C;
}

.theme-variations-form .theme-add-to-cart-area {
  margin-bottom: 0;
}

/* Single product: the details accordion toggle label sits in the design's
   label style. */
.theme-product-details > button .cs-label {
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Mobile menu icon swap. */
.menu-button[aria-expanded="true"] .menu-icon-open {
  display: none;
}

.menu-button[aria-expanded="true"] .menu-icon-close {
  display: inline-flex;
}

.theme-cart-count {
  font: 500 11px/18px var(--font-label);
  min-width: 18px;
  height: 18px;
  text-align: center;
  color: var(--cream);
  display: block;
}

.theme-cart-count:empty {
  display: none;
}

/* Journal back link keeps the icon inline. */
.theme-journal-body > .outline-button {
  align-self: flex-start;
  margin-top: 2rem;
  gap: 10px;
}

.theme-journal-body > .outline-button svg {
  width: 16px;
  height: 16px;
}

.theme-404 a {
  display: inline-block;
}

/* The pills above the variations table are the visible attribute control,
   so the native table's label row stays hidden (the label heading is
   rendered by the pills themselves). */
.single-product .variations tbody td.label {
  display: none;
}

.single-product .variations tbody td.value {
  padding-bottom: 1.5rem;
}

/* Shop archive: the hero block sits on the design's surface colour and the
   product grid follows directly beneath it, as in the homepage shop section. */
.theme-shop-hero {
  padding-bottom: 0;
}

body.post-type-archive-product .theme-site-main .section {
  padding-top: 0;
}
