/* =========================================================
   SOMOS TORTA — WOO.CSS (AFEITADO + CLEAN)
   - Single Product (minimal 50/50)
   - Archive / Category grid (4/3/2)
   - Fix definitivo contra width% WooCommerce (10.5.2)
   - Cart + Checkout centrados y compactos (solo /cart y /checkout)
   - Botón "Finalizar compra" para Woo Blocks
   IMPORTANT: El CART DRAWER va en cart.css (NO aquí)
========================================================= */

/* =========================
   SINGLE PRODUCT — MINIMAL 50/50
========================= */

.st-product{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:80px;
  padding:50px 0;
  align-items:start;
}

/* Galería limpia */
.st-product__gallery .woocommerce-product-gallery{
  width:100% !important;
  float:none !important;
  margin:0 !important;
}

.woocommerce-product-gallery__wrapper img{
  width:100%;
  height:auto;
  border-radius:6px;
}

/* Summary */
.st-product__summary{ padding-top:6px; }

.st-product__title{
  margin:0 0 10px;
  font-size:28px;
  line-height:1.15;
  letter-spacing:.01em;
}

.st-product__price{ margin:0 0 18px; }

.st-product__price .price{
  font-size:18px;
  font-weight:600;
  color:var(--st-orange);
  display:block;
}

.st-product__excerpt{
  margin:0 0 18px;
  color:#555;
  line-height:1.7;
  max-width:44ch;
}

/* CART: qty + botón en línea */
.st-product__cart form.cart{
  display:flex;
  align-items:center;
  gap:16px;
  margin:18px 0 0;
}

/* QTY wrapper */
.st-product__cart .quantity{
  margin:0 !important;
  display:inline-flex;
  align-items:center;
}

.st-product__cart .st-qty{
  display:inline-flex;
  align-items:center;
  height:44px;
  border:1px solid #545454;
  border-radius:6px;
  overflow:hidden;
  background:#fff;
}

.st-product__cart .st-qty__btn{
  width:44px;
  height:44px;
  border:0;
  background:transparent;
  color:#545454;
  font-size:18px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  user-select:none;
}
.st-product__cart .st-qty__btn:hover{ background:#f5f5f5; }

.st-product__cart .st-qty .qty{
  width:56px;
  height:44px;
  border:0 !important;
  outline:none;
  background:transparent;
  text-align:center;
  font-weight:600;
  -moz-appearance:textfield;
}
.st-product__cart .st-qty .qty::-webkit-outer-spin-button,
.st-product__cart .st-qty .qty::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}

.st-product__cart .st-qty:focus-within{
  border-color: var(--st-orange);
  box-shadow: 0 0 0 3px rgba(255,106,0,.12);
}

/* Botón add to cart */
.st-product__cart .single_add_to_cart_button,
.woocommerce div.product form.cart .single_add_to_cart_button{
  flex:1;
  height:44px;
  background:var(--st-orange) !important;
  color:#fff !important;
  border:0 !important;
  border-radius:10px !important;
  padding:0 18px !important;
  font-weight:600 !important;
  letter-spacing:.04em !important;
  box-shadow:none !important;
  text-transform:none !important;
  transition:opacity .2s ease, transform .2s ease;
}
.st-product__cart .single_add_to_cart_button:hover,
.woocommerce div.product form.cart .single_add_to_cart_button:hover{
  opacity:.92;
  transform:translateY(-1px);
}

/* Limpieza minimal */
.woocommerce div.product .product_meta,
.woocommerce div.product .woocommerce-product-rating{
  display:none !important;
}

/* Responsive single */
@media (max-width: 980px){
  .st-product{
    grid-template-columns:1fr;
    gap:32px;
    padding:34px 0;
  }
  .st-product__title{ font-size:26px; }
  .st-product__cart form.cart{ gap:8px; }
  .st-product__cart .st-qty{ height:42px; }
  .st-product__cart .st-qty__btn{ width:40px; height:42px; }
  .st-product__cart .st-qty .qty{ height:42px; }
  .st-product__cart .single_add_to_cart_button{ height:42px; }
}

/* =========================================================
   ARCHIVE / CATEGORY (GRID LIMPIO — DEFINITIVO)
   Desktop: 4
   Tablet: 3
   Mobile: 2
========================================================= */

/* Base UL */
.woocommerce ul.products{
  list-style:none !important;
  margin:0 !important;
  padding:0 !important;
}

/* Grid principal (gana a Woo 10.5.x) */
.woocommerce-page.woocommerce ul.products.products,
.woocommerce-page.woocommerce ul.products.products[class*="columns-"]{
  display:grid !important;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:24px;
  margin:0 !important;
  padding:0 !important;
  float:none !important;
  clear:both !important;
  box-sizing:border-box !important;
}

