/**
 * Navneleg Suite – Produktkort
 * Migreret fra WPCode snippet #33796: Produktkort titel og pris.
 * Kilden bevares i WPCode som deaktiveret rollback.
 */

/**
 * Navneleg produktkort
 * WooCommerce + Salient produktlister
 *
 * Desktop:
 * - Titel: 16px
 * - Pris: "fra" 14px / pris 15px
 * - Knap vises
 *
 * Mobil/tablet:
 * - Knapper skjules
 * - Pris vises alene
 * - Mobilpris: 13px
 */

/* Produktkort */
body #ajax-content-wrap ul.products li.product {
  overflow: visible !important;
}

/* Billeder */
body #ajax-content-wrap ul.products li.product .product-wrap {
  border-radius: 10px !important;
  overflow: hidden !important;
}

body #ajax-content-wrap ul.products li.product .product-wrap img {
  border-radius: 10px !important;
  margin-bottom: 0 !important;
}

/* Tekstområde */
body #ajax-content-wrap ul.products li.product .product-meta {
  padding: 20px 20px 20px 20px !important;
  text-align: left !important;
}

/* Titel */
body #ajax-content-wrap ul.products li.product .product-meta h2,
body #ajax-content-wrap ul.products li.product .product-meta h2 a,
body #ajax-content-wrap ul.products li.product h2.woocommerce-loop-product__title,
body #ajax-content-wrap ul.products li.product h2.woocommerce-loop-product__title a {
  color: #24201e !important;
  font-size: 16px !important;
  line-height: 1.15 !important;
  font-weight: 500 !important;
  letter-spacing: -0.45px !important;
  text-align: left !important;
  text-transform: none !important;
  text-decoration: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Pris + knap-wrapper */
body #ajax-content-wrap ul.products li.product .price-hover-wrap {
  position: relative !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 14px !important;

  width: 100% !important;
  min-height: 30px !important;

  margin: 15px 0 0 0 !important;
  padding: 0 !important;

  overflow: visible !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* Pris: nulstil Salient/WooCommerce og skjul range-tekst via font-size: 0 */
body #ajax-content-wrap ul.products li.product .price-hover-wrap .price {
  grid-column: 1 !important;

  position: static !important;
  display: block !important;

  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;

  margin: 0 !important;
  padding: 0 !important;

  color: #8b8179 !important;
  font-size: 0 !important;
  line-height: 1.1 !important;
  font-weight: 400 !important;
  text-align: left !important;
  white-space: nowrap !important;

  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* Desktop: tilføj "fra" før første pris */
body #ajax-content-wrap ul.products li.product .price-hover-wrap .price::before {
  content: "fra " !important;
  color: #8b8179 !important;
  font-size: 14px !important;
  line-height: 1.1 !important;
  font-weight: 400 !important;
}

/* Desktop: vis kun første prisbeløb */
body #ajax-content-wrap ul.products li.product .price-hover-wrap .price .amount:first-of-type,
body #ajax-content-wrap ul.products li.product .price-hover-wrap .price .navneleg-price-main {
  display: inline-block !important;
  color: #24201e !important;
  font-size: 15px !important;
  line-height: 1.1 !important;
  font-weight: 600 !important;
  letter-spacing: -0.35px !important;
}

/* Skjul øvrige prisbeløb i range-priser */
body #ajax-content-wrap ul.products li.product .price-hover-wrap .price .amount:not(:first-of-type) {
  display: none !important;
}

/* Sørg for at WooCommerce-valutasymbol arver korrekt styling */
body #ajax-content-wrap ul.products li.product .price-hover-wrap .price .amount:first-of-type bdi,
body #ajax-content-wrap ul.products li.product .price-hover-wrap .price .amount:first-of-type .woocommerce-Price-currencySymbol,
body #ajax-content-wrap ul.products li.product .price-hover-wrap .price .navneleg-price-main bdi,
body #ajax-content-wrap ul.products li.product .price-hover-wrap .price .navneleg-price-main .woocommerce-Price-currencySymbol {
  color: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit !important;
}

/* Knap-wrapper */
body #ajax-content-wrap ul.products li.product .price-hover-wrap .product-add-to-cart {
  grid-column: 2 !important;

  position: static !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;

  width: auto !important;
  height: auto !important;

  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;

  margin: 0 !important;
  padding: 0 !important;

  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* Knap */
body #ajax-content-wrap ul.products li.product .product-add-to-cart a,
body #ajax-content-wrap ul.products li.product a.add_to_cart_button,
body #ajax-content-wrap ul.products li.product a.product_type_variable {
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: auto !important;
  min-width: 102px !important;
  min-height: 20px !important;

  margin: 0 !important;
  padding: 10px 10px !important;

  background: #ffffff !important;
  color: #24201e !important;
  border: 1px solid #24201e !important;
  border-radius: 999px !important;

  font-size: 14px !important;
  line-height: 1 !important;
  font-weight: 500 !important;
  letter-spacing: -0.25px !important;
  text-transform: none !important;
  text-decoration: none !important;

  box-shadow: none !important;
  outline: none !important;

  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* Variable produkter: smallere "Vælg"-knap */
