
/* BOTON AÑADIR AL CARRITO*/

body ul.products li.product a.button.add_to_cart_button {
  background-color: #f0f0f0 !important;
  color: #000 !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  line-height: 1 !important;            /* sin altura extra */
  padding: 0.25rem 0.5rem !important;   /* poco aire alrededor */
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 0;
  margin: 0;
  height: auto !important;           /* por si algún tema fuerza height */
  min-height: unset !important;      /* WooCommerce a veces lo hace */
  box-sizing: border-box;
  display: inline-block;
}

body ul.products li.product .ct-woo-card-actions {
  width: 100%;
  padding-left: 0;
  padding-right: 0;
  margin: 0;
  display: block;
  box-sizing: border-box;
}
body ul.products li.product .woocommerce-loop-product__title {
  margin-bottom: 0.5rem; /* o incluso 0.25rem para más compacidad */
}

body ul.products li.product .price {
  margin-top: 0.25rem; /* reduce el aire encima del precio */
}





/* FONDOS EN EL GRID DE PRODUCTOS SELECCIONADOS*/

/* Salud & Bienestar – Salmón claro */
body ul.wc-block-product-template li.product_cat-salud-bienestar {
  background-color: #FDE1CD;
}

/* Ganancia Muscular – Azul claro */
body ul.wc-block-product-template li.product_cat-ganancia-muscular {
  background-color: #CDE8ED;
}

/* Control de Peso – Amarillo claro */
body ul.wc-block-product-template li.product_cat-control-de-peso {
  background-color: #FFF9C5;
}

/* Rendimiento Deportivo – Verde claro */
body ul.wc-block-product-template li.product_cat-rendimiento-deportivo {
  background-color: #CDE8C3;
}
body ul.wc-block-product-template li.product {
  padding: 1rem;
  border-radius: 0;
  box-sizing: border-box;
}



/* Estilo base del producto */
body ul.wc-block-product-template li.product {
  position: relative;
  overflow: hidden;
}

body ul.wc-block-product-template li.product {
  position: relative;
  overflow: hidden;
}

/* Capa oscura al hacer hover */
body ul.wc-block-product-template li.product::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

/* Contenido que aparece en hover */
body ul.wc-block-product-template li.product .product-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  text-align: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

body ul.wc-block-product-template li.product:hover::after,
body ul.wc-block-product-template li.product:hover .product-overlay {
  opacity: 1;
}

ul.wc-block-product-template li.product .product-overlay {
  transition: opacity 0.3s ease !important;
  z-index: 2 !important;
}



body ul.wc-block-product-template li.product .product-overlay {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  text-align: left;
  background: none; /* solo la capa oscura ::after hace de fondo */
  pointer-events: none; /* mantiene comportamiento puro de hover */
}

body ul.wc-block-product-template li.product .product-overlay .product-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #fff;
  pointer-events: auto;
}

body ul.wc-block-product-template li.product .product-overlay .button {
  background-color: #fff;
  color: #000;
  padding: 0.3rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  border-radius: 0;
  width: 100%;
  text-align: left;
  margin: 0;
  pointer-events: auto;
}


.ctm-category-card.flip-card {
  aspect-ratio: 9 / 5; /* o el ratio que mejor encaje */
  height: auto;
}
.flip-card-inner {
  height: 100%;
}





/* CORREGIR EL CUADRO FANTASMA BAJO LAS TARJETAS */

/* Asegurar que el espacio fantasma desaparece */
.flip-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  box-shadow: none !important;
}

/* Asegurar que .flip-card-inner no causa sombra adicional */
.flip-card-inner {
  height: auto !important;
  min-height: 0 !important;
  box-shadow: none !important;
}

/* Forzar que el contenido interno determine la altura */
.flip-card-front,
.flip-card-back {
  height: auto !important;
  min-height: 0 !important;
}
.flip-card {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-base, 8px);
  transition: box-shadow 0.3s ease;
}

.flip-card:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}




