/* XPDATA - Cartões de Produto
   Um único estilo de cartão para todo o site. */

:root{
  --xpc-brand:#ff5757;
  --xpc-brand-ink:#f03d3d;
  --xpc-brand-hover:#d42f2f;
  --xpc-deep:#3b0f11;
  --xpc-ink:#1c1717;
  --xpc-muted:#625a5a;
  --xpc-line:rgba(28,23,23,.10);
  --xpc-green:#16a34a;
}

/* ---------- Cartão ---------- */
ul.products li.product:not(.wc-block-product){
  background:#fff !important;
  border:1px solid var(--xpc-line) !important;
  border-radius:20px !important;
  padding:16px !important;
  box-shadow:none !important;
  position:relative !important;
  display:flex !important;
  flex-direction:column !important;
  text-align:left !important;
  transition:border-color .2s ease, box-shadow .2s ease !important;
}
ul.products li.product:not(.wc-block-product):hover{
  border-color:rgba(28,23,23,.22) !important;
  box-shadow:0 18px 40px rgba(28,23,23,.08) !important;
}
ul.products li.product > a.woocommerce-LoopProduct-link{
  display:flex !important;
  flex-direction:column !important;
  gap:12px !important;
  flex:1 !important;
  text-decoration:none !important;
}

/* ---------- Imagem ---------- */
.xpdata-media{
  position:relative !important;
  display:block !important;
  width:100% !important;
  padding-top:44px !important;           /* espaço para os selos de cima */
  background:#fff !important;
  border-radius:14px !important;
  overflow:hidden !important;
}
.xpdata-media > img{
  display:block !important;
  width:100% !important;
  height:186px !important;
  object-fit:contain !important;
  margin:0 !important;
  padding:0 8px 8px !important;
  background:#fff !important;              /* as fotos dos fornecedores têm fundo branco */
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
}

/* 2.ª imagem ao passar o rato */
li.product img.xp-hover-img{opacity:0;position:absolute;pointer-events:none}   /* antes do JS */
.xpdata-media > img.xp-hover-img{
  position:absolute !important;
  top:44px !important; left:0 !important; right:0 !important;
  height:186px !important;
  opacity:0;
  transition:opacity .35s ease;
  pointer-events:none;
  z-index:1;
}
@media (hover:hover){
  .xpdata-card:hover .xpdata-media > img.xp-hover-img{opacity:1}
}
@media (hover:none){
  .xpdata-media > img.xp-hover-img{display:none !important}
}

