/*
 * Theme-level styles for markup that has no source equivalent (WordPress and
 * WooCommerce generated output) plus functional state rules. Source design
 * styles ship in app.css and are used through the source class lists.
 */

/* ---------------------------------------------------------------- Base --- */
[hidden] {
  display: none !important;
}

.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;
}

:root {
  --logo-height: 80px;
  --checkout-gap: 2rem;
  --header-h: 97px;
}

@media (min-width: 768px) {
  :root {
    --header-h: 109px;
  }
}

/* Primary navigation spacing (matches source flex + gap-6). */
header nav ul.menu,
header nav ul.flex,
header .theme-mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

header nav[aria-label="Main navigation"] > ul {
  flex-direction: row;
  align-items: center;
  gap: 4.5rem;
}

#theme-mobile-nav.theme-mobile-nav-list,
#theme-mobile-nav > ul {
  flex-direction: column;
  gap: 0;
}

header nav .menu li,
header nav ul.flex > li {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Logo height is identical in header, footer and every page context. */
.site-logo-img {
  height: var(--logo-height) !important;
  width: auto !important;
  display: block;
}

.site-logo-text {
  line-height: var(--logo-height);
  display: block;
}

/* ------------------------------------------------------- Site header --- */
.site-header.is-solid,
header.is-solid {
  background-color: hsl(var(--background) / 0.97);
}

/* --------------------------------------------------------- Cart drawer --- */
#theme-cart-drawer {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
  z-index: 55;
}

body.cart-open #theme-cart-drawer {
  transform: translateX(0);
  visibility: visible;
}

body.cart-open header.sticky {
  z-index: 35;
  filter: blur(1px);
  opacity: 0.92;
}

#theme-cart-overlay {
  position: fixed;
  inset: 0;
  background-color: hsl(var(--primary) / 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}

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

#theme-cart-drawer.is-updating > * {
  opacity: 0.6;
  pointer-events: none;
}

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

/* ---------------------------------------- Add-to-cart buttons & states --- */
.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 {
  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;
}

/* WooCommerce's own spinner is suppressed; the theme owns the loading state. */
.single-product .single_add_to_cart_button.loading::after,
.ajax_add_to_cart.loading::after {
  display: none !important;
}

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

/* WooCommerce appends a "View cart" link after AJAX adds; 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;
}

/* -------------------------------------------------- Product card media --- */
.theme-product-card {
  position: relative;
  color: inherit;
  text-decoration: none;
}

.theme-product-card__media {
  position: relative;
}

.theme-product-card__media img {
  display: block;
}

.theme-card-add {
  position: relative;
  z-index: 3;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.theme-shop-grid > .theme-product-card-wrap,
.theme-related-grid > .theme-product-card-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

.theme-product-card-wrap > .theme-product-card__media {
  flex: 0 0 auto;
}

/* -------------------------------------------------- Single product page --- */
.single-product .theme-product-layout {
  min-width: 0;
}

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

.single-product .theme-product-thumbnails {
  flex-wrap: wrap;
  max-width: 100%;
}

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

.single-product .single_add_to_cart_button {
  flex: 1 1 auto;
  min-width: 160px;
}

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

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

.theme-qty-input {
  -moz-appearance: textfield;
  appearance: textfield;
}

.theme-thumb {
  padding: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary));
  cursor: pointer;
  transition: border-color 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-thumb.is-active {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 1px hsl(var(--primary));
}

/* Variations table reflow (label above control) without breaking the script. */
.single-product .variations table,
.single-product .variations tbody,
.single-product .variations tbody tr,
.single-product .variations tbody td {
  display: block;
  width: 100%;
}

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

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

.single-product .variations .label label {
  font-family: var(--font-display);
  font-size: 1rem;
  color: hsl(var(--foreground));
}

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

.theme-attr-pill.is-active {
  background-color: hsl(var(--primary)) !important;
  color: hsl(var(--primary-foreground)) !important;
  border-color: hsl(var(--primary)) !important;
}

