/* ==========================================================================
   T-Conecta · WooCommerce
   Tienda (grilla), ficha de producto, carrito, checkout y mi cuenta.
   Cubre la versión clásica (shortcodes) y la de bloques (Cart/Checkout).
   ========================================================================== */

/* Migas, títulos y barra de orden ----------------------------------------- */
body.tc-wp .woocommerce-breadcrumb,
body.tc-wp .ast-breadcrumbs-wrapper,
body.tc-wp .woocommerce-breadcrumb a { color: var(--tc-text-dim); font-size: 13px; }
body.tc-wp .woocommerce-breadcrumb a:hover { color: var(--tc-cyan); }

body.tc-wp .woocommerce-products-header__title,
body.tc-wp.woocommerce-page .entry-title,
body.tc-wp .woocommerce-page-title {
  font-size: clamp(36px, 5vw, 64px);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}
body.tc-wp .term-description, body.tc-wp .page-description { color: var(--tc-text-slate); max-width: 72ch; }

body.tc-wp .woocommerce-result-count { color: var(--tc-text-dim); font-size: 13px; }
body.tc-wp .woocommerce-ordering select { min-height: 40px; font-size: 13px; }

/* Grilla de productos (estilo "Destacados" del Home) --------------------- */
body.tc-wp ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 16px;
  margin: 24px 0 0;
}
body.tc-wp ul.products::before, body.tc-wp ul.products::after { display: none !important; }
body.tc-wp ul.products li.product {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: var(--tc-surface-3);
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-sm);
  text-align: left;
  transition: border-color .2s ease, transform .2s ease;
}
body.tc-wp ul.products li.product:hover { border-color: var(--tc-cyan-600); transform: translateY(-2px); }

body.tc-wp ul.products li.product img,
body.tc-wp ul.products li.product .astra-shop-thumbnail-wrap img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--tc-radius-xs);
  margin: 0 0 12px;
  background: var(--tc-surface-2);
}
body.tc-wp ul.products li.product .ast-woo-product-category,
body.tc-wp ul.products li.product .ast-woo-shop-product-description { color: var(--tc-text-dim); font-size: 11px; letter-spacing: .5px; text-transform: uppercase; }

body.tc-wp ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--tc-font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--tc-text-2);
  margin: 4px 0 6px;
  padding: 0;
}
body.tc-wp ul.products li.product a:hover .woocommerce-loop-product__title { color: var(--tc-cyan); }

body.tc-wp ul.products li.product .price,
body.tc-wp .price {
  font-family: var(--tc-font-display);
  font-size: 24px;
  letter-spacing: 1px;
  line-height: 1;
  color: var(--tc-cyan);
  font-weight: 400;
}
body.tc-wp .price del { color: var(--tc-text-dim); font-size: .7em; opacity: 1; margin-right: 6px; }
body.tc-wp .price ins { text-decoration: none; color: var(--tc-cyan); }

