/*
 Theme Name:     Divi Child
 Theme URI:      https://www.elegantthemes.com/gallery/divi/
 Description:    Divi Child Theme
 Author:         Elegant Themes
 Author URI:     https://www.elegantthemes.com
 Template:       Divi
 Version:        1.0.1
*/

/* =Theme customization starts here
------------------------------------------------------- */

/* PRODOTTI: tag */
.nm-tag-aziende,
.nm-tag-privati {
  display: inline-block;
  font-size: 12px;
  line-height: 1.2;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  margin: 8px 8px 8px 0;
}

.nm-tag-aziende {
  background-color: #999;
}

.nm-tag-privati {
  background-color: #ff914f;
}

/* LOOP PRODOTTI NOLEGGI.ME */
.nm-phone-shop ul.products,
.nm-phone-shop .products {
  display: block !important;
}

.nm-phone-shop ul.products li.product,
.nm-phone-shop .products .product {
  float: none !important;
  clear: both !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 0 42px !important;
  padding: 24px 0 30px !important;
  display: grid !important;
  grid-template-columns: 240px minmax(0, 1fr);
  column-gap: 32px;
  align-items: start;
}

/* Link prodotto: immagine e titolo diventano elementi della griglia */
.nm-phone-shop li.product > a.woocommerce-LoopProduct-link,
.nm-phone-shop li.product > a.woocommerce-loop-product__link {
  display: contents !important;
}

/* Solo immagine principale del prodotto */
.nm-phone-shop li.product .et_shop_image {
  grid-column: 1;
  grid-row: 1 / span 30;
  display: block !important;
  width: 100% !important;
  max-width: 240px !important;
  margin: 0 !important;
}

.nm-phone-shop li.product .et_shop_image img,
.nm-phone-shop li.product img.wp-post-image {
  width: 100% !important;
  max-width: 240px !important;
  height: auto !important;
  margin: 0 !important;
}

/* Titolo prodotto */
.nm-phone-shop li.product .woocommerce-loop-product__title {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: stretch !important;
  align-self: start !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  text-align: left !important;
  font-size: 34px !important;
  line-height: 1.15 !important;
  font-weight: 400 !important;
  white-space: normal !important;
  word-break: normal !important;
}

/* Descrizione breve */
.nm-phone-shop li.product .nm-shop-testo-breve {
  grid-column: 2 !important;
  grid-row: 2 !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  color: #666;
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
}

.nm-shop-testo-breve p {
  margin: 0 0 10px;
  padding: 0;
  line-height: 1.45;
}

.nm-shop-testo-breve br,
.nm-shop-testo-breve br.nm-shortcode-br {
  display: block !important;
  content: "";
  margin: 0;
}

/* Tabelle prezzi */
.nm-shop-testo-breve .nm-pacc-tb {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
  gap: 0;
  width: 100%;
  max-width: 100%;
  margin: 8px 0;
  padding: 12px 14px;
  background: #f5f6fb;
  border-radius: 5px;
  clear: both;
  box-sizing: border-box;
  text-align: center;
}

/* Numero colonne in base agli shortcode usati */
.nm-shop-testo-breve .nm-pacc-tb:has(.one_half),
.nm-shop-testo-breve .nm-pacc-tb:has(.one_half_last),
.nm-shop-testo-breve .nm-pacc-tb:has(.nm-one-half),
.nm-shop-testo-breve .nm-pacc-tb:has(.nm-one-half-last) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nm-shop-testo-breve .nm-pacc-tb:has(.one_third),
.nm-shop-testo-breve .nm-pacc-tb:has(.one_third_last) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nm-shop-testo-breve .nm-pacc-tb:has(.one_fourth),
.nm-shop-testo-breve .nm-pacc-tb:has(.one_fourth_last) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Righe singole tipo "Ore aggiuntive: 130€/h" */
.nm-shop-testo-breve .nm-pacc-tb:not(:has(.one_half, .one_half_last, .one_third, .one_third_last, .one_fourth, .one_fourth_last, .nm-one-half, .nm-one-half-last, .wp-block-column)) {
  display: block !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  text-align: center;
}

/* Colonne interne */
.nm-shop-testo-breve .nm-pacc-tb > .wp-block-columns {
  display: contents !important;
}

.nm-shop-testo-breve .nm-pacc-tb .wp-block-column,
.nm-shop-testo-breve .nm-pacc-tb [class*="one_"],
.nm-shop-testo-breve .nm-pacc-tb [class*="nm-one-"] {
  float: none !important;
  display: block !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 8px 10px !important;
  text-align: center;
  box-sizing: border-box;
  background: transparent !important;
}

/* Prezzi */
.nm-shop-testo-breve .nm-pacc-tb b,
.nm-shop-testo-breve .nm-pacc-tb strong {
  display: inline-block !important;
  font-size: 24px;
  line-height: 1.05;
  font-weight: 700;
  color: #1d152d;
  vertical-align: baseline;
}

/* Icone operatori dentro le tabelle */
.nm-shop-testo-breve .nm-pacc-tb-divimg {
  display: block;
  text-align: center;
  margin: 0 0 4px;
}

.nm-shop-testo-breve .nm-pacc-tb-divimg img {
  display: block !important;
  width: auto !important;
  max-width: 54px !important;
  height: auto !important;
  margin: 0 auto 4px !important;
}

/* Bottone nella descrizione breve */
.nm-shop-testo-breve .prenotaBtn {
  display: inline-block;
  width: auto;
  margin-top: 8px;
  padding: 10px 18px;
  border-radius: 4px;
  background: #1d152d;
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
}

/* Mobile */
@media only screen and (max-width: 767px) {
  .nm-phone-shop ul.products li.product,
  .nm-phone-shop .products .product {
    grid-template-columns: 1fr;
    row-gap: 16px;
  }

  .nm-phone-shop li.product .et_shop_image,
  .nm-phone-shop li.product .woocommerce-loop-product__title,
  .nm-phone-shop li.product .nm-shop-testo-breve {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  .nm-phone-shop li.product .et_shop_image,
  .nm-phone-shop li.product .et_shop_image img,
  .nm-phone-shop li.product img.wp-post-image {
    max-width: 260px !important;
  }

  .nm-phone-shop li.product .woocommerce-loop-product__title {
    font-size: 28px !important;
  }

  .nm-shop-testo-breve .nm-pacc-tb:has(.one_third),
  .nm-shop-testo-breve .nm-pacc-tb:has(.one_third_last),
  .nm-shop-testo-breve .nm-pacc-tb:has(.one_fourth),
  .nm-shop-testo-breve .nm-pacc-tb:has(.one_fourth_last) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.nm-phone-shop li.product.nm-clickable-product-card {
  cursor: pointer;
}

/* Fix titolo prodotti loop: annulla vecchio spostamento Divi 4 */
@media (min-width: 1024px) {
  .nm-phone-shop li.product .woocommerce-loop-product__title {
    position: static !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    padding-top: 0 !important;
  }
}


/* Rimuove overlay/zoom hover sulle immagini prodotto nei loop */
.nm-phone-shop li.product .et_shop_image .et_overlay {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.nm-phone-shop li.product .et_shop_image:hover .et_overlay {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.nm-phone-shop li.product .et_shop_image img,
.nm-phone-shop li.product .et_shop_image:hover img {
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
}

