/* Shared storefront surfaces */
html body.joymax-polish {
  --jm-glow: rgb(239 195 26 / .14);
  --jm-glow-cool: rgb(83 134 140 / .11);
  --jm-card: rgb(22 22 26 / .82);
  --jm-card-edge: rgb(204 174 83 / .28);
  background:
    radial-gradient(ellipse 66% 32rem at 100% 14rem, var(--jm-glow), transparent 100%),
    radial-gradient(ellipse 56% 29rem at 0 48rem, var(--jm-glow-cool), transparent 100%),
    var(--jm-bg, #0c0c0e) !important;
}

html[data-jm-theme="light"] body.joymax-polish {
  --jm-glow: rgb(215 162 27 / .14);
  --jm-glow-cool: rgb(99 147 142 / .12);
  --jm-card: rgb(255 255 255 / .85);
  --jm-card-edge: rgb(117 84 21 / .27);
}

html body.joymax-polish :is(#page, #content, .site-main, .ast-woocommerce-container, #content > .ast-container),
html body.joymax-polish :is(.joymax-shared-header, .joymax-shared-footer) {
  background-color: transparent !important;
}

/* Move the highlight behind the menu so the text stays still and sharp. */
body.joymax-polish .jm-nav {
  --jm-logo-size: 76px;
  --jm-nav-icon: #e2c479;
}

html[data-jm-theme="light"] body.joymax-polish .jm-nav {
  --jm-nav-icon: #765509;
}

body.joymax-polish .jm-nav.jm-tools-ready > .elementor-container {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 18px;
}

body.joymax-polish .jm-nav.jm-tools-ready > .elementor-container > .elementor-column {
  width: auto !important;
  margin: 0;
  min-width: 0;
}

body.joymax-polish .jm-nav .elementor-widget-image {
  width: var(--jm-logo-size) !important;
  max-width: none !important;
}

body.joymax-polish .jm-nav .elementor-widget-image :is(a, img) {
  display: block;
}

body.joymax-polish .jm-nav .elementor-widget-image img {
  width: var(--jm-logo-size);
  max-width: 100%;
  height: auto;
}

/* Elementor applies the Scale control to the inner widget container. */
body.joymax-polish .jm-nav .elementor-widget-icon-list > .elementor-widget-container {
  transform: none !important;
}

body.joymax-polish .jm-nav .elementor-icon-list-items {
  gap: 5px 6px;
  margin: 0;
}

body.joymax-polish .jm-nav .elementor-icon-list-item {
  margin: 0 !important;
  padding: 0 !important;
}

body.joymax-polish .jm-nav .elementor-icon-list-item a {
  display: inline-flex;
  align-items: center;
  min-height: 43px;
  padding: 5px 12px;
  gap: 8px;
  position: relative;
  isolation: isolate;
  border-radius: 8px;
}

body.joymax-polish .jm-nav .elementor-icon-list-text {
  font-family: system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  padding-inline: 0;
  text-shadow: none;
  color: var(--jm-text, #f5f5f5) !important;
}

body.joymax-polish .jm-nav .elementor-icon-list-icon {
  --jm-nav-icon-size: 16px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 var(--jm-nav-icon-size);
  width: var(--jm-nav-icon-size);
  height: var(--jm-nav-icon-size);
}

body.joymax-polish .jm-nav .elementor-icon-list-icon :is(i, svg) {
  display: block;
  width: 100%;
  margin: 0;
  font-size: var(--jm-nav-icon-size);
  line-height: 1;
  text-align: center;
  color: var(--jm-nav-icon) !important;
  fill: currentColor !important;
}

body.joymax-polish .jm-nav .elementor-icon-list-item a::before,
body.joymax-polish .jm-nav .elementor-icon-list-item a::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

body.joymax-polish .jm-nav .elementor-icon-list-item a::before {
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(112deg, transparent 5%, rgb(239 195 26 / .18) 50%, transparent 95%);
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  transition: clip-path .28s ease, opacity .18s ease;
}

body.joymax-polish .jm-nav .elementor-icon-list-item a::after {
  inset: auto 12px 1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--jm-gold), transparent);
  transform: scaleX(0);
  transition: transform .24s ease;
}

body.joymax-polish .jm-nav .elementor-icon-list-item a:is(:hover, :focus-visible)::before {
  clip-path: inset(0);
  opacity: 1;
}

body.joymax-polish .jm-nav .elementor-icon-list-item a:is(:hover, :focus-visible)::after {
  transform: scaleX(1);
}

body.joymax-polish .jm-nav .elementor-icon-list-item a:is(:hover, :focus-visible) .elementor-icon-list-text {
  color: var(--jm-gold) !important;
  text-shadow: none;
}

/* Keep the catalog price and action on separate lines. */
html body.joymax-polish.joymax-catalog-design #content ul.products,
html body.joymax-polish.joymax-catalog-design #content ul.products > li.product {
  list-style: none;
}

