/**
Theme Name: Mantis Astra Theme
Author: Daniel Limón
Author URI: https://dlimon.net
Description: Tema child de Astra adaptado a la medida para Mantis América.
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mantis-astra-theme
Template: astra
*/

/**
 * ============================================================================
 * ESTILOS CUSTOM PARA CATÁLOGO DE PRODUCTOS - MANTIS
 * ============================================================================
 * Estos estilos reemplazan el diseño por defecto de WooCommerce
 * con un layout moderno usando CSS Grid y componentes tipo card
 */

/* ============================================================================
   VARIABLES CSS (Custom Properties)
   Acá definimos los colores y valores que vamos a reutilizar en todo el CSS
   Cambialos según tu paleta de colores
   ============================================================================ */
:root {
  /* Colores principales */
  --mantis-primary: #ff8800;
  --mantis-primary-dark: #d37203;
  --mantis-primary-light: #ffa640;
  
  /* Colores secundarios */
  --mantis-secondary: #1a0080;
  --mantis-secondary-dark: #2f00ea;
  --mantis-secondary-light: #1a0080;
  
  /* Colores de fondo */
  --mantis-bg-light: #ffffff;
  --mantis-bg-gray: #f8fafc;
  --mantis-bg-dark: #1e293b;
  
  /* Colores de texto */
  --mantis-text-primary: #0f172a;
  --mantis-text-secondary: #64748b;
  --mantis-text-light: #94a3b8;
  
  /* Colores de estado */
  --mantis-success: #10b981;
  --mantis-warning: #f59e0b;
  --mantis-danger: #ef4444;
  
  /* Espaciados */
  --mantis-spacing-xs: 0.5rem;
  --mantis-spacing-sm: 1rem;
  --mantis-spacing-md: 1.5rem;
  --mantis-spacing-lg: 2rem;
  --mantis-spacing-xl: 3rem;
  
  /* Sombras */
  --mantis-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --mantis-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --mantis-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --mantis-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Bordes */
  --mantis-radius-sm: 0.375rem;
  --mantis-radius-md: 0.5rem;
  --mantis-radius-lg: 0.75rem;
  
  /* Transiciones */
  --mantis-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   CONTENEDOR PRINCIPAL DEL SHOP
   ============================================================================ */
.mantis-shop-wrapper {
  width: 100%;
  max-width: 1400px; /* Ancho máximo del contenedor */
  margin: 0 auto;
  padding: var(--mantis-spacing-md);
}

/* ============================================================================
   SECCIÓN HERO (Banner superior)
   Solo se muestra en la página principal de la tienda
   ============================================================================ */
.mantis-shop-hero {
  background: linear-gradient(135deg, var(--mantis-primary) 0%, var(--mantis-primary-dark) 100%);
  border-radius: var(--mantis-radius-lg);
  padding: var(--mantis-spacing-xl);
  margin-bottom: var(--mantis-spacing-xl);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Efecto de fondo opcional con patrón */
.mantis-shop-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.mantis-shop-hero__content {
  position: relative;
  z-index: 1;
}

.mantis-shop-hero__title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 var(--mantis-spacing-sm) 0;
  line-height: 1.2;
}

.mantis-shop-hero__description {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================================================
   CONTROLES DEL CATÁLOGO (contador de resultados y ordenamiento)
   ============================================================================ */
.mantis-shop-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--mantis-spacing-lg);
  padding: var(--mantis-spacing-sm);
  background: var(--mantis-bg-gray);
  border-radius: var(--mantis-radius-md);
  flex-wrap: wrap;
  gap: var(--mantis-spacing-sm);
}

/* Estilos para el selector de ordenamiento de WooCommerce */
.mantis-shop-controls .woocommerce-ordering select {
  padding: 0.5rem 2rem 0.5rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--mantis-radius-sm);
  background-color: white;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--mantis-transition);
}

.mantis-shop-controls .woocommerce-ordering select:hover {
  border-color: var(--mantis-primary);
}

/* ============================================================================
   GRID DE PRODUCTOS
   Acá está la magia del layout responsive automático
   ============================================================================ */
.mantis-products-grid {
  display: grid;
  /* 
    Esta línea hace toda la magia del responsive:
    - repeat(auto-fill, ...) crea tantas columnas como quepan
    - minmax(280px, 1fr) dice que cada columna mínimo 280px, máximo lo que sobre del espacio
    - Resultado: se adapta solo sin media queries complejos
  */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--mantis-spacing-lg);
  margin-bottom: var(--mantis-spacing-xl);
}