body.tc-wp ul.products li.product .button,
body.tc-wp ul.products li.product .added_to_cart {
  margin-top: auto;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.tc-wp ul.products li.product .price + .button,
body.tc-wp ul.products li.product .astra-shop-summary-wrap { display: flex; flex-direction: column; flex: 1; gap: 6px; }
body.tc-wp ul.products li.product .astra-shop-summary-wrap .button { margin-top: auto; }
body.tc-wp ul.products li.product .added_to_cart {
  background: transparent; color: var(--tc-cyan); font-family: var(--tc-font-display); letter-spacing: 1px; text-transform: uppercase;
}

/* Etiqueta de oferta */
body.tc-wp span.onsale,
body.tc-wp .ast-onsale-card {
  background: var(--tc-hot);
  color: var(--tc-text);
  border-radius: var(--tc-radius-sm);
  min-height: 0; min-width: 0;
  padding: 4px 8px;
  line-height: 1;
  font-family: var(--tc-font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  top: 24px; left: 24px; right: auto;
}

/* Estrellas */
body.tc-wp .star-rating, body.tc-wp .star-rating::before { color: var(--tc-cyan); }

/* Paginación */
body.tc-wp .woocommerce-pagination ul.page-numbers { border: 0; display: flex; gap: 6px; justify-content: center; }
body.tc-wp .woocommerce-pagination ul li { border: 0; }
body.tc-wp .woocommerce-pagination ul li a,
body.tc-wp .woocommerce-pagination ul li span {
  min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--tc-border); border-radius: var(--tc-radius-sm);
  background: var(--tc-surface-2); color: var(--tc-text-muted);
}
body.tc-wp .woocommerce-pagination ul li span.current,
body.tc-wp .woocommerce-pagination ul li a:hover { background: var(--tc-cyan); color: var(--tc-ink); border-color: var(--tc-cyan); }

/* Ficha de producto ------------------------------------------------------- */
body.tc-wp div.product .product_title {
  font-size: clamp(32px, 4vw, 52px);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
body.tc-wp div.product p.price, body.tc-wp div.product span.price { font-size: clamp(28px, 3vw, 36px); }
body.tc-wp div.product .woocommerce-product-details__short-description { color: var(--tc-text-muted); line-height: 1.6; }
body.tc-wp div.product .woocommerce-product-gallery__wrapper,
body.tc-wp div.product .woocommerce-product-gallery .flex-viewport {
  background: var(--tc-surface-2); border: 1px solid var(--tc-border); border-radius: var(--tc-radius-md); overflow: hidden;
}
body.tc-wp div.product .flex-control-thumbs li img { border-radius: var(--tc-radius-xs); opacity: .6; }
body.tc-wp div.product .flex-control-thumbs li img.flex-active,
body.tc-wp div.product .flex-control-thumbs li img:hover { opacity: 1; }

body.tc-wp div.product form.cart { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
body.tc-wp div.product form.cart .single_add_to_cart_button { flex: 1 1 220px; box-shadow: var(--tc-glow-cyan); color: var(--tc-cyan-ink); }

body.tc-wp .quantity .qty {
  min-height: 47px; width: 80px; text-align: center;
  background: var(--tc-surface-0); color: var(--tc-text); border: 1px solid var(--tc-border); border-radius: var(--tc-radius-sm);
}
body.tc-wp .ast-qty-placeholder, body.tc-wp .quantity .minus, body.tc-wp .quantity .plus {
  background: var(--tc-surface-2); color: var(--tc-text); border-color: var(--tc-border);
}

body.tc-wp div.product .product_meta { color: var(--tc-text-dim); font-size: 13px; border-top: 1px solid var(--tc-border-soft); padding-top: 16px; }
body.tc-wp div.product .product_meta a { color: var(--tc-text-muted); }
body.tc-wp .stock.in-stock { color: var(--tc-cyan); }
body.tc-wp .stock.out-of-stock { color: var(--tc-hot); }

/* Pestañas */
body.tc-wp .woocommerce-tabs ul.tabs { border-bottom: 1px solid var(--tc-border); padding: 0; margin-bottom: 24px; }
body.tc-wp .woocommerce-tabs ul.tabs::before { display: none; }
body.tc-wp .woocommerce-tabs ul.tabs li { background: transparent; border: 0; margin: 0 24px 0 0; padding: 0; }
body.tc-wp .woocommerce-tabs ul.tabs li::before, body.tc-wp .woocommerce-tabs ul.tabs li::after { display: none; }
body.tc-wp .woocommerce-tabs ul.tabs li a {
  font-family: var(--tc-font-display); font-size: 18px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--tc-text-dim); padding: 12px 0; display: inline-block; border-bottom: 2px solid transparent;
}
body.tc-wp .woocommerce-tabs ul.tabs li.active a { color: var(--tc-cyan); border-bottom-color: var(--tc-cyan); }
body.tc-wp .woocommerce-tabs .panel { color: var(--tc-text-muted); line-height: 1.7; }
body.tc-wp .woocommerce-tabs .panel h2 { font-size: 28px; }
body.tc-wp table.shop_attributes, body.tc-wp table.shop_attributes th, body.tc-wp table.shop_attributes td {
  border-color: var(--tc-border-soft); background: transparent; color: var(--tc-text-muted);
}

body.tc-wp .related > h2, body.tc-wp .upsells > h2, body.tc-wp .cross-sells > h2 {
  font-size: clamp(28px, 3.5vw, 44px); text-transform: uppercase; letter-spacing: 1.5px;
}

/* Avisos ------------------------------------------------------------------- */
body.tc-wp .woocommerce-message,
body.tc-wp .woocommerce-info,
body.tc-wp .woocommerce-error,
body.tc-wp .wc-block-components-notice-banner {
  background: var(--tc-surface-1);
  color: var(--tc-text-2);
  border: 1px solid var(--tc-border);
  border-left: 3px solid var(--tc-cyan);
  border-radius: var(--tc-radius-sm);
}
body.tc-wp .woocommerce-error, body.tc-wp .wc-block-components-notice-banner.is-error { border-left-color: var(--tc-hot); }
body.tc-wp .woocommerce-message::before, body.tc-wp .woocommerce-info::before { color: var(--tc-cyan); }
body.tc-wp .woocommerce-message .button { min-height: 36px; padding: 8px 14px; font-size: 14px; }

/* Carrito y checkout (clásico) ------------------------------------------- */
body.tc-wp table.shop_table {
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-md);
  background: var(--tc-surface-2);
  color: var(--tc-text-muted);
  border-collapse: separate;
  overflow: hidden;
}
body.tc-wp table.shop_table th { color: var(--tc-text); font-weight: 600; background: var(--tc-surface-1); }
body.tc-wp table.shop_table th, body.tc-wp table.shop_table td { border-color: var(--tc-border-soft); }
body.tc-wp table.shop_table img { border-radius: var(--tc-radius-xs); }
body.tc-wp table.shop_table a.remove { color: var(--tc-hot) !important; }
body.tc-wp table.shop_table a.remove:hover { background: var(--tc-hot); color: var(--tc-text) !important; }

body.tc-wp .cart-collaterals .cart_totals,
body.tc-wp #order_review,
body.tc-wp .woocommerce-checkout-review-order,
body.tc-wp form.checkout_coupon,
body.tc-wp form.login, body.tc-wp form.register {
  background: var(--tc-surface-2);
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-md);
  padding: clamp(16px, 2.5vw, 28px);
}
body.tc-wp .cart_totals h2, body.tc-wp #order_review_heading, body.tc-wp .woocommerce-billing-fields h3,
body.tc-wp .woocommerce-shipping-fields h3, body.tc-wp .woocommerce-additional-fields h3 {
  font-family: var(--tc-font-display); font-size: 28px; letter-spacing: 1px; text-transform: uppercase; color: var(--tc-text);
}
body.tc-wp .order-total .amount, body.tc-wp .cart_totals .order-total .amount { color: var(--tc-cyan); font-family: var(--tc-font-display); font-size: 26px; letter-spacing: 1px; }
body.tc-wp .wc-proceed-to-checkout .checkout-button,
body.tc-wp #place_order { width: 100%; font-size: 18px; letter-spacing: 2px; box-shadow: var(--tc-glow-cyan); color: var(--tc-cyan-ink); }