html body.joymax-polish.joymax-catalog-design #content ul.products .astra-shop-summary-wrap > .price {
  display: block;
  margin-block-end: 10px;
}

html body.joymax-polish.joymax-catalog-design #content ul.products .astra-shop-summary-wrap > a.button {
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

/* Give the purchase panel and long variation labels space on every product. */
html body.joymax-polish.joymax-catalog-design.single-product #content .product > .summary {
  box-sizing: border-box;
  padding: clamp(14px, 2vw, 24px);
}

html body.joymax-polish.joymax-catalog-design.single-product #content .summary .variations .label {
  box-sizing: border-box;
  width: 100%;
  padding-block: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Product features retain their original headings, icons, and reading order. */
html body.joymax-polish #content .jm-product-details .jm-product-details__section[aria-label="Features"] h3 {
  margin-block: 16px 8px;
  line-height: 1.3;
}

html body.joymax-polish #content .jm-product-details .jm-product-details__tags {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-block: 0 12px;
  padding-block-end: 12px;
  border-block-end: 1px solid var(--jm-line);
}

html body.joymax-polish #content .jm-product-details .jm-product-details__tags:last-child {
  border-block-end: 0;
  margin-block-end: 0;
  padding-block-end: 0;
}

html body.joymax-polish #content .jm-product-details .jm-product-details__tags li {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-color: var(--jm-line);
  background: var(--jm-card);
  border-radius: 7px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.joymax-polish .jm-product-details__tags li::before {
  content: "";
  flex: 0 0 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--jm-gold);
}

/* Homepage statistics */
html body.joymax-polish .jm-store-stats:has(> .jm-store-stats__list) {
  --jm-stats-accent: #efc31a;
  --jm-stats-label: #f5f5f5;
  --jm-stats-muted: #b3b3bc;
  padding-block: 10px !important;
}

html[data-jm-theme="light"] body.joymax-polish .jm-store-stats:has(> .jm-store-stats__list) {
  --jm-stats-accent: #785700;
  --jm-stats-label: #211e19;
  --jm-stats-muted: #59544b;
}

html body.joymax-polish .jm-store-stats__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

html body.joymax-polish .jm-store-stats .jm-store-stats__list > .jm-store-stats__metric {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 6px clamp(12px, 2vw, 24px) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  text-align: start;
}

html body.joymax-polish .jm-store-stats .jm-store-stats__list > .jm-store-stats__metric + .jm-store-stats__metric {
  border-inline-start: 1px solid var(--jm-card-edge) !important;
}