/* ============================================================================
   CARD DE PRODUCTO INDIVIDUAL
   Esta es la estructura de cada producto en el catálogo
   ============================================================================ */
.mantis-product-card {
  background: var(--mantis-bg-light);
  border-radius: var(--mantis-radius-lg);
  overflow: hidden;
  box-shadow: var(--mantis-shadow-sm);
  transition: var(--mantis-transition);
  display: flex;
  flex-direction: column;
  height: 100%; /* Para que todas las cards tengan la misma altura */
}

/* Efecto hover: la card se eleva un poco */
.mantis-product-card:hover {
  box-shadow: var(--mantis-shadow-xl);
  transform: translateY(-4px);
}

/* ----------------------------------------------------------------------------
   CONTENEDOR DE IMAGEN
   ---------------------------------------------------------------------------- */
.mantis-product-card__image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%; /* Esto crea un aspect ratio cuadrado (1:1) */
  background: var(--mantis-bg-gray);
  overflow: hidden;
}

.mantis-product-card__image-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mantis-product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover; /* La imagen cubre todo el espacio sin deformarse */
  transition: var(--mantis-transition);
}

/* Efecto zoom en la imagen al hacer hover */
.mantis-product-card:hover .mantis-product-card__image {
  transform: scale(1.05);
}

/* ----------------------------------------------------------------------------
   BADGES (Oferta, Sin stock, etc.)
   ---------------------------------------------------------------------------- */
.mantis-product-card__sale-badge,
.mantis-product-card__out-of-stock {
  position: absolute;
  top: var(--mantis-spacing-sm);
  right: var(--mantis-spacing-sm);
  padding: 0.375rem 0.75rem;
  border-radius: var(--mantis-radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
  box-shadow: var(--mantis-shadow-md);
}

.mantis-product-card__sale-badge {
  background: var(--mantis-danger);
  color: white;
}

.mantis-product-card__out-of-stock {
  background: var(--mantis-text-secondary);
  color: white;
}

/* ----------------------------------------------------------------------------
   CONTENIDO DE LA CARD (título, precio, etc.)
   ---------------------------------------------------------------------------- */
.mantis-product-card__content {
  padding: var(--mantis-spacing-md);
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Ocupa el espacio disponible */
}

/* Categorías del producto */
.mantis-product-card__categories {
  font-size: 0.75rem;
  color: var(--mantis-primary);
  font-weight: 500;
  margin-bottom: var(--mantis-spacing-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mantis-product-card__categories a {
  color: inherit;
  text-decoration: none;
  transition: var(--mantis-transition);
}

.mantis-product-card__categories a:hover {
  color: var(--mantis-primary-dark);
}

/* Título del producto */
.mantis-product-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 var(--mantis-spacing-sm) 0;
  color: var(--mantis-text-primary);
}

.mantis-product-card__title a {
  color: inherit;
  text-decoration: none;
  transition: var(--mantis-transition);
}

.mantis-product-card__title a:hover {
  color: var(--mantis-primary);
}

/* Descripción corta (opcional) */
.mantis-product-card__excerpt {
  font-size: 0.875rem;
  color: var(--mantis-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--mantis-spacing-md);
  flex-grow: 1; /* Empuja el footer hacia abajo */
}

/* ----------------------------------------------------------------------------
   FOOTER DE LA CARD (precio y botón)
   ---------------------------------------------------------------------------- */
.mantis-product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--mantis-spacing-sm);
  padding-top: var(--mantis-spacing-md);
  border-top: 1px solid #e2e8f0;
  margin-top: auto; /* Se pega al fondo de la card */
}

/* Precio del producto */
.mantis-product-card__price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--mantis-primary);
}

/* Precio tachado cuando hay oferta */
.mantis-product-card__price del {
  font-size: 0.875rem;
  color: var(--mantis-text-light);
  font-weight: 400;
  margin-right: 0.5rem;
}

/* Precio de oferta */
.mantis-product-card__price ins {
  text-decoration: none;
  color: var(--mantis-danger);
}

/* ----------------------------------------------------------------------------
   BOTÓN DE AGREGAR AL CARRITO
   ---------------------------------------------------------------------------- */
