/* Lad hjertet svinge – visuel formatvælger til variable WooCommerce-produkter */
.lhs-format-swatches,
.lhs-format-swatches *,
.lhs-format-swatches__variation-description {
  /* variation-description-boksen indsættes som søskende til .lhs-format-swatches i
     DOM'en (se format-swatches.js), ikke som barn – skal derfor nævnes eksplicit
     her, ellers arver den temaets system-font i stedet for Cambria. */
  font-family: cambria, sans-serif;
}

:root {
  --lhs-cta: #F9B738;
  --lhs-cta-ink: #97600f;
  --lhs-text-dark: #603314;
  --lhs-white: #FFFFFF;
  --lhs-accent: #E5E2DE;
}

.lhs-format-swatches {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 6px 0 18px;
  padding: 0;
  list-style: none;
}

.lhs-format-swatches__item {
  width: 100%;
}

.lhs-format-swatches__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.lhs-format-swatches__label {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: 2px solid var(--lhs-accent);
  background: var(--lhs-white);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
  box-shadow: 0 1px 2px rgba(96,51,20,.06);
}

.lhs-format-swatches__label:hover {
  border-color: #e9c98d;
  box-shadow: 0 4px 12px rgba(96,51,20,.10);
}

.lhs-format-swatches__input:checked + .lhs-format-swatches__label {
  border-color: var(--lhs-cta);
  background: #fffaf0;
  box-shadow: 0 2px 8px rgba(249,183,56,.14);
}

.lhs-format-swatches__input:focus-visible + .lhs-format-swatches__label {
  outline: 2px solid var(--lhs-cta);
  outline-offset: 2px;
}

.lhs-format-swatches__icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  color: var(--lhs-text-dark);
  opacity: .7;
}

.lhs-format-swatches__icon svg { width: 100%; height: 100%; display: block; }

.lhs-format-swatches__input:checked + .lhs-format-swatches__label .lhs-format-swatches__icon {
  color: var(--lhs-cta-ink);
  opacity: 1;
}

.lhs-format-swatches__text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lhs-format-swatches__title {
  font-weight: 600;
  font-size: 15px;
  color: var(--lhs-text-dark);
  line-height: 1.3;
}

.lhs-format-swatches__price {
  font-size: 14px;
  color: var(--lhs-text-dark);
  opacity: .78;
  margin-left: auto;
  padding-right: 8px;
  white-space: nowrap;
}

.lhs-format-swatches__price .amount { font-weight: 700; }

.lhs-format-swatches__badge {
  background: var(--lhs-cta);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.lhs-format-swatches__check {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--lhs-accent);
  background: #fff;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.lhs-format-swatches__input:checked + .lhs-format-swatches__label .lhs-format-swatches__check {
  border-color: var(--lhs-cta);
  background: var(--lhs-cta);
  box-shadow: inset 0 0 0 3px #fff;
}

/* Visually hide (but keep functional) the native WooCommerce dropdown once enhanced */
.lhs-format-enhanced .variations {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.lhs-format-swatches__variation-description {
  display: none;
  margin: 0 0 18px;
  padding: 12px 14px;
  background: var(--lhs-accent);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--lhs-text-dark);
}

.lhs-format-swatches__variation-description.is-visible { display: block; }

/* WooCommerce already renders its own variation description further down –
   we show a styled copy right under the swatches instead, so hide the default one.
   Same for the native variation price box – the big Elementor price heading above
   already updates dynamically (see applySelection() in format-swatches.js), so this
   smaller native duplicate underneath the swatches is redundant. */
.lhs-format-enhanced .woocommerce-variation-description,
.lhs-format-enhanced .woocommerce-variation-price {
  display: none !important;
}

@media (max-width: 480px) {
  .lhs-format-swatches__label { padding: 12px 14px; gap: 10px; }
  .lhs-format-swatches__text { flex-direction: column; align-items: flex-start; gap: 2px; }
  .lhs-format-swatches__price { margin-left: 0; padding-right: 0; }
}

/* WooCommerce's own core stylesheet colors raw ".price" markup with its default
   olive (#958e09). When a variant is chosen, format-swatches.js swaps that raw
   WooCommerce price_html straight into the Elementor price heading (see
   applySelection() / findPriceHeading()), which picks up that default instead of
   our brand color. Force it back to our text color, scoped to that one heading. */
.elementor-heading-title .price,
.elementor-heading-title .woocommerce-Price-amount.amount,
.elementor-heading-title bdi {
  color: #603314 !important;
}

/* Same olive-default problem for the price shown next to each swatch option –
   match.price_html also comes straight from WooCommerce and includes its own
   ".price" wrapper, which wins over our lower-specificity .lhs-format-swatches__price
   rule. Force our brand color here too. */
.lhs-format-swatches__price .price,
.lhs-format-swatches__price .woocommerce-Price-amount.amount,
.lhs-format-swatches__price bdi {
  color: #603314 !important;
}