/* ______________ MEDIA QUERYS CONSEJOS DE LOS EXPERTOS_________*/
@media (max-width: 767px) {
  .ctm-expert-tips {
    display: none;
  }

  .ctm-toggle-tips-button {
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.75rem 1.25rem;
    font-weight: bold;
    font-size: 1rem;
    color: #fff;
    background-color: #333;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }
}

/* ______________ MEDIA QUERYS CONSEJOS DE LOS EXPERTOS_________*/
@media (max-width: 767px) {
  .ctm-expert-tips {
    display: none;
  }

  .ctm-toggle-tips-button {
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.75rem 1.25rem;
    font-weight: bold;
    font-size: 1rem;
    color: #000;
    background-color: #f0f0f0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }
}
.ctm-expert-tip + .ctm-expert-tip {
  margin-top: 1rem; /* ajusta a tu gusto */
}


@media (max-width: 767px) {
  body.term-rendimiento-deportivo .ctm-toggle-tips-button {
    background-color: #CDE8C3;
  }

  body.term-ganancia-muscular .ctm-toggle-tips-button {
    background-color: #CDE8ED;
  }

  body.term-control-de-peso .ctm-toggle-tips-button {
    background-color: #FFF9C5;
  }

  body.term-salud-bienestar .ctm-toggle-tips-button {
    background-color: #FDE1CD;
  }
}

/* DESACTIVAR ANIMACION TARJETAS EN MOVIL */
@media (max-width: 767px) {
  .flip-card-inner {
    transform: none !important;
    transition: none !important;
  }

  .flip-card:hover .flip-card-inner {
    transform: none !important;
  }

  .flip-card-front,
  .flip-card-back {
    backface-visibility: visible;
    position: static !important;
    transform: none !important;
    box-shadow: none !important;
  }

  .flip-card-back {
    display: none !important;
  }

  .flip-card-front {
    display: block !important;
  }
}



/* Quitar borde y fondo gris al botón “Descubrir” */
.flip-card-button {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;        /* Opcional: elimina el relleno si sobrase */
  color: inherit !important;    /* Hereda el color del texto padre */
  cursor: pointer;
}

/* En styles/_components.css, bajo la sección .ctm-card-title */
.ctm-card-title {
  white-space: nowrap;         /* impide el salto */
  overflow: hidden;            /* oculta el desbordamiento */
  text-overflow: ellipsis;     /* añade "…" si no cabe */
}




/* Igualar altura de los Expert Tips */
.ctm-expert-tips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  /* fuerza que cada fila sea tan alta como la más alta */
  grid-auto-rows: 1fr;
}

.ctm-expert-tip {
  /* para que el contenido distribuya bien el espacio */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* opcional: asegura que ocupen todo el alto de la fila */
  height: 100%;
}


/* 1) Asegurar que el grid de tips los alinee siempre por su parte superior y quede todo en la misma “línea de partida” */
.ctm-expert-tips {
  display: grid;  
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  grid-auto-rows: 1fr;     /* igual altura */
  align-items: start;      /* arranca todos al top */
  align-content: start;    /* si hubiera espacio sobrante arriba, no lo centre */
}

/* 2) Resetear por completo cualquier margin/padding extra dentro de cada tip */
.ctm-expert-tip {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: start;
  box-sizing: border-box;
  padding: 1rem;       /* o el padding que quieras uniformemente */
  margin: 0 !important;/* elimina márgenes externos */
  height: 100%;
}

/* 3) Asegurar que los títulos y párrafos no metan margen superior */
.ctm-expert-tip h4,
.ctm-expert-tip p {
  margin-top: 0 !important;
  margin-bottom: .75rem !important;
}

/* 4) Pequeño espaciado entre el título y el texto, ajustar sólo margin-bottom */
.ctm-expert-tip h4 {
  margin-bottom: .5rem !important;
}

/* 5) Eliminar el margin-bottom del último párrafo  */
.ctm-expert-tip p:last-child {
  margin-bottom: 0 !important;
}





/* Fuerza que el sticky no use transform ni animaciones */
body.post-type-archive-product #header [data-sticky],
body.tax-product_cat      #header [data-sticky] {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  transform: none !important;
  transition: none !important;
  will-change: auto !important;
  z-index: 9999 !important;
}

/* Quita cualquier padding-top estático que habíamos puesto */
body.post-type-archive-product .site-main,
body.tax-product_cat      .site-main {
  padding-top: 0 !important;
}




/* Exagerar el zoom on-hover de la miniatura */
.woocommerce ul.products li.product img {
  /* Asegura un smooth transition más marcado */
  transition: transform 0.35s ease-in-out !important;
}

.woocommerce ul.products li.product:hover img {
  /* Eleva el zoom desde 1.05 a 1.15 (o el valor que prefieras) */
  transform: scale(1.25) !important;
}


/*09-09-2025
/* --- FIX: que las tarjetas y el paginador de BUSQUEDA sean clicables --- */
body.search-results .entries .entry-card.card-content { position: relative; }
body.search-results .entries .entry-card.card-content::before {
  pointer-events: none !important; /* la capa deja de comerse los clics */
  z-index: 0 !important;           /* aseguramos que queda detrás */
}

/* el contenido por encima, por si acaso */
body.search-results .entries .entry-card.card-content > * {
  position: relative;
  z-index: 1;
}

/* paginador por encima de cualquier overlay que “se estire” de arriba */
body.search-results nav.ct-pagination {
  position: relative;
  z-index: 10;
}