.mantis-product-card__actions .button,
.mantis-product-card__actions .added_to_cart {
  background: var(--mantis-primary);
  color: white;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--mantis-radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--mantis-transition);
  text-decoration: none;
  display: inline-block;
}

.mantis-product-card__actions .button:hover,
.mantis-product-card__actions .added_to_cart:hover {
  background: var(--mantis-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--mantis-shadow-md);
}

/* Botón cuando el producto ya fue agregado */
.mantis-product-card__actions .added_to_cart {
  background: var(--mantis-success);
}

/* Botón de "loading" cuando se está agregando al carrito */
.mantis-product-card__actions .loading {
  opacity: 0.7;
  pointer-events: none;
}

/* ============================================================================
   FOOTER DEL SHOP (paginación)
   ============================================================================ */
.mantis-shop-footer {
  margin-top: var(--mantis-spacing-xl);
}

/* Estilos para la paginación de WooCommerce */
.mantis-shop-footer .woocommerce-pagination {
  text-align: center;
}

.mantis-shop-footer .woocommerce-pagination ul {
  display: inline-flex;
  gap: var(--mantis-spacing-xs);
  list-style: none;
  padding: 0;
  margin: 0;
}

.mantis-shop-footer .woocommerce-pagination li {
  display: inline-block;
}

.mantis-shop-footer .woocommerce-pagination a,
.mantis-shop-footer .woocommerce-pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--mantis-radius-sm);
  color: var(--mantis-text-primary);
  text-decoration: none;
  transition: var(--mantis-transition);
}

.mantis-shop-footer .woocommerce-pagination a:hover {
  background: var(--mantis-primary);
  color: white;
  border-color: var(--mantis-primary);
}

.mantis-shop-footer .woocommerce-pagination span.current {
  background: var(--mantis-primary);
  color: white;
  border-color: var(--mantis-primary);
}

/* ============================================================================
   RESPONSIVE: AJUSTES PARA TABLETS
   ============================================================================ */
@media (max-width: 768px) {
  /* El grid ya se adapta automáticamente, pero ajustamos algunos espaciados */
  .mantis-shop-wrapper {
    padding: var(--mantis-spacing-sm);
  }
  
  .mantis-shop-hero {
    padding: var(--mantis-spacing-lg);
  }
  
  .mantis-shop-hero__title {
    font-size: 2rem;
  }
  
  .mantis-products-grid {
    gap: var(--mantis-spacing-md);
  }
  
  .mantis-shop-controls {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============================================================================
   RESPONSIVE: AJUSTES PARA MÓVILES
   ============================================================================ */
@media (max-width: 480px) {
  .mantis-shop-hero__title {
    font-size: 1.5rem;
  }
  
  .mantis-shop-hero__description {
    font-size: 1rem;
  }
  
  /* En mobile, hacemos que el precio y botón se apilen verticalmente */
  .mantis-product-card__footer {
    flex-direction: column;
    align-items: stretch;
  }
  
  .mantis-product-card__actions .button {
    width: 100%;
    text-align: center;
  }
}

/* ============================================================================
   SECCIONES DE CATEGORÍAS (para el loop personalizado)
   ============================================================================ */
.mantis-category-section {
  margin-bottom: var(--mantis-spacing-xl);
  /* Agregamos más espacio entre secciones para que se distingan bien */
}

.mantis-category-section:last-child {
  margin-bottom: 0;
}

/* ============================================================================
   HERO DE CATEGORÍA INDIVIDUAL (para taxonomy-product_cat.php)
   Similar al hero de shop pero con soporte para imagen de fondo
   ============================================================================ */
.mantis-category-hero {
  position: relative;
  background: linear-gradient(135deg, #4c1d95 0%, #5b21b6 50%, #6d28d9 100%);
  border-radius: var(--mantis-radius-lg);
  padding: var(--mantis-spacing-xl);
  margin-bottom: var(--mantis-spacing-lg);
  color: white;
  overflow: hidden;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Imagen de fondo opcional */
.mantis-category-hero__background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.2;
  z-index: 1;
}

/* Overlay oscuro para mejorar legibilidad del texto */
.mantis-category-hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.3) 0%, transparent 50%);
  z-index: 2;
}

.mantis-category-hero__content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 800px;
}