body.tc-wp #payment, body.tc-wp .woocommerce-checkout #payment { background: var(--tc-surface-1); border-radius: var(--tc-radius-md); }
body.tc-wp #payment ul.payment_methods { border-color: var(--tc-border-soft); }
body.tc-wp #payment div.payment_box { background: var(--tc-surface-3); color: var(--tc-text-muted); }
body.tc-wp #payment div.payment_box::before { border-bottom-color: var(--tc-surface-3); }
body.tc-wp .select2-container--default .select2-selection--single {
  background: var(--tc-surface-0); border: 1px solid var(--tc-border); border-radius: var(--tc-radius-sm); min-height: 44px;
}
body.tc-wp .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--tc-text); line-height: 42px; }
body.tc-wp .select2-dropdown { background: var(--tc-surface-1); border-color: var(--tc-border); color: var(--tc-text); }
body.tc-wp .select2-results__option--highlighted { background: var(--tc-cyan) !important; color: var(--tc-ink) !important; }

/* Carrito y checkout (bloques) ------------------------------------------- */
body.tc-wp .wc-block-cart, body.tc-wp .wc-block-checkout { color: var(--tc-text-muted); }
body.tc-wp .wc-block-components-sidebar .wc-block-components-panel,
body.tc-wp .wc-block-components-sidebar,
body.tc-wp .wp-block-woocommerce-checkout-order-summary-block {
  background: var(--tc-surface-2); border-color: var(--tc-border) !important; border-radius: var(--tc-radius-md);
}
body.tc-wp .wc-block-components-title, body.tc-wp .wc-block-components-checkout-step__title,
body.tc-wp .wc-block-cart__totals-title {
  font-family: var(--tc-font-display) !important; font-size: 24px !important; letter-spacing: 1px; text-transform: uppercase; color: var(--tc-text);
}
body.tc-wp .wc-block-components-text-input input,
body.tc-wp .wc-block-components-combobox .wc-block-components-combobox-control input,
body.tc-wp .wc-blocks-components-select .wc-blocks-components-select__select,
body.tc-wp .wc-block-components-textarea {
  background: var(--tc-surface-0) !important; border-color: var(--tc-border) !important; color: var(--tc-text) !important; border-radius: var(--tc-radius-sm) !important;
}
body.tc-wp .wc-block-components-text-input label,
body.tc-wp .wc-blocks-components-select__label { color: var(--tc-text-dim) !important; }
body.tc-wp .wc-block-components-button:not(.is-link),
body.tc-wp .wc-block-cart__submit-button,
body.tc-wp .wc-block-components-checkout-place-order-button {
  background: var(--tc-cyan) !important; color: var(--tc-ink) !important; border-radius: var(--tc-radius-btn) !important;
  font-family: var(--tc-font-display); font-size: 18px; letter-spacing: 2px; text-transform: uppercase; min-height: 52px;
}
body.tc-wp .wc-block-components-button:not(.is-link):hover { background: var(--tc-cyan-600) !important; }
body.tc-wp .wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
body.tc-wp .wc-block-components-product-price { color: var(--tc-cyan); }
body.tc-wp .wc-block-components-radio-control__option,
body.tc-wp .wc-block-components-radio-control-accordion-option { border-color: var(--tc-border) !important; }
body.tc-wp .wc-block-components-radio-control__input,
body.tc-wp .wc-block-components-checkbox__input { background: var(--tc-surface-0) !important; border-color: var(--tc-border) !important; }
body.tc-wp .wc-block-components-radio-control__input:checked::before { background: var(--tc-cyan) !important; }
body.tc-wp .wc-block-components-checkbox__mark { fill: var(--tc-cyan); }
body.tc-wp .wc-block-components-quantity-selector { border-color: var(--tc-border) !important; background: var(--tc-surface-0); }
body.tc-wp .wc-block-components-quantity-selector input { color: var(--tc-text) !important; background: transparent !important; }
body.tc-wp .wc-block-components-quantity-selector button { color: var(--tc-text) !important; }