.single-product .single_variation_wrap {
  width: 100%;
}

.single-product .woocommerce-variation-price {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: hsl(var(--primary));
  margin-bottom: 0.75rem;
}

.single-product .woocommerce-variation-availability p.stock {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.5rem;
}

/* ------------------------------------------------------ WooCommerce notices --- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  list-style: none;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--secondary));
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.woocommerce-error {
  border-color: hsl(var(--destructive) / 0.4);
  background-color: hsl(var(--destructive) / 0.08);
  color: hsl(var(--destructive));
}

.woocommerce-message .button,
.woocommerce-info .button,
.woocommerce-error .button {
  margin-left: 0.75rem;
}

.single-product .woocommerce-message,
.single-product .woocommerce-info {
  display: none;
}

#theme-cart-drawer .woocommerce-message {
  display: none;
}

/* --------------------------------------------------- Archive pagination --- */
.woocommerce-pagination ul {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 9999px;
  border: 1px solid hsl(var(--foreground) / 0.4);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.woocommerce-pagination ul li span.current {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.woocommerce-result-count,
.woocommerce-ordering {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.woocommerce-ordering select {
  border: 1px solid hsl(var(--border));
  border-radius: 0.375rem;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body);
}

/* ------------------------------------------------------------ Page shell --- */
.theme-page-main .page-title {
  font-family: var(--font-display);
}

.theme-page-container {
  min-width: 0;
}

.entry-content > *:first-child {
  margin-top: 0;
}

/* Keep inner page content clear of the sticky header. */
.theme-no-hero .theme-page-main,
.theme-no-hero .woocommerce {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

/* ------------------------------------------------------- Checkout block --- */
body.woocommerce-checkout .wc-block-checkout,
body.woocommerce-checkout .wp-block-woocommerce-checkout {
  display: block;
  max-width: 100%;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

body.woocommerce-checkout .entry-content > .alignwide,
body.woocommerce-checkout .entry-content > .alignfull {
  max-width: 100%;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

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-sidebar-layout.wc-block-checkout {
  display: flex;
  flex-direction: column;
  gap: var(--checkout-gap, 2rem);
  max-width: 100%;
  overflow-x: hidden;
}

body.woocommerce-checkout .wc-block-checkout__sidebar {
  order: 1;
}

body.woocommerce-checkout .wc-block-checkout__main {
  order: 2;
  min-width: 0;
}

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

  body.woocommerce-checkout .wc-block-checkout__sidebar {
    order: 1;
  }

  body.woocommerce-checkout .wc-block-checkout__main {
    order: 2;
  }
}

.theme-checkout-unified-notice {
  max-width: 42rem;
}

/* Block checkout renders its own step titles — keep a single page H1. */
body.woocommerce-checkout .wc-block-checkout .wp-block-woocommerce-checkout-title-block,
body.woocommerce-checkout .wc-block-checkout h1.wp-block-woocommerce-checkout-title-block {
  display: none;
}

.theme-checkout-continue a {
  margin-bottom: 0;
}

body.woocommerce-checkout .wc-block-checkout__sidebar {
  background-color: hsl(var(--secondary));
  border-radius: var(--radius);
  padding: 2rem;
}

body.woocommerce-checkout .wc-block-checkout__sidebar .wc-block-components-order-summary-item__description,
body.woocommerce-checkout .wc-block-checkout__sidebar .wc-block-components-product-name,
body.woocommerce-checkout .wc-block-checkout__sidebar .wc-block-components-totals-item,
body.woocommerce-checkout .wc-block-checkout__main .wc-block-components-checkout-step__title,
body.woocommerce-checkout .wc-block-checkout__main h2,
body.woocommerce-checkout .wc-block-checkout__main h3 {
  font-family: var(--font-body);
  color: hsl(var(--foreground));
}

body.woocommerce-checkout .wc-block-components-title,
body.woocommerce-checkout .wc-block-components-checkout-step__heading,
body.woocommerce-checkout .wc-block-components-checkout-step__title {
  font-family: var(--font-display) !important;
  font-weight: 700;
}

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 .woocommerce-checkout .form-row .input-text {
  font-family: var(--font-body) !important;
  font-size: 1rem !important;
  color: hsl(var(--foreground)) !important;
  background-color: hsl(var(--background)) !important;
  border: 1px solid hsl(var(--border)) !important;
  border-radius: 0.375rem !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 {
  border-color: hsl(var(--primary)) !important;
  box-shadow: 0 0 0 1px hsl(var(--primary)) !important;
  outline: none !important;
}

body.woocommerce-checkout .wc-block-components-text-input input::placeholder,
body.woocommerce-checkout .wc-block-components-textarea textarea::placeholder {
  color: hsl(var(--muted-foreground)) !important;
}

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-color: hsl(var(--primary)) !important;
  color: hsl(var(--primary-foreground)) !important;
  border: 1px solid hsl(var(--primary)) !important;
  border-radius: 9999px !important;
  font-family: var(--font-body) !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase !important;
  padding: 1rem 2rem !important;
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover {
  background-color: hsl(var(--foreground)) !important;
  border-color: hsl(var(--foreground)) !important;
  color: hsl(var(--primary-foreground)) !important;
}

body.woocommerce-checkout .wc-block-components-notice-banner {
  border-radius: 0.75rem !important;
  font-family: var(--font-body) !important;
  border: 1px solid hsl(var(--border)) !important;
  background-color: hsl(var(--secondary)) !important;
  color: hsl(var(--foreground)) !important;
}

body.woocommerce-checkout .wc-block-components-notice-banner.is-error {
  border-color: hsl(var(--destructive) / 0.4) !important;
  background-color: hsl(var(--destructive) / 0.08) !important;
  color: hsl(var(--destructive)) !important;
}

body.woocommerce-checkout .wc-block-cart-items,
body.woocommerce-checkout .wc-block-components-order-summary {
  font-family: var(--font-body);
  color: hsl(var(--foreground));
}

body.woocommerce-checkout .wc-block-components-order-summary-item,
body.woocommerce-cart .wc-block-components-order-summary-item {
  padding: 1rem 0;
  border-bottom: 1px solid hsl(var(--border) / 0.6);
}

body.woocommerce-checkout .wc-block-components-order-summary-item:last-child,
body.woocommerce-cart .wc-block-components-order-summary-item:last-child {
  border-bottom: 0;
}

.theme-checkout-summary-controls .wc-block-components-quantity-selector__button {
  min-width: 2rem;
  min-height: 2rem;
}

/* Order summary qty/remove (block checkout). */
body.woocommerce-checkout .wc-block-components-quantity-selector,
body.woocommerce-cart .wc-block-components-quantity-selector {
  min-width: 0;
}

body.woocommerce-checkout .wc-block-cart-item__remove-link,
body.woocommerce-cart .wc-block-cart-item__remove-link {
  font-size: 0.875rem;
}

/* Empty cart product collection — readable buttons. */
body.woocommerce-cart .wc-block-grid__product-add-to-cart .wp-block-button__link,
body.woocommerce-cart .wc-block-components-product-button__button {
  background-color: hsl(var(--accent)) !important;
  color: hsl(var(--accent-foreground)) !important;
  border-radius: 9999px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
}

body.woocommerce-cart .wc-block-components-button.wc-block-cart__submit-button {
  border-radius: 9999px;
}

/* Hide default Woo duplicate grids when the canonical catalog grid is present. */
body.woocommerce-cart .wc-block-cart__empty-cart:has(.theme-cart-new-in-store) .wc-block-grid {
  display: none !important;
}

body.woocommerce-checkout .wc-block-checkout .wc-block-components-checkbox__label,
body.woocommerce-checkout .wc-block-checkout .wc-block-components-radio-control__label {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: hsl(var(--foreground));
}

/* Fixed-header offset on checkout. */
body.woocommerce-checkout .site-main,
body.woocommerce-checkout main {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

/* --------------------------------------------------- Cart / account pages --- */
body.theme-cart-page .site-main,
body.theme-cart-page main,
body.theme-account-page .site-main,
body.theme-account-page main {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

body.theme-cart-page .wc-block-cart,
body.theme-account-page .woocommerce {
  min-width: 0;
  max-width: 100%;
}

body.theme-cart-page .wc-block-cart-items,
body.theme-cart-page .wc-block-components-totals-item,
body.theme-account-page .woocommerce-MyAccount-navigation,
body.theme-account-page .woocommerce-MyAccount-content {
  font-family: var(--font-body);
  color: hsl(var(--foreground));
}

body.theme-cart-page .wc-block-components-button,
body.theme-account-page .woocommerce-Button,
body.theme-cart-page .wc-block-cart__submit-button {
  background-color: hsl(var(--primary)) !important;
  color: hsl(var(--primary-foreground)) !important;
  border: 1px solid hsl(var(--primary)) !important;
  border-radius: 9999px !important;
  font-family: var(--font-body) !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase !important;
}

body.theme-cart-page .wc-block-cart__submit-button:hover,
body.theme-account-page .woocommerce-Button:hover {
  background-color: hsl(var(--foreground)) !important;
  border-color: hsl(var(--foreground)) !important;
}

/* ------------------------------------------------------ Thank you page --- */
body.theme-thankyou-page {
  overflow-x: hidden;
}

body.theme-thankyou-page .woocommerce-order {
  font-family: var(--font-body);
  color: hsl(var(--foreground));
}

body.theme-thankyou-page .woocommerce-order h2,
body.theme-thankyou-page .woocommerce-order-details__title,
body.theme-thankyou-page .woocommerce-column__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: hsl(var(--foreground));
  padding: 0 0 1rem 0;
}

body.theme-thankyou-page p.woocommerce-notice {
  background-color: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  color: hsl(var(--foreground));
}

body.theme-thankyou-page .woocommerce-order-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 1.5rem;
  margin: 0 0 2rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  background-color: hsl(var(--secondary));
}

body.theme-thankyou-page .woocommerce-order-overview li {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  border: 0;
  padding: 0;
  margin: 0;
}

body.theme-thankyou-page .woocommerce-order-overview li strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  color: hsl(var(--foreground));
}

body.theme-thankyou-page .woocommerce-order-details table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

body.theme-thankyou-page .woocommerce-order-details th,
body.theme-thankyou-page .woocommerce-order-details td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid hsl(var(--border));
  font-size: 0.875rem;
  text-align: left;
  overflow-wrap: break-word;
}

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;
}

body.theme-thankyou-page .woocommerce-customer-details address {
  max-width: 480px;
  overflow-wrap: break-word;
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  padding: 1.25rem;
  font-size: 0.875rem;
  font-style: normal;
  line-height: 1.7;
}

/* --------------------------------------------- WordPress core elements --- */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  font-family: var(--font-display);
}

.entry-content a {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-underline-offset: 4px;
}

.entry-content p {
  margin-bottom: 1.15rem;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.25rem;
  margin-bottom: 1.15rem;
  list-style: disc;
}

.entry-content ol {
  list-style: decimal;
}

.alignwide {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.alignfull {
  width: 100%;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.5rem;
}

/* --------------------------------------------------- Customizer preview --- */
body.is-customizer .reveal-item,
body.is-customizer .scale-in-item {
  opacity: 1 !important;
  transform: none !important;
}

/* ------------------------------------------------------ Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  #theme-cart-drawer,
  #theme-cart-overlay {
    transition-duration: 0.001ms;
  }
}

/* -------------------------------------------------------------- Mobile --- */
@media (max-width: 1023px) {
  .theme-nav-link.desktop-only {
    display: none;
  }
}