.mantis-category-hero__title {
  color: #fff;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 var(--mantis-spacing-sm) 0;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mantis-category-hero__description {
  font-size: 1.125rem;
  line-height: 1.6;
  opacity: 0.95;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* ============================================================================
   FILTROS DE CATEGORÍAS (dropdowns)
   ============================================================================ */
.mantis-category-filters {
  background: var(--mantis-bg-gray);
  border-radius: var(--mantis-radius-lg);
  padding: var(--mantis-spacing-lg);
  margin-bottom: var(--mantis-spacing-lg);
  box-shadow: var(--mantis-shadow-sm);
}

.mantis-category-filters__inner {
  display: flex;
  gap: var(--mantis-spacing-lg);
  align-items: flex-end;
  flex-wrap: wrap;
}

/* Grupo individual de filtro (label + select) */
.mantis-filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--mantis-spacing-xs);
  flex: 1;
  min-width: 200px;
}

.mantis-filter-group__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--mantis-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Estilos del select (dropdown) */
.mantis-filter-select {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: var(--mantis-radius-md);
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px;
  font-size: 1rem;
  color: var(--mantis-text-primary);
  cursor: pointer;
  transition: var(--mantis-transition);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.mantis-filter-select:hover {
  border-color: var(--mantis-primary);
}

.mantis-filter-select:focus {
  outline: none;
  border-color: var(--mantis-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Opciones del select */
.mantis-filter-select option {
  padding: 0.5rem;
}

/* Botón secundario (opcional, para "ver todos") */
.mantis-button--secondary {
  background: white;
  color: var(--mantis-primary);
  border: 2px solid var(--mantis-primary);
  box-shadow: none;
}

.mantis-button--secondary:hover {
  background: var(--mantis-primary);
  color: white;
}

/* ============================================================================
   HEADER DE CATEGORÍA (fondo morado con subcategorías)
   ============================================================================ */
.mantis-category-header {
  background: var(--mantis-secondary);
  border-radius: var(--mantis-radius-lg);
  padding: var(--mantis-spacing-xl);
  margin-bottom: var(--mantis-spacing-lg);
  color: white;
  position: relative;
  overflow: hidden;
}

/* Patrón decorativo de fondo */
.mantis-category-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 15% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 85% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.mantis-category-header__content {
  position: relative;
  z-index: 1;
}

.mantis-category-header__title {
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 var(--mantis-spacing-sm) 0;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mantis-category-header__description {
  font-size: 1.125rem;
  opacity: 0.9;
  margin: 0 0 var(--mantis-spacing-lg) 0;
  max-width: 800px;
  line-height: 1.6;
}

/* ============================================================================
   SUBCATEGORÍAS dentro del header
   ============================================================================ */
.mantis-subcategories {
  margin-top: var(--mantis-spacing-lg);
}

.mantis-subcategories__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 var(--mantis-spacing-md) 0;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mantis-subcategories__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--mantis-spacing-md);
}

/* Tarjetas individuales de subcategorías */
.mantis-subcategory-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--mantis-radius-md);
  padding: var(--mantis-spacing-md);
  text-align: center;
  text-decoration: none;
  color: white;
  transition: var(--mantis-transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--mantis-spacing-sm);
}

.mantis-subcategory-card:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.mantis-subcategory-card__image {
  width: 80px;
  height: 80px;
  border-radius: var(--mantis-radius-sm);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.mantis-subcategory-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mantis-subcategory-card__name {
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}

/* ============================================================================
   GRID DE PRODUCTOS dentro de una sección de categoría
   ============================================================================ */
.mantis-products-grid--category {
  margin-top: var(--mantis-spacing-lg);
  margin-bottom: var(--mantis-spacing-lg);
}

/* ============================================================================
   FOOTER DE CATEGORÍA (botón de ver más)
   ============================================================================ */
.mantis-category-footer {
  text-align: center;
  padding: var(--mantis-spacing-lg) 0;
}

/* ============================================================================
   BOTONES GENERALES (incluyendo el de ver más productos)
   ============================================================================ */
.mantis-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: var(--mantis-radius-md);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--mantis-transition);
  white-space: nowrap;
}

.mantis-button--primary {
  background: linear-gradient(135deg, var(--mantis-primary) 0%, var(--mantis-primary-dark) 100%);
  color: white;
  box-shadow: var(--mantis-shadow-md);
}