/* Mi cuenta ----------------------------------------------------------------- */
body.tc-wp .woocommerce-MyAccount-navigation ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--tc-border); border-radius: var(--tc-radius-md); overflow: hidden; }
body.tc-wp .woocommerce-MyAccount-navigation ul li { border-bottom: 1px solid var(--tc-border-soft); margin: 0; }
body.tc-wp .woocommerce-MyAccount-navigation ul li:last-child { border-bottom: 0; }
body.tc-wp .woocommerce-MyAccount-navigation ul li a { display: block; padding: 12px 16px; color: var(--tc-text-muted); background: var(--tc-surface-2); }
body.tc-wp .woocommerce-MyAccount-navigation ul li.is-active a,
body.tc-wp .woocommerce-MyAccount-navigation ul li a:hover { color: var(--tc-ink); background: var(--tc-cyan); }

/* Mini carrito / enlaces de Astra en el header (por si algún plugin los inserta) */
body.tc-wp .ast-site-header-cart { display: none; }

/* Ajustes de caja y enlaces */
body.tc-wp ul.products li.product *,
body.tc-wp div.product form.cart * { box-sizing: border-box; }
body.tc-wp .woocommerce-breadcrumb a,
body.tc-wp div.product .product_meta a,
body.tc-wp ul.products li.product a { text-decoration: none; }
body.tc-wp .woocommerce-tabs ul.tabs { display: flex; flex-wrap: wrap; gap: 0 24px; list-style: none; }
body.tc-wp .woocommerce-tabs ul.tabs li { margin: 0; }