.joymax-polish .jm-store-stats__metric[data-jm-stat="years"] { --jm-stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='4' y='5' width='16' height='15' rx='2'/%3E%3Cpath d='M4 10h16M8 3v4m8-4v4m-8 7 2.5 2.5L16 12'/%3E%3C/svg%3E"); }
.joymax-polish .jm-store-stats__metric[data-jm-stat="purchases"] { --jm-stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M5 8h14l1 13H4L5 8Zm4 2V6a3 3 0 0 1 6 0v4'/%3E%3C/svg%3E"); }
.joymax-polish .jm-store-stats__metric[data-jm-stat="customers"] { --jm-stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Cpath d='M3 20v-2a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v2m1-15a3 3 0 0 1 0 6m1 3a4 4 0 0 1 4 4v2'/%3E%3C/svg%3E"); }

.joymax-polish .jm-store-stats__metric[data-jm-stat]:not([data-jm-stat=""]) dt::before {
  content: "";
  flex: 0 0 16px;
  height: 16px;
  background: var(--jm-stats-accent);
  mask: var(--jm-stat-icon) center / contain no-repeat;
}

html body.joymax-polish .jm-store-stats__metric :is(dt, dd) {
  margin: 0;
}

html body.joymax-polish .jm-store-stats__metric dt {
  order: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--jm-stats-label);
  font-size: 14px;
  line-height: 1.35;
}

html body.joymax-polish .jm-store-stats__metric dd {
  order: 1;
  color: var(--jm-stats-accent);
  font-variant-numeric: tabular-nums;
  font-size: clamp(27px, 2.6vw, 34px);
  line-height: 1.1;
}

.joymax-polish .jm-stat-caption {
  display: block;
  margin-block-start: 3px;
  color: var(--jm-stats-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

/* The cart uses existing WooCommerce forms and totals. */
html body.joymax-polish.woocommerce-cart #content .entry-title {
  margin-block-end: 18px;
  font-size: clamp(28px, 4vw, 44px);
}

html body.joymax-polish.woocommerce-cart #content .woocommerce-cart-form table.shop_table,
html body.joymax-polish.woocommerce-cart #content .cart_totals,
html body.joymax-polish.woocommerce-cart #content .wc-empty-cart-message {
  border: 1px solid var(--jm-card-edge) !important;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--jm-glow), transparent 55%), var(--jm-card) !important;
}

html body.joymax-polish.woocommerce-cart #content .woocommerce-cart-form :is(th, td),
html body.joymax-polish.woocommerce-cart #content .cart_totals :is(table, th, td) {
  background: transparent !important;
  border-color: var(--jm-line) !important;
}

.joymax-polish.woocommerce-cart .woocommerce-cart-form :is(th, td) {
  padding-block: 12px;
}

.joymax-polish.woocommerce-cart .product-thumbnail img {
  border-radius: 9px;
}

.joymax-polish.woocommerce-cart .cart_totals .order-total strong {
  color: var(--jm-gold);
  font-variant-numeric: tabular-nums;
}

.joymax-polish.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
  min-height: 48px;
  display: grid;
  place-items: center;
}

html body.joymax-polish.woocommerce-cart #content .wc-empty-cart-message {
  max-width: 620px;
  margin: 26px auto 15px;
  text-align: center;
  padding: 28px 18px;
}

html body.joymax-polish.woocommerce-cart #content .cart-empty {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 17px;
}

html body.joymax-polish.woocommerce-cart #content .cart-empty::before {
  content: "";
  position: static;
  display: block;
  width: 32px;
  height: 32px;
  margin: 0 auto 12px;
  background: var(--jm-gold);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M5 8h14l1 13H4L5 8Zm4 2V6a3 3 0 0 1 6 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.joymax-polish.woocommerce-cart .return-to-shop {
  text-align: center;
}

@media (max-width: 720px) {
  body.joymax-polish .jm-nav { --jm-logo-size: 62px; }
  body.joymax-polish .jm-nav.jm-tools-ready > .elementor-container {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 10px;
  }
  body.joymax-polish .jm-nav.jm-tools-ready > .elementor-container > .elementor-column:nth-child(2) {
    grid-area: 2 / 1 / 3 / -1;
  }
  body.joymax-polish .jm-nav .elementor-icon-list-item a {
    min-height: 39px;
    padding-inline: 6px;
    gap: 6px;
  }
  body.joymax-polish .jm-nav .elementor-icon-list-text { font-size: 15px; }
  body.joymax-polish .jm-nav .elementor-icon-list-icon { --jm-nav-icon-size: 15px; }
  html body.joymax-polish #content .jm-product-details .jm-product-details__tags {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  html body.joymax-polish .jm-store-stats__list {
    grid-template-columns: 1fr;
  }
  html body.joymax-polish .jm-store-stats .jm-store-stats__list > .jm-store-stats__metric {
    padding-block: 10px !important;
  }
  html body.joymax-polish .jm-store-stats .jm-store-stats__list > .jm-store-stats__metric + .jm-store-stats__metric {
    border-inline-start: 0 !important;
    border-block-start: 1px solid var(--jm-card-edge) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.joymax-polish .jm-nav .elementor-icon-list-item a::before,
  body.joymax-polish .jm-nav .elementor-icon-list-item a::after {
    transition: none;
  }
}