.mantis-button--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--mantis-shadow-xl);
  background: linear-gradient(135deg, var(--mantis-primary-dark) 0%, var(--mantis-primary) 100%);
}

.mantis-button--large {
  padding: 1.125rem 2.5rem;
  font-size: 1.125rem;
}

/* ============================================================================
   MENSAJE CUANDO NO HAY PRODUCTOS
   ============================================================================ */
.mantis-no-products {
  text-align: center;
  padding: var(--mantis-spacing-xl);
  color: var(--mantis-text-secondary);
  font-size: 1.125rem;
  background: var(--mantis-bg-gray);
  border-radius: var(--mantis-radius-md);
  margin: var(--mantis-spacing-lg) 0;
}

/* ============================================================================
   RESPONSIVE: AJUSTES PARA CATEGORÍAS EN TABLET
   ============================================================================ */
@media (max-width: 768px) {
  .mantis-category-header {
    padding: var(--mantis-spacing-lg);
  }
  
  .mantis-category-header__title {
    font-size: 1.75rem;
  }
  
  .mantis-category-header__description {
    font-size: 1rem;
  }
  
  .mantis-subcategories__grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--mantis-spacing-sm);
  }
  
  .mantis-subcategory-card {
    padding: var(--mantis-spacing-sm);
  }
  
  .mantis-subcategory-card__image {
    width: 60px;
    height: 60px;
  }
}

/* ============================================================================
   RESPONSIVE: AJUSTES PARA CATEGORÍAS EN MÓVIL
   ============================================================================ */
@media (max-width: 480px) {
  .mantis-category-header {
    padding: var(--mantis-spacing-md);
  }
  
  .mantis-category-header__title {
    font-size: 1.5rem;
  }
  
  .mantis-subcategories__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .mantis-button--large {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    width: 100%;
  }
}

/* ============================================================================
   PÁGINA DE PRODUCTO INDIVIDUAL (single-product.php)
   ============================================================================ */
.mantis-product-single-wrapper {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* ============================================================================
   HERO DEL PRODUCTO (sección superior con fondo oscuro)
   ============================================================================ */
.mantis-product-hero {
  background: linear-gradient(135deg, var(--mantis-secondary) 0%, var(--mantis-secondary-dark) 100%);
  overflow: hidden;
  margin-bottom: var(--mantis-spacing-xl);
  position: relative;
}

/* Variante full-width (sin border-radius ni max-width) */
.mantis-product-hero--fullwidth {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-radius: 0;
}

/* Patrón decorativo de fondo */
.mantis-product-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

/* Contenedor interno que limita el ancho del contenido */
.mantis-product-hero__container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--mantis-spacing-lg);
}

.mantis-product-hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--mantis-spacing-xl);
  padding: var(--mantis-spacing-xl) 0;
  position: relative;
  z-index: 1;
}

/* ----------------------------------------------------------------------------
   GALERÍA DE IMÁGENES (columna izquierda)
   ---------------------------------------------------------------------------- */
.mantis-product-hero__gallery {
  display: flex;
  flex-direction: column;
  gap: var(--mantis-spacing-md);
}

/* Ajustar las imágenes de WooCommerce para que se vean bien en el fondo oscuro */
.mantis-product-hero__gallery .woocommerce-product-gallery {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--mantis-radius-md);
  padding: var(--mantis-spacing-md);
  backdrop-filter: blur(10px);
}

/* Imagen principal */
.mantis-product-hero__gallery .woocommerce-product-gallery__wrapper {
  margin-bottom: var(--mantis-spacing-md);
}

.mantis-product-hero__gallery .woocommerce-product-gallery__image {
  background: white;
  border-radius: var(--mantis-radius-md);
  overflow: hidden;
  margin-bottom: 0 !important;
}

.mantis-product-hero__gallery .woocommerce-product-gallery__image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Thumbnails (miniaturas) de la galería */
.mantis-product-hero__gallery .flex-control-thumbs {
  display: flex;
  gap: var(--mantis-spacing-sm);
  margin: var(--mantis-spacing-md) 0 0 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}

.mantis-product-hero__gallery .flex-control-thumbs li {
  flex: 0 0 calc(25% - var(--mantis-spacing-sm));
  margin: 0;
  padding: 0;
}