/* Móvil: dos productos por fila */
@media (max-width: 600px) {
  body.tc-wp ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.tc-wp ul.products li.product { padding: 10px; }
  body.tc-wp ul.products li.product .woocommerce-loop-product__title { font-size: 13px; }
  body.tc-wp ul.products li.product .price { font-size: 20px; }
  body.tc-wp ul.products li.product .button,
  body.tc-wp ul.products li.product .added_to_cart { font-size: 14px; min-height: 40px; padding: 8px; letter-spacing: .5px; text-align: center; line-height: 1.1; }
  body.tc-wp span.onsale { top: 14px; left: 14px; }
}

/* Una sola etiqueta de oferta: se oculta la de Astra ("Sale!") y se deja la de
   WooCommerce ("Oferta"), ubicada sobre la foto, arriba a la izquierda. */
body.tc-wp .ast-onsale-card,
body.tc-wp .ast-on-card-button .ast-onsale-card { display: none !important; }

body.tc-wp ul.products li.product .onsale,
body.tc-wp.woocommerce ul.products li.product .onsale,
body.tc-wp div.product > span.onsale,
body.tc-wp div.product .woocommerce-product-gallery > span.onsale,
body.tc-wp div.product span.onsale {
  position: absolute !important;
  top: 26px !important; left: 26px !important; right: auto !important; bottom: auto !important;
  margin: 0 !important; transform: none !important;
  width: auto !important; height: auto !important; min-width: 0 !important; min-height: 0 !important;
  padding: 5px 9px !important; border-radius: var(--tc-radius-sm) !important;
  background: var(--tc-hot) !important; color: var(--tc-text) !important;
  font: 700 11px/1 var(--tc-font-body) !important; letter-spacing: .5px; text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35); z-index: 3;
}
body.tc-wp div.product span.onsale { top: 14px !important; left: 14px !important; }
body.tc-wp div.product { position: relative; }
@media (max-width: 600px) {
  body.tc-wp ul.products li.product .onsale { top: 16px !important; left: 16px !important; }
}

/* "Avísame cuando llegue" (productos agotados, functions.php §8) ---------- */
body.tc-wp .tc-aviso {
  display: flex; flex-direction: column; gap: 10px;
  margin: 20px 0 8px; padding: 20px;
  background: var(--tc-surface-1); border: 1px solid var(--tc-border); border-radius: var(--tc-radius-sm);
}
body.tc-wp .tc-aviso[hidden] { display: none; }
body.tc-wp .tc-aviso-titulo { margin: 0; font-family: var(--tc-font-display); font-size: 26px; letter-spacing: 1px; color: var(--tc-text); line-height: 1; }
body.tc-wp .tc-aviso-texto { margin: 0; color: var(--tc-text-muted); font-size: 14px; line-height: 1.5; }
body.tc-wp .tc-aviso-fila { display: flex; flex-wrap: wrap; gap: 8px; }
body.tc-wp .tc-aviso-fila input[type=email] { flex: 1 1 220px; min-height: 48px; margin: 0; }
body.tc-wp .tc-aviso-fila .button { min-height: 48px; padding: 0 24px; margin: 0; }
body.tc-wp .tc-aviso-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--tc-text-muted); cursor: pointer; }
body.tc-wp .tc-aviso-check input { width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--tc-cyan); }
body.tc-wp .tc-aviso-check a { color: var(--tc-cyan); text-decoration: underline; }
body.tc-wp .tc-aviso-trampa { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
body.tc-wp .tc-aviso-msg { margin: 0; font-size: 14px; min-height: 0; }
body.tc-wp .tc-aviso-msg.ok { color: var(--tc-cyan); }
body.tc-wp .tc-aviso-msg.error { color: var(--tc-hot); }