/* Mata pseudo clearfix de Woo */
.woocommerce-page.woocommerce ul.products.products::before,
.woocommerce-page.woocommerce ul.products.products::after{
  content:none !important;
  display:none !important;
}

/* LI libre */
.woocommerce-page.woocommerce ul.products.products > li.product{
  float:none !important;
  width:auto !important;
  margin:0 !important;
  max-width:none !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}

/* Cards */
body.woocommerce.archive ul.products li.product a{ text-decoration:none; }

body.woocommerce.archive ul.products li.product img{
  width:100%;
  height:auto;
  display:block;
  border-radius:2px;
  transition:transform .3s ease;
}

body.woocommerce.archive ul.products li.product a:hover img{
  transform:scale(1.03);
}

body.woocommerce.archive ul.products li.product .woocommerce-loop-product__title{
  margin:10px 0 0 !important;
  padding:0 !important;
  font-size:14px !important;
  font-weight:500 !important;
  opacity:.85;
}

body.woocommerce.archive ul.products li.product .price{
  margin-top:6px;
  font-weight:700;
  font-size:15px;
  color:var(--st-text);
}

/* Ocultar botones en cards */
body.woocommerce.archive ul.products li.product .button{
  display:none !important;
}

/* Tablet */
@media (max-width: 1024px){
  .woocommerce-page.woocommerce ul.products.products,
  .woocommerce-page.woocommerce ul.products.products[class*="columns-"]{
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:20px;
  }
}

/* Mobile (✅ 2 columnas como el home) */
@media (max-width: 680px){
  .woocommerce-page.woocommerce ul.products.products,
  .woocommerce-page.woocommerce ul.products.products[class*="columns-"]{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:16px;
  }
}

/* Centrar título de categoría / tienda */
.st-archive__title{
  text-align:center;
  font-size:32px;
  letter-spacing:.02em;
  margin-bottom:10px;
}

/* =========================================================
   CART + CHECKOUT (SOLO /cart y /checkout)
========================================================= */

/* Contenedor centrado */
body.woocommerce-cart #content .woocommerce,
body.woocommerce-checkout #content .woocommerce{
  max-width: 980px;
  margin: 0 auto;
}

/* Padding lateral (no full width) */
body.woocommerce-cart #content,
body.woocommerce-checkout #content{
  padding-left: 60px;
  padding-right: 60px;
}
@media (max-width: 980px){
  body.woocommerce-cart #content,
  body.woocommerce-checkout #content{
    padding-left: 18px;
    padding-right: 18px;
  }
}

/* ---------- CART (/cart) ---------- */

body.woocommerce-cart #content .woocommerce{
  display:grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  align-items:start;
}

body.woocommerce-cart #content .woocommerce > .woocommerce-notices-wrapper{
  grid-column: 1 / -1;
}

body.woocommerce-cart #content .woocommerce .woocommerce-cart-form{
  grid-column: 1;
  min-width:0;
}

body.woocommerce-cart #content .woocommerce .cart-collaterals{
  grid-column: 2;
  position: sticky;
  top: 120px;
}

/* Tabla más pro */
body.woocommerce-cart #content table.shop_table{
  width:100%;
  border:0 !important;
  border-collapse: collapse !important;
}

body.woocommerce-cart #content table.shop_table th{
  padding: 10px 10px !important;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(0,0,0,.55);
  border-bottom: 1px solid rgba(0,0,0,.10) !important;
}

body.woocommerce-cart #content table.shop_table td{
  padding: 14px 10px !important;
  border-bottom: 1px solid rgba(0,0,0,.08) !important;
  vertical-align: middle;
}

body.woocommerce-cart #content td.product-thumbnail img{
  width: 76px !important;
  height: 76px !important;
  object-fit: cover;
  border-radius: 12px;
}

/* Totales como card */
body.woocommerce-cart #content .cart_totals{
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}

body.woocommerce-cart #content .cart_totals h2{
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(0,0,0,.55);
}

/* ---------- CHECKOUT (/checkout) ---------- */

body.woocommerce-checkout #content form.checkout{
  display:grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  align-items:start;
}

body.woocommerce-checkout #content #order_review{
  position: sticky;
  top: 120px;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 16px;
  padding: 16px;
  background:#fff;
}

body.woocommerce-checkout #content .woocommerce > .woocommerce-notices-wrapper{
  margin-bottom: 16px;
}

/* Inputs (un poquito más pro) */
body.woocommerce-checkout #content .form-row input.input-text,
body.woocommerce-checkout #content .form-row textarea,
body.woocommerce-checkout #content .select2-container .select2-selection{
  min-height: 42px;
  padding: 10px 12px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(0,0,0,.16) !important;
  box-shadow: none !important;
}