.mantis-product-hero__gallery .flex-control-thumbs li img {
  width: 100%;
  height: auto;
  display: block;
  background: white;
  border-radius: var(--mantis-radius-sm);
  cursor: pointer;
  transition: var(--mantis-transition);
  opacity: 0.7;
  border: 2px solid transparent;
}

.mantis-product-hero__gallery .flex-control-thumbs li img:hover {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.3);
}

.mantis-product-hero__gallery .flex-control-thumbs li img.flex-active {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Badge de oferta */
.mantis-product-hero__gallery .onsale {
  background: var(--mantis-danger);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--mantis-radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: absolute;
  top: var(--mantis-spacing-md);
  left: var(--mantis-spacing-md);
  z-index: 10;
  box-shadow: var(--mantis-shadow-lg);
}

/* ----------------------------------------------------------------------------
   INFORMACIÓN DEL PRODUCTO (columna derecha)
   ---------------------------------------------------------------------------- */
.mantis-product-hero__summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: white;
}

.mantis-product-summary {
  display: flex;
  flex-direction: column;
  gap: var(--mantis-spacing-md);
}

/* Título del producto */
.mantis-product-summary .product_title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Rating de estrellas */
.mantis-product-summary .woocommerce-product-rating {
  display: flex;
  align-items: center;
  gap: var(--mantis-spacing-sm);
}

.mantis-product-summary .star-rating {
  color: #fbbf24;
}

.mantis-product-summary .woocommerce-review-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.875rem;
  transition: var(--mantis-transition);
}

.mantis-product-summary .woocommerce-review-link:hover {
  color: white;
}

/* Precio del producto */
.mantis-product-summary .price {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  margin: var(--mantis-spacing-sm) 0;
}

.mantis-product-summary .price del {
  opacity: 0.6;
  font-size: 1.5rem;
  font-weight: 400;
  margin-right: var(--mantis-spacing-sm);
}

.mantis-product-summary .price ins {
  text-decoration: none;
  color: #fbbf24;
}

/* Descripción corta */
.mantis-product-summary .woocommerce-product-details__short-description {
  font-size: 1.125rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  margin: var(--mantis-spacing-md) 0;
}

/* Formulario de agregar al carrito */
.mantis-product-summary .cart {
  display: flex;
  gap: var(--mantis-spacing-sm);
  align-items: flex-start;
  margin: var(--mantis-spacing-lg) 0;
  flex-wrap: wrap;
}

.mantis-product-summary .quantity {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--mantis-radius-md);
  overflow: hidden;
}

.mantis-product-summary .quantity input[type="number"] {
  width: 80px;
  padding: 0.875rem;
  border: none;
  background: transparent;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  -moz-appearance: textfield;
}

.mantis-product-summary .quantity input[type="number"]::-webkit-outer-spin-button,
.mantis-product-summary .quantity input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.mantis-product-summary .single_add_to_cart_button {
  flex: 1;
  min-width: 200px;
  padding: 1rem 2rem;
  background: white;
  color: var(--mantis-secondary);
  border: none;
  border-radius: var(--mantis-radius-md);
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--mantis-transition);
  box-shadow: var(--mantis-shadow-lg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mantis-product-summary .single_add_to_cart_button:hover {
  background: #fbbf24;
  color: var(--mantis-secondary-dark);
  transform: translateY(-2px);
  box-shadow: var(--mantis-shadow-xl);
}

.mantis-product-summary .single_add_to_cart_button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Meta información (SKU, categorías, tags) */
.mantis-product-summary .product_meta {
  padding-top: var(--mantis-spacing-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.mantis-product-summary .product_meta > span {
  display: block;
  margin-bottom: var(--mantis-spacing-xs);
}

.mantis-product-summary .product_meta a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: var(--mantis-transition);
}

.mantis-product-summary .product_meta a:hover {
  color: white;
  text-decoration: underline;
}

/* ----------------------------------------------------------------------------
   VARIACIONES DE PRODUCTO (para productos variables)
   ---------------------------------------------------------------------------- */
.mantis-product-summary .variations {
  margin: var(--mantis-spacing-md) 0;
}

.mantis-product-summary .variations td {
  padding: var(--mantis-spacing-xs) 0;
}

.mantis-product-summary .variations label {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  margin-right: var(--mantis-spacing-sm);
  display: block;
  margin-bottom: var(--mantis-spacing-xs);
}

.mantis-product-summary .variations select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--mantis-radius-md);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--mantis-transition);
}