body #ajax-content-wrap ul.products li.product .product-add-to-cart a.navneleg-choose-options,
body #ajax-content-wrap ul.products li.product a.product_type_variable.navneleg-choose-options {
  min-width: 82px !important;
}

/* Simple produkter: "+ Kurv" */
body #ajax-content-wrap ul.products li.product .product-add-to-cart a.navneleg-direct-cart,
body #ajax-content-wrap ul.products li.product a.add_to_cart_button.navneleg-direct-cart {
  min-width: 102px !important;
}

/* Skjul WooCommerce "Se kurv" efter AJAX add-to-cart */
body #ajax-content-wrap ul.products li.product a.added_to_cart.wc-forward {
  display: none !important;
}

/* Stabil knap efter klik/loading/added */
body #ajax-content-wrap ul.products li.product .product-add-to-cart a.loading,
body #ajax-content-wrap ul.products li.product .product-add-to-cart a.added,
body #ajax-content-wrap ul.products li.product .product-add-to-cart a:active,
body #ajax-content-wrap ul.products li.product .product-add-to-cart a:focus {
  background: #ffffff !important;
  color: #24201e !important;
  border-color: #24201e !important;
  box-shadow: none !important;
  outline: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* Fjern Salient/Woo ikoner, loading-spinner og flueben */
body #ajax-content-wrap ul.products li.product .product-add-to-cart a::before,
body #ajax-content-wrap ul.products li.product .product-add-to-cart a::after,
body #ajax-content-wrap ul.products li.product a.add_to_cart_button::before,
body #ajax-content-wrap ul.products li.product a.add_to_cart_button::after,
body #ajax-content-wrap ul.products li.product a.product_type_variable::before,
body #ajax-content-wrap ul.products li.product a.product_type_variable::after,
body #ajax-content-wrap ul.products li.product .product-add-to-cart a i,
body #ajax-content-wrap ul.products li.product .product-add-to-cart a svg {
  display: none !important;
  content: none !important;
}

/* Stop Salient hover-animationer */
body #ajax-content-wrap ul.products li.product:hover .price-hover-wrap,
body #ajax-content-wrap ul.products li.product:hover .price-hover-wrap .price,
body #ajax-content-wrap ul.products li.product:hover .price-hover-wrap .product-add-to-cart,
body #ajax-content-wrap ul.products li.product:hover .price-hover-wrap .product-add-to-cart a {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* Hover */
body #ajax-content-wrap ul.products li.product .product-add-to-cart a:hover {
  background: #24201e !important;
  color: #ffffff !important;
  border-color: #24201e !important;
  text-decoration: none !important;
}

/* Mobil + tablet: skjul knapper, men behold pris */
@media screen and (max-width: 1180px), screen and (pointer: coarse), screen and (hover: none) {

  body #ajax-content-wrap ul.products li.product .price-hover-wrap {
    display: block !important;
    grid-template-columns: none !important;
    min-height: 0 !important;
    margin-top: 13px !important;
    padding: 0 !important;
  }

  body #ajax-content-wrap ul.products li.product .product-add-to-cart,
  body #ajax-content-wrap ul.products li.product .price-hover-wrap .product-add-to-cart,
  body #ajax-content-wrap ul.products li.product a.button,
  body #ajax-content-wrap ul.products li.product a.add_to_cart_button,
  body #ajax-content-wrap ul.products li.product a.ajax_add_to_cart,
  body #ajax-content-wrap ul.products li.product a.product_type_simple,
  body #ajax-content-wrap ul.products li.product a.product_type_variable,
  body #ajax-content-wrap ul.products li.product a.navneleg-direct-cart,
  body #ajax-content-wrap ul.products li.product a.navneleg-choose-options,
  body #ajax-content-wrap ul.products li.product a.added_to_cart.wc-forward {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  body #ajax-content-wrap ul.products li.product .price-hover-wrap .price {
    display: block !important;
    text-align: left !important;
    width: 100% !important;
  }
}

/* Mobil: mindre titel og pris */
@media screen and (max-width: 767px) {
  body #ajax-content-wrap ul.products li.product .product-meta {
    padding: 18px 0 22px 0 !important;
  }

  body #ajax-content-wrap ul.products li.product .product-meta h2,
  body #ajax-content-wrap ul.products li.product .product-meta h2 a,
  body #ajax-content-wrap ul.products li.product h2.woocommerce-loop-product__title,
  body #ajax-content-wrap ul.products li.product h2.woocommerce-loop-product__title a {
    font-size: 13px !important;
    line-height: 1.15 !important;
  }

  body #ajax-content-wrap ul.products li.product .price-hover-wrap .price::before {
    font-size: 13px !important;
  }

  body #ajax-content-wrap ul.products li.product .price-hover-wrap .price .amount:first-of-type,
  body #ajax-content-wrap ul.products li.product .price-hover-wrap .price .navneleg-price-main {
    font-size: 13px !important;
    font-weight: 600 !important;
  }
}