/* ---------- Selos de cima: stock + portes ---------- */
.xpdata-badge-overlay{
  position:absolute;
  top:10px; left:10px; right:10px;
  z-index:3;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:6px;
  pointer-events:none;
}
.xpdata-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  line-height:1.2;
  white-space:nowrap;
}
.xpdata-badge--instock,
.xpdata-badge--outofstock,
.xpdata-badge--backorder{
  background:#fff;
  box-shadow:0 2px 8px rgba(28,23,23,.10);
}
.xpdata-badge--instock::before,
.xpdata-badge--outofstock::before,
.xpdata-badge--backorder::before{
  content:"";
  width:8px; height:8px;
  border-radius:50%;
  flex-shrink:0;
}
.xpdata-badge--instock{color:#0f6b34}
.xpdata-badge--instock::before{background:var(--xpc-green)}
.xpdata-badge--outofstock{color:#b91c1c}
.xpdata-badge--outofstock::before{background:#dc2626}
.xpdata-badge--backorder{color:#92400e}
.xpdata-badge--backorder::before{background:#f59e0b}
.xpdata-badge--shipping{
  background:var(--xpc-deep);
  color:#fff;
  font-weight:700;
}
.xpdata-badge--shipping svg{width:14px;height:14px;stroke:#fff;stroke-width:2;fill:none;flex-shrink:0}

/* Cartões estreitos (ex.: "Produtos Relacionados"): "Portes grátis" fica só com o ícone do camião */
.xpdata-media{container-type:inline-size}
@container (max-width: 250px){
  .xpdata-badge-overlay{gap:4px}
  .xpdata-badge{font-size:11px;padding:4px 8px}
  .xpdata-badge--shipping{padding:5px 7px}
  .xpdata-badge--shipping span{display:none}
  .xpdata-grade-circle{width:50px;height:50px}
  .xpdata-grade-circle b{font-size:15px}
}

/* ---------- Grade (canto inferior direito) ---------- */
.xpdata-grade-circle{
  position:absolute;
  right:6px; bottom:8px;
  z-index:3;
  width:56px; height:56px;
  border-radius:50%;
  border:1.5px dashed rgba(28,23,23,.45);
  background:rgba(255,255,255,.92);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  line-height:1.05;
  pointer-events:none;
}
.xpdata-grade-circle small{font-size:9px;font-weight:700;color:var(--xpc-muted);text-transform:uppercase;letter-spacing:.04em}
.xpdata-grade-circle b{font-size:17px;font-weight:800;color:var(--xpc-ink)}

/* ---------- Desconto (canto inferior esquerdo) ---------- */
.xpdata-discount{
  position:absolute;
  left:6px; bottom:10px;
  z-index:3;
  padding:6px 10px;
  border-radius:8px;
  background:var(--xpc-brand-ink);
  color:#fff;
  font-size:14px;
  font-weight:800;
  line-height:1.2;
  pointer-events:none;
}

/* ---------- Esgotado ---------- */
.xpdata-is-out .xpdata-media > img{opacity:.5;filter:grayscale(.7)}
.xpdata-is-out .woocommerce-loop-product__title,
.xpdata-is-out .price,
.xpdata-is-out .wc-block-components-product-price{color:var(--xpc-muted) !important}


/* ---------- Cartões dos blocos do tema (loja / categorias / pesquisa) ---------- */
.xpdata-media-block{position:relative !important;overflow:visible !important}
.xpdata-media-block .xpdata-badge-overlay{top:8px;left:8px;right:8px}
.xpdata-card--block .wc-block-components-product-price{
  color:var(--xpc-brand-ink) !important;
  font-size:20px !important;
  font-weight:800 !important;
}
.xpdata-is-out .xpdata-media-block img{opacity:.5;filter:grayscale(.7)}

/* ---------- Título ---------- */
ul.products li.product .woocommerce-loop-product__title{
  display:-webkit-box !important;
  -webkit-box-orient:vertical !important;
  -webkit-line-clamp:3 !important;
  overflow:hidden !important;
  font-size:15px !important;
  font-weight:700 !important;
  line-height:1.3 !important;
  min-height:calc(1.3em * 3) !important;
  margin:4px 0 0 !important;
  padding:0 !important;
  color:var(--xpc-ink) !important;
  text-align:left !important;
}

/* ---------- Preço ---------- */
ul.products li.product .price{
  display:flex !important;
  align-items:baseline !important;
  flex-wrap:wrap !important;
  gap:8px !important;
  justify-content:center !important;
  align-self:center !important;
  margin-top:auto !important;
  padding:14px 2px 2px !important;
  border-top:1px solid var(--xpc-line) !important;
  font-size:22px !important;
  font-weight:800 !important;
  color:var(--xpc-brand-ink) !important;
  background:none !important;
  text-align:center !important;
}
ul.products li.product .price del,
.xpdata-card--block .wc-block-components-product-price del{
  font-size:14px !important;
  font-weight:600 !important;
  color:var(--xpc-muted) !important;
  opacity:1 !important;
}
ul.products li.product .price ins,
.xpdata-card--block .wc-block-components-product-price ins{
  text-decoration:none !important;
  background:none !important;
  order:2;
}
.woocommerce-price-suffix,
ul.products li.product .price small{display:none !important}

/* ---------- Botão ---------- */
.xpdata-atc-text{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  max-width:none !important;
  height:auto !important;
  margin:12px 0 0 !important;
  padding:11px 18px !important;
  box-sizing:border-box;
  background-color:var(--xpc-brand-ink) !important;
  background-image:none !important;
  color:#fff !important;
  opacity:1 !important;
  border:0 !important;
  border-radius:999px !important;
  font-size:14px !important;
  font-weight:700 !important;
  line-height:1.2 !important;
  text-decoration:none !important;
  text-align:center !important;
  text-indent:0 !important;
  text-transform:none !important;
  white-space:nowrap !important;
  overflow:visible !important;
  transition:background-color .2s ease !important;
  cursor:pointer;
}
.xpdata-card--block .xpdata-atc-text{width:auto !important;display:inline-flex !important}
.xpdata-atc-text:hover,
.xpdata-atc-text:focus-visible{
  background-color:var(--xpc-brand-hover) !important;
  color:#fff !important;
}
.xpdata-atc-text:focus-visible{outline:2px solid var(--xpc-brand-ink);outline-offset:3px}
.xpdata-atc-text:not(.xpdata-notify-btn) svg,
.xpdata-atc-text img,
.xpdata-atc-text::before,
.xpdata-atc-text::after{display:none !important;content:none !important}
/* Esgotado: botão "Avisar-me quando chegar" */
.xpdata-notify-btn,
.xpdata-is-out .xpdata-notify-btn{
  flex-direction:row !important;
  gap:8px !important;
  max-width:100% !important;
  background-color:#fff !important;
  color:var(--xpc-brand-ink) !important;
  border:1.5px solid var(--xpc-brand-ink) !important;
  padding:10px 16px !important;
  cursor:pointer !important;
}
.xpdata-notify-btn:hover,
.xpdata-notify-btn:focus-visible{
  background-color:var(--xpc-brand-ink) !important;
  color:#fff !important;
}
.xpdata-notify-btn svg{display:block !important;order:0 !important;width:16px !important;height:16px !important;stroke:currentColor;stroke-width:2;fill:none;flex-shrink:0}
.xpdata-notify-btn span{order:1 !important}
.xpdata-notify-btn span{display:inline !important}

/* destaque do formulário de aviso na página do produto */
.xpdata-notify-highlight{
  outline:2px solid var(--xpc-brand-ink) !important;
  outline-offset:6px;
  border-radius:10px;
  transition:outline-color .4s ease;
}
*:has(> .xpdata-atc-text){overflow:visible !important;max-width:none !important}

/* ---------- Limpeza de elementos nativos ---------- */
.wc-block-components-product-stock-indicator,
.wc-block-components-product-sale-badge,
.woocommerce span.onsale,
ul.products li.product span.onsale,
.added_to_cart.wc_forward{display:none !important}

/* Alinha preço e botão ao fundo do cartão nos blocos do tema */
.wp-block-group.flex.flex-column{display:flex !important;flex-direction:column !important;flex-grow:1}
.price-and-button,
.xpdata-price-and-button{margin-top:auto !important;flex-wrap:wrap !important;row-gap:8px}

@media (prefers-reduced-motion:reduce){
  .xpdata-card, .xpdata-media > img, .xpdata-atc-text{transition:none !important}
}