.mantis-product-summary .variations select:hover,
.mantis-product-summary .variations select:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.mantis-product-summary .variations select option {
  background: var(--mantis-secondary);
  color: white;
}

/* ============================================================================
   TABS DE INFORMACIÓN (descripción, reviews, etc.)
   ============================================================================ */
.mantis-product-tabs-wrapper {
  background: white;
  border-radius: var(--mantis-radius-lg);
  padding: var(--mantis-spacing-xl);
  margin-bottom: var(--mantis-spacing-xl);
}

/* Estilos para los tabs de WooCommerce */
.mantis-product-tabs-wrapper .woocommerce-tabs {
  margin: 0;
}

.mantis-product-tabs-wrapper .woocommerce-tabs ul.tabs {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--mantis-spacing-lg) 0;
  display: flex;
  gap: var(--mantis-spacing-sm);
  border-bottom: 2px solid #e2e8f0;
}

.mantis-product-tabs-wrapper .woocommerce-tabs ul.tabs li {
  margin: 0;
  padding: 0;
}

.mantis-product-tabs-wrapper .woocommerce-tabs ul.tabs li a {
  display: block;
  padding: var(--mantis-spacing-sm) var(--mantis-spacing-lg);
  color: var(--mantis-text-secondary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  transition: var(--mantis-transition);
  position: relative;
  top: 2px;
}

.mantis-product-tabs-wrapper .woocommerce-tabs ul.tabs li a:hover {
  color: var(--mantis-primary);
}

.mantis-product-tabs-wrapper .woocommerce-tabs ul.tabs li.active a {
  color: var(--mantis-primary);
  border-bottom-color: var(--mantis-primary);
}

.mantis-product-tabs-wrapper .woocommerce-tabs .woocommerce-Tabs-panel {
  padding: var(--mantis-spacing-lg) 0;
}

.mantis-product-tabs-wrapper .woocommerce-tabs .woocommerce-Tabs-panel h2 {
  color: var(--mantis-text-primary);
  margin-bottom: var(--mantis-spacing-md);
}

/* ============================================================================
   PRODUCTOS RELACIONADOS Y UPSELLS
   ============================================================================ */
.mantis-product-tabs-wrapper .related.products,
.mantis-product-tabs-wrapper .upsells.products {
  margin-top: var(--mantis-spacing-xl);
  padding-top: var(--mantis-spacing-xl);
  border-top: 2px solid #e2e8f0;
}

.mantis-product-tabs-wrapper .related.products h2,
.mantis-product-tabs-wrapper .upsells.products h2 {
  font-size: 1.75rem;
  margin-bottom: var(--mantis-spacing-lg);
  color: var(--mantis-text-primary);
}

/* Usar el mismo grid de productos que en el catálogo */
.mantis-product-tabs-wrapper .related .products,
.mantis-product-tabs-wrapper .upsells .products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--mantis-spacing-lg);
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Asegurarnos de que cada producto use nuestra card personalizada */
.mantis-product-tabs-wrapper .related .products li,
.mantis-product-tabs-wrapper .upsells .products li {
  margin: 0;
  padding: 0;
}

/* Forzar que los productos relacionados usen el diseño de mantis-product-card */
.mantis-product-tabs-wrapper .related .products .product,
.mantis-product-tabs-wrapper .upsells .products .product {
  background: var(--mantis-bg-light);
  border-radius: var(--mantis-radius-lg);
  overflow: hidden;
  box-shadow: var(--mantis-shadow-sm);
  transition: var(--mantis-transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mantis-product-tabs-wrapper .related .products .product:hover,
.mantis-product-tabs-wrapper .upsells .products .product:hover {
  box-shadow: var(--mantis-shadow-xl);
  transform: translateY(-4px);
}

/* Imagen del producto en related/upsells */
.mantis-product-tabs-wrapper .related .products .product .woocommerce-loop-product__link,
.mantis-product-tabs-wrapper .upsells .products .product .woocommerce-loop-product__link {
  display: block;
  position: relative;
  width: 100%;
  padding-top: 100%;
  background: var(--mantis-bg-gray);
  overflow: hidden;
}

.mantis-product-tabs-wrapper .related .products .product img,
.mantis-product-tabs-wrapper .upsells .products .product img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--mantis-transition);
}