/* Responsive cart/checkout */
@media (max-width: 980px){
  body.woocommerce-cart #content .woocommerce{
    grid-template-columns: 1fr;
  }
  body.woocommerce-cart #content .woocommerce .cart-collaterals{
    position: static;
    grid-column: 1;
  }
  body.woocommerce-checkout #content form.checkout{
    grid-template-columns: 1fr;
  }
  body.woocommerce-checkout #content #order_review{
    position: static;
  }
}

/* =========================================================
   CART (Woo Blocks) — Botón "Finalizar compra" PRO
   (para el markup: a.wc-block-cart__submit-button)
========================================================= */

body.woocommerce-cart a.wc-block-cart__submit-button,
body.woocommerce-cart .wc-block-cart__submit-button{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;

  width:100% !important;
  min-height:54px !important;

  background: var(--st-orange) !important;
  color:#fff !important;

  border:0 !important;
  border-radius:14px !important;

  font-weight:800 !important;
  letter-spacing:.05em !important;
  text-transform:none !important;

  text-decoration:none !important;
  box-shadow:none !important;

  padding:14px 18px !important;
  margin-top:16px !important;

  cursor:pointer !important;
  transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}

body.woocommerce-cart .wc-block-cart__submit-button .wc-block-components-button__text{
  color:#fff !important;
  text-decoration:none !important;
}

@media (hover:hover){
  body.woocommerce-cart a.wc-block-cart__submit-button:hover{
    transform: translateY(-1px);
    filter: brightness(1.03);
  }
}

body.woocommerce-cart a.wc-block-cart__submit-button:active{
  transform: translateY(0);
  filter:none;
  opacity:.95;
}

body.woocommerce-cart a.wc-block-cart__submit-button *{
  text-decoration:none !important;
}

/* =========================================================
   CART — CTA "Finalizar compra" como botón (ULTRA BLINDADO)
   SOLO en /cart
========================================================= */

/* 1) En el carrito, NUNCA subrayar links del bloque de totales */
body.woocommerce-cart .cart-collaterals a,
body.woocommerce-cart .cart_totals a{
  text-decoration: none !important;
}

/* 2) Cualquier link tipo CTA en el área de totales => botón naranja */
body.woocommerce-cart .cart-collaterals a.checkout-button,
body.woocommerce-cart .cart-collaterals a.wc-forward,
body.woocommerce-cart .cart_totals a.checkout-button,
body.woocommerce-cart .cart_totals a.wc-forward,
body.woocommerce-cart .wc-proceed-to-checkout a,
body.woocommerce-cart .woocommerce-proceed-to-checkout a,
body.woocommerce-cart .cart-collaterals a[href*="checkout"],
body.woocommerce-cart .cart_totals a[href*="checkout"]{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;

  width:100% !important;
  min-height:54px !important;

  background: var(--st-orange) !important;
  color:#fff !important;

  border:0 !important;
  border-radius:14px !important;

  font-weight:800 !important;
  letter-spacing:.05em !important;

  text-decoration:none !important;
  padding:14px 18px !important;
  margin-top:16px !important;

  transition: transform .15s ease, filter .15s ease;
}

/* Hover */
body.woocommerce-cart .cart-collaterals a[href*="checkout"]:hover,
body.woocommerce-cart .cart_totals a[href*="checkout"]:hover{
  transform: translateY(-1px);
  filter: brightness(1.03);
}

/* 3) Por si el theme lo pinta como .button */
body.woocommerce-cart .cart-collaterals a.button[href*="checkout"],
body.woocommerce-cart .cart_totals a.button[href*="checkout"]{
  background: var(--st-orange) !important;
  color:#fff !important;
  border:0 !important;
}

/* =========================================
   WhatsApp flotante (bottom-right)
   Cute + limpio + ecommerce ready
========================================= */

.st-wa-float{
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: auto;

  width: 50px;
  height: 50px;
  border-radius: 999px;

  background: #25D366;
  display: grid;
  place-items: center;

  box-shadow: 0 10px 28px rgba(0,0,0,.18);
  z-index: 99999;

  text-decoration: none !important;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

/* Ícono blanco */
.st-wa-float svg{
  width: 30px;
  height: 30px;
  fill: #fff;
}

/* Hover suave (solo en desktop) */
@media (hover:hover){
  .st-wa-float:hover{
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(0,0,0,.22);
    filter: brightness(1.04);
  }
}

/* Click feedback */
.st-wa-float:active{
  transform: translateY(0);
  filter: brightness(.98);
}

/* Safe area iPhone */
@supports (padding: max(0px)){
  .st-wa-float{
    bottom: max(20px, env(safe-area-inset-bottom));
    right: max(20px, env(safe-area-inset-right));
  }
}

/* Micro pulse MUY sutil (opcional, pero cute) */
@keyframes st-wa-pulse{
  0%   { box-shadow: 0 0 0 0 rgba(37,211,102,.35); }
  70%  { box-shadow: 0 0 0 10px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

.st-wa-float{
  animation: st-wa-pulse 2.8s infinite;
}