/* =====================================================
   SPICY SECRETS – SHOP.CSS (FIXED + CLEAN)
   Scope:
   - Shop
   - Categorie prodotto (pills)
   - Card prodotto
===================================================== */

/* =====================================================
   SHOP HEADER
===================================================== */

.shop-header{
  max-width: var(--container);
  margin: 0 auto 48px;
  padding: 0 24px;
}

.shop-header .woocommerce-breadcrumb{
  font-size: .85rem;
  opacity: .6;
  margin-bottom: 12px;
}

.shop-title{
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.shop-intro{
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.shop-trust{
  font-size: .95rem;
  color: #666;
}


/* =====================================================
   SHOP GRID – 4 COLONNE FISSE DESKTOP
===================================================== */

body.woocommerce-shop ul.products,
body.tax-product_cat ul.products{
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* SEMPRE 4 */
  gap: 24px;
  align-items: stretch;

  list-style: none;
  padding: 0;
  margin: 40px 0;

  justify-content: start; /* non centrare quando sono pochi */
}

/* Disinnesca layout legacy Woo */
body.woocommerce-shop ul.products::before,
body.woocommerce-shop ul.products::after,
body.tax-product_cat ul.products::before,
body.tax-product_cat ul.products::after{
  content: none;
  display: none;
}

/* Reset float / width Woo */
body.woocommerce-shop ul.products li.product,
body.tax-product_cat ul.products li.product{
  float: none;
  width: auto;
  margin: 0;
}


/* =====================================================
   PRODUCT CARD
===================================================== */

body.woocommerce-shop ul.products li.product,
body.tax-product_cat ul.products li.product{
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;

  background: #fff;
  padding: 0;
  border-radius: 10px;

  transition: transform .2s ease, box-shadow .2s ease;
}

body.woocommerce-shop ul.products li.product:hover,
body.tax-product_cat ul.products li.product:hover{
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0,0,0,.08);
}

/* Link interno: colonna flex che cresce (importantissimo) */
body.woocommerce-shop ul.products li.product .woocommerce-LoopProduct-link,
body.tax-product_cat ul.products li.product .woocommerce-LoopProduct-link{
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  padding: 16px;
}

/* Immagine */
body.woocommerce-shop ul.products li.product img,
body.tax-product_cat ul.products li.product img{
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;

  background: #f5f5f5;
  padding: 12px;
  border-radius: 6px;
}


/* =====================================================
   PRODUCT TITLE
===================================================== */

body.woocommerce-shop .woocommerce-loop-product__title,
body.tax-product_cat .woocommerce-loop-product__title{
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;

  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;

  margin: 12px 0 8px;
}

/* Elimina <br> nel titolo */
body.woocommerce-shop .woocommerce-loop-product__title br,
body.tax-product_cat .woocommerce-loop-product__title br{
  display: none;
}


/* =====================================================
   PRICE – SEMPRE IN BASSO (ROBUSTO)
   - Funziona sia se .price è DENTRO il link
   - sia se .price è FUORI dal link (tema/override)
===================================================== */
@media (min-width: 769px){
/* Caso 1: prezzo dentro il link */
body.woocommerce-shop ul.products li.product .woocommerce-LoopProduct-link .price,
body.tax-product_cat ul.products li.product .woocommerce-LoopProduct-link .price{
  margin-top: auto !important;
}
}
/* Caso 2: prezzo fuori dal link (direct child o sibling) */
body.woocommerce-shop ul.products li.product > .price,
body.tax-product_cat ul.products li.product > .price,
body.woocommerce-shop ul.products li.product .price,
body.tax-product_cat ul.products li.product .price{
  font-size: 15px;
  font-weight: 600;
  color: #000;
}

/* Se il prezzo è fuori dal link, lo spingiamo in basso con flex */
body.woocommerce-shop ul.products li.product > .price,
body.tax-product_cat ul.products li.product > .price{
  margin-top: auto !important;
  padding: 0 16px 16px; /* mantiene allineamento con padding del link */
}

/* Evita che il titolo “schiacci” la struttura */
body.woocommerce-shop .woocommerce-loop-product__title,
body.tax-product_cat .woocommerce-loop-product__title{
  flex-shrink: 0;
}


/* =====================================================
   MICRO BADGE (CATEGORIA)
===================================================== */

.product-badge{
  position: absolute;
  top: 10px;
  left: 10px;

  background: rgba(196,22,28,.95);
  color: #fff;

  font-size: 11px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 999px;
  text-transform: uppercase;
}


/* =====================================================
   SHOP CLEANUP
===================================================== */

body.woocommerce-shop .woocommerce ul.products li.product .button,
body.tax-product_cat .woocommerce ul.products li.product .button,
body.woocommerce-shop .woocommerce ul.products li.product form,
body.tax-product_cat .woocommerce ul.products li.product form,
.woocommerce .star-rating,
.woocommerce span.onsale{
  display: none;
}


/* =====================================================
   RESPONSIVE GRID
===================================================== */

@media (max-width: 1024px){
  body.woocommerce-shop ul.products,
  body.tax-product_cat ul.products{
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px){
  body.woocommerce-shop ul.products,
  body.tax-product_cat ul.products{
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 420px){
  body.woocommerce-shop ul.products,
  body.tax-product_cat ul.products{
    grid-template-columns: 1fr;
  }
}


/* =====================================================
   SHOP CATEGORIES – PILLS  ✅ (MANCAVANO)
===================================================== */

.shop-categories{
  margin: 32px 0 24px;
}

.shop-categories ul{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.shop-categories a{
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;

  background: #f3f3f3;
  color: #000;
  text-decoration: none;

  font-size: .9rem;
  font-weight: 500;

  transition: background .2s ease, color .2s ease;
}

.shop-categories a:hover{
  background: #e5e5e5;
}

.shop-categories a.active{
  background: var(--night-black);
  color: #fff;
}


/* =====================================================
   MOBILE – LAYOUT (COME IL TUO)
===================================================== */

@media (max-width: 768px){

  body.woocommerce-shop .page-content,
  body.tax-product_cat .page-content{
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.woocommerce-shop .page-inner,
  body.tax-product_cat .page-inner{
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Grid 1 colonna */
  body.woocommerce-shop ul.products,
  body.tax-product_cat ul.products{
    grid-template-columns: 1fr !important;
    gap: 20px;
    justify-items: center;
  }

  /* Card */
  body.woocommerce-shop ul.products li.product,
  body.tax-product_cat ul.products li.product{
    width: 100%;
    max-width: 360px;   /* ← se vuoi full-width: metti 100% e togli max-width */
    padding: 0;
  }

  /* Padding interno del link */
  body.woocommerce-shop ul.products li.product .woocommerce-LoopProduct-link,
  body.tax-product_cat ul.products li.product .woocommerce-LoopProduct-link{
    padding: 20px;
  }

  /* Immagine mobile */
  body.woocommerce-shop ul.products li.product img,
  body.tax-product_cat ul.products li.product img{
    object-fit: cover;
    padding: 8px;
    background: #f5f5f5;
  }

  /* Se il prezzo è fuori dal link, mantieni padding coerente */
  body.woocommerce-shop ul.products li.product > .price,
  body.tax-product_cat ul.products li.product > .price{
    padding: 0 20px 20px;
  }
}


/* =====================================================
   PRODUCT NEW (Woo Blocks) – FIX INTERNO CARD
===================================================== */

.wp-block-woocommerce-product-new .wc-block-grid__product{
  display: flex;
  flex-direction: column;
}

.wp-block-woocommerce-product-new .wc-block-grid__product-link{
  display: flex;
  flex-direction: column;
  flex: 1;
}

.wp-block-woocommerce-product-new .wc-block-grid__product-price{
  margin-top: auto;
}

.wp-block-woocommerce-product-new .wc-block-grid__product-add-to-cart{
  margin-top: 12px;
}


/* =========================================
   CARRELLO VUOTO – WOO BLOCKS
========================================= */

.wc-block-cart__empty-cart__title{
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

/* =====================================================
   SHOP SUBCATEGORIES – PILLS (nav.shop-subcategories)
===================================================== */

nav.shop-subcategories{
  margin: 16px 0 24px;
}

nav.shop-subcategories ul{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;

  list-style: none;
  padding: 0;
  margin: 0;
}

nav.shop-subcategories li{
  margin: 0;
  padding: 0;
}

nav.shop-subcategories a{
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;

  background: #f3f3f3;
  color: #000;
  text-decoration: none;

  font-size: .9rem;
  font-weight: 500;

  transition: background .2s ease, color .2s ease;
}

nav.shop-subcategories a:hover{
  background: #e5e5e5;
}

/* attiva (nel tuo HTML è class="active" sull'<a>) */
nav.shop-subcategories a.active{
  background: var(--night-black);
  color: #fff;
}
@media (max-width: 768px){

  /* separatore visivo tra categorie e sottocategorie */
  nav.shop-subcategories{
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
  }

}
@media (max-width: 768px){

  .shop-categories a,
  nav.shop-subcategories a{
    padding: 6px 14px;
    font-size: .85rem;
  }

}
@media (max-width: 768px){

  body.tax-product_cat ul.products{
    margin-top: 28px;
  }

}
@media (max-width: 768px){

  .shop-categories a.active,
  nav.shop-subcategories a.active{
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
  }

}
/* =====================================================
   MOBILE – PRODUCT CARD (CLEAN VERSION)
===================================================== */

@media (max-width: 768px){

  /* Grid: una colonna pulita */
  body.woocommerce-shop ul.products,
  body.tax-product_cat ul.products{
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 16px 0;
  }

  /* Card */
  body.woocommerce-shop ul.products li.product,
  body.tax-product_cat ul.products li.product{
    width: 100%;
    margin: 0;
  }

  /* Link-card: vero contenitore */
  body.woocommerce-shop ul.products li.product > a.woocommerce-LoopProduct-link,
  body.tax-product_cat ul.products li.product > a.woocommerce-LoopProduct-link{
    display: block;
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
  }

  /* Immagine grande */
  body.woocommerce-shop ul.products li.product img,
  body.tax-product_cat ul.products li.product img{
    display: block;
    width: 80%;
    height: auto;
    padding: 0;
    margin: 0;
    background: transparent;
    aspect-ratio: 1 / 1;
    object-fit: contain;
  }

  /* Titolo – fino a 3 righe */
  body.woocommerce-shop .woocommerce-loop-product__title,
  body.tax-product_cat .woocommerce-loop-product__title{
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;

    font-size: 15px;
    line-height: 1.3;
    margin: 8px 0 4px;
  }

  /* Prezzo vicino e leggibile */
  body.woocommerce-shop ul.products li.product .price,
  body.tax-product_cat ul.products li.product .price{
    margin: 4px 0 0;
    font-size: 16px;
    font-weight: 700;
  }

}
/* =====================================================
   LAYOUT – STICKY FOOTER
===================================================== */

html, body{
  height: 100%;
}

body{
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Contenuto principale cresce */
.page-content{
  flex: 1 0 auto;
}

/* Footer resta in fondo */
.site-footer{
  flex-shrink: 0;
}
/* =====================================================
   CART – NASCONDI "AGGIUNGI AL CARRELLO"
===================================================== */

/* Carrello classico */
body.woocommerce-cart .woocommerce a.button,
body.woocommerce-cart .woocommerce button.button{
  display: none;
}

/* Carrello Woo Blocks */
body.woocommerce-cart .wc-block-cart-item__add-to-cart{
  display: none;
}
/* =====================================================
   CART – GRID PRODOTTI PIÙ COMPATTO
===================================================== */

body.woocommerce-cart ul.wc-block-grid__products{
  margin-top: 24px;
}

body.woocommerce-cart li.wc-block-grid__product{
  padding: 12px;
}

body.woocommerce-cart .wc-block-grid__product-title{
  font-size: 14px;
  line-height: 1.3;
}

body.woocommerce-cart .wc-block-grid__product-price{
  font-weight: 700;
}


/* Avviso spedizione gratuita – Carrello */
.eshop-free-shipping-cartblock {
  width: 100%;
  margin: 0 0 24px 0;
  padding: 14px 18px;
  box-sizing: border-box;

  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 6px;

  font-size: 15px;
  line-height: 1.4;
}


/* ===============================
   CHECKOUT – Prezzo nel box
================================ */

/* forza il contenimento del riepilogo */
.wc-block-checkout__order-summary,
.wc-block-checkout__order-summary * {
  box-sizing: border-box;
}

/* riga prodotto nel riepilogo */
.wc-block-checkout__order-summary-item {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  align-items: start;
}

/* prezzo prodotto */
.wc-block-checkout__order-summary-item-price,
.wc-block-components-product-price {
  white-space: normal;       /* 🔑 evita lo sforamento */
  text-align: right;
  max-width: 100%;
}

/* totale finale */
.wc-block-checkout__order-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wc-block-checkout__order-summary-total .wc-block-components-totals-item__value {
  white-space: nowrap;
}