.mantis-product-tabs-wrapper .related .products .product:hover img,
.mantis-product-tabs-wrapper .upsells .products .product:hover img {
  transform: scale(1.05);
}

/* Título del producto en related/upsells */
.mantis-product-tabs-wrapper .related .products .product .woocommerce-loop-product__title,
.mantis-product-tabs-wrapper .upsells .products .product .woocommerce-loop-product__title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin: var(--mantis-spacing-md);
  margin-bottom: var(--mantis-spacing-xs);
  color: var(--mantis-text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Precio en related/upsells */
.mantis-product-tabs-wrapper .related .products .product .price,
.mantis-product-tabs-wrapper .upsells .products .product .price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--mantis-primary);
  margin: 0 var(--mantis-spacing-md) var(--mantis-spacing-md);
}

.mantis-product-tabs-wrapper .related .products .product .price del,
.mantis-product-tabs-wrapper .upsells .products .product .price del {
  font-size: 0.875rem;
  color: var(--mantis-text-light);
  font-weight: 400;
  margin-right: 0.5rem;
}

.mantis-product-tabs-wrapper .related .products .product .price ins,
.mantis-product-tabs-wrapper .upsells .products .product .price ins {
  text-decoration: none;
  color: var(--mantis-danger);
}

/* Botón de agregar al carrito en related/upsells */
.mantis-product-tabs-wrapper .related .products .product .button,
.mantis-product-tabs-wrapper .upsells .products .product .button {
  margin: 0 var(--mantis-spacing-md) var(--mantis-spacing-md);
  background: var(--mantis-primary);
  color: white;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--mantis-radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--mantis-transition);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  width: calc(100% - var(--mantis-spacing-md) * 2);
}

.mantis-product-tabs-wrapper .related .products .product .button:hover,
.mantis-product-tabs-wrapper .upsells .products .product .button:hover {
  background: var(--mantis-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--mantis-shadow-md);
}

/* Badge de oferta en related/upsells */
.mantis-product-tabs-wrapper .related .products .product .onsale,
.mantis-product-tabs-wrapper .upsells .products .product .onsale {
  position: absolute;
  top: var(--mantis-spacing-sm);
  right: var(--mantis-spacing-sm);
  background: var(--mantis-danger);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: var(--mantis-radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
  box-shadow: var(--mantis-shadow-md);
}

/* ============================================================================
   RESPONSIVE: PRODUCTO INDIVIDUAL EN TABLET
   ============================================================================ */
@media (max-width: 992px) {
  .mantis-product-hero__inner {
    grid-template-columns: 1fr;
    gap: var(--mantis-spacing-lg);
  }
  
  .mantis-product-summary .product_title {
    font-size: 2rem;
  }
  
  .mantis-product-summary .price {
    font-size: 1.75rem;
  }
}

/* ============================================================================
   RESPONSIVE: PRODUCTO INDIVIDUAL EN MÓVIL
   ============================================================================ */
@media (max-width: 640px) {
  .mantis-product-hero {
    border-radius: 0;
    margin-left: calc(var(--mantis-spacing-md) * -1);
    margin-right: calc(var(--mantis-spacing-md) * -1);
  }
  
  .mantis-product-hero__inner {
    padding: var(--mantis-spacing-md);
  }
  
  .mantis-product-summary .product_title {
    font-size: 1.5rem;
  }
  
  .mantis-product-summary .cart {
    flex-direction: column;
    width: 100%;
  }
  
  .mantis-product-summary .quantity {
    width: 100%;
    justify-content: center;
  }
  
  .mantis-product-summary .single_add_to_cart_button {
    width: 100%;
  }
  
  .mantis-product-tabs-wrapper {
    padding: var(--mantis-spacing-md);
  }
  
  .mantis-product-tabs-wrapper .woocommerce-tabs ul.tabs {
    flex-direction: column;
    border-bottom: none;
  }
  
  .mantis-product-tabs-wrapper .woocommerce-tabs ul.tabs li a {
    border-bottom: none;
    border-left: 3px solid transparent;
    padding-left: var(--mantis-spacing-md);
  }
  
  .mantis-product-tabs-wrapper .woocommerce-tabs ul.tabs li.active a {
    border-left-color: var(--mantis-primary);
  }
}