/* Reset box-sizing */
.featuredproducts-section,
.featuredproducts-section * {
  box-sizing: border-box;
}

/* SEO Layer */
.featuredproducts-section .seo-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: #1a051d;
  margin: 0 0 1rem 0;
  line-height: 1.3;
  text-align: left;
}

.featuredproducts-section .seo-text {
  margin: 0 0 1.5rem 0;
  color: #1a051d;
  font-size: 0.95rem;
  line-height: 1.6;
}

.featuredproducts-section .seo-text p {
  margin: 0;
}

.featuredproducts-section .seo-links {
  margin: 0 0 2rem 0;
}

.featuredproducts-section .seo-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.featuredproducts-section .seo-links li {
  display: inline-block;
}

.featuredproducts-section .seo-links a {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #f3eff7;
  color: #3b2b4a;
  text-decoration: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid #E0E0E0;
}

.featuredproducts-section .seo-links a:hover {
  background: #ceafe0;
  color: #1a051d;
  border-color: #ceafe0;
}

.featuredproducts-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* DESKTOP: Grid 6 columnas */
.featuredproducts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

@media (min-width: 768px) {
  .featuredproducts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .featuredproducts-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* DESKTOP: Cards verticales */
@media (min-width: 769px) {
  .product-card {
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .product-card:hover {
    box-shadow: 0 4px 12px rgba(59, 43, 74, 0.15);
    transform: translateY(-4px);
    border-color: #ceafe0;
  }

  .product-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .product-image {
    display: block;
    overflow: hidden;
    background: #f3eff7;
    position: relative;
    padding-top: 100%;
  }

  .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
  }

  .product-image:hover img {
    transform: scale(1.05);
  }

  .product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  .product-name {
    font-size: 15px;
    font-weight: 500;
    color: #1a051d;
    text-decoration: none;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    min-height: 4.2em; /* 3 líneas × 1.4 line-height */
    max-height: 4.2em;
  }

  .product-name:hover {
    color: #3b2b4a;
  }

  .product-price {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .product-price-current {
    font-size: 20px;
    font-weight: 700;
    color: #1a051d;
  }

  .product-price-regular {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
  }

  .product-price-sale {
    font-size: 20px;
    font-weight: 700;
    color: #d63447;
  }

  .add-to-cart-form {
    margin-top: auto;
  }

  .btn-add-to-cart {
    width: 100%;
    padding: 12px 20px;
    background: white;
    color: #3b2b4a;
    border: 1px solid #E0E0E0;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
  }

  .btn-add-to-cart:hover {
    background: #ceafe0;
    color: #1a051d;
    border-color: #ceafe0;
  }
}

/* MOBILE: Layout horizontal compacto (imagen izq + info der) */
@media (max-width: 768px) {
  .featuredproducts-section {
    padding: 20px 16px;
  }
  
  .featuredproducts-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  
  .featuredproducts-section .product-card {
    display: flex !important;
    flex-direction: row !important;
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    overflow: visible !important;
    padding: 12px;
    gap: 12px;
    min-height: 110px;
    position: relative !important;
  }
  
  .featuredproducts-section .product-card-inner {
    display: flex !important;
    flex-direction: row !important;
    width: 100%;
    gap: 30px !important;
  }
  
  .featuredproducts-section .product-image {
    width: 80px !important;
    min-width: 80px !important;
    height: 80px !important;
    flex-shrink: 0;
    background: #f3eff7;
    border-radius: 4px;
    overflow: hidden;
    position: relative !important;
    padding: 0;
    top: 25px !important;
  }
  
  .featuredproducts-section .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .featuredproducts-section .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
    min-width: 0;
  }
  
  .product-name {
    font-size: 14px;
    font-weight: 500;
    color: #1a051d;
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 6px;
    margin-top: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .product-price {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .product-price-current {
    font-size: 16px;
    font-weight: 700;
    color: #1a051d;
  }
  
  .product-price-regular {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
  }
  
  .add-to-cart-form {
    margin: 0;
  }
  
  .btn-add-to-cart {
    padding: 6px 12px;
    background: white;
    color: #3b2b4a;
    border: 1px solid #E0E0E0;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    width: auto;
  }
  
  .btn-add-to-cart:hover {
    background: #ceafe0;
    color: #1a051d;
    border-color: #ceafe0;
  }
  
  /* Badge flotante en móvil - posicionamiento específico */
  .featuredproducts-section .product-card .tana-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 30;
    padding: 6px 12px;
    font-size: 11px;
    line-height: 1;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  }
  
  .featuredproducts-section .product-card .tana-badges {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 30;
  }
}

/* Botón Ver Más */
.load-more-container {
  text-align: center;
  margin-top: 30px;
}

.btn-load-more {
  padding: 14px 40px;
  background: white;
  color: #3b2b4a;
  border: 1px solid #E0E0E0;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
}

.btn-load-more:hover {
  background: #ceafe0;
  color: #1a051d;
  border-color: #ceafe0;
}

.btn-load-more.hidden {
  display: none;
}

.btn-load-more.loading {
  opacity: 0.6;
  cursor: wait;
}

.btn-load-more.error {
  background: #d63447;
  color: white;
  border-color: #d63447;
}

.btn-load-more:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .btn-load-more {
    padding: 12px 32px;
    font-size: 14px;
  }
}


/* ===============================================
   v2.0: CONVERSION-FOCUSED IMPROVEMENTS
   =============================================== */

/* Badge */
.featuredproducts-section .product-card {
  position: relative;
}

.featuredproducts-section .product-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.featuredproducts-section .product-badge-bestseller {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: #fff;
}

/* Discount badge */
.featuredproducts-section .product-discount-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.2rem 0.5rem;
  background: #ff4444;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 3px;
}

/* Enhanced price display - NO RED */
.featuredproducts-section .product-price {
  margin: 0.75rem 0;
  line-height: 1.4;
}

.featuredproducts-section .product-price-current {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a051d;
}

.featuredproducts-section .product-price-sale {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a051d;
  margin-right: 0.5rem;
}

.featuredproducts-section .product-price-regular {
  font-size: 1rem;
  color: #999;
  text-decoration: line-through;
  margin-right: 0.5rem;
}

/* Enhanced CTA button - Color #d22a56 */
.featuredproducts-section .btn-add-to-cart-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(135deg, #d22a56 0%, #b8234a 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(210, 42, 86, 0.3);
}

.featuredproducts-section .btn-add-to-cart-primary:hover {
  background: linear-gradient(135deg, #b8234a 0%, #a01f3f 100%);
  box-shadow: 0 4px 12px rgba(210, 42, 86, 0.4);
  transform: translateY(-1px);
}

.featuredproducts-section .btn-add-to-cart-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(210, 42, 86, 0.3);
}

.featuredproducts-section .cart-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Prepared for social proof (future) */
.featuredproducts-section .product-social-proof {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #f8f9fa;
  border-left: 3px solid #4CAF50;
  font-size: 0.85rem;
  color: #666;
  border-radius: 3px;
}

/* Mobile optimizations */
@media (max-width: 767px) {
  .featuredproducts-section .product-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    top: 0.4rem;
    left: 0.4rem;
  }
  
  .featuredproducts-section .product-price-sale {
    font-size: 1.2rem;
  }
  
  .featuredproducts-section .btn-add-to-cart-primary {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  .featuredproducts-section .cart-icon {
    width: 16px;
    height: 16px;
  }
}

/* ===============================================
   v2.1: OPTIMIZED CONVERSION & HIERARCHY
   =============================================== */

/* Better price hierarchy */
.featuredproducts-section .product-price-block {
  margin: 1rem 0;
}

.featuredproducts-section .product-price-group {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

/* Enhanced CTA visibility */
.featuredproducts-section .btn-add-to-cart-primary {
  margin-top: 0.75rem;
  font-size: 1rem;
  padding: 0.9rem 1.3rem;
}

/* Social proof styles (prepared for future use) */
.featuredproducts-section .product-social-proof {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-left: 3px solid #4CAF50;
  font-size: 0.8rem;
  color: #495057;
  border-radius: 4px;
  line-height: 1.3;
}

.featuredproducts-section .social-proof-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.featuredproducts-section .social-proof-text {
  font-weight: 500;
}

/* Specific social proof types */
.featuredproducts-section .product-social-proof[data-type="popular"] {
  border-left-color: #ff9800;
}

.featuredproducts-section .product-social-proof[data-type="low_stock"] {
  border-left-color: #f44336;
  background: linear-gradient(135deg, #fff5f5 0%, #ffe9e9 100%);
}

/* Mobile adjustments */
@media (max-width: 767px) {
  .featuredproducts-section .product-price-block {
    margin: 0.6rem 0;
  }
  
  .featuredproducts-section .btn-add-to-cart-primary {
    padding: 0.8rem 1.1rem;
    font-size: 0.95rem;
  }
  
  .featuredproducts-section .product-social-proof {
    font-size: 0.75rem;
    padding: 0.5rem 0.6rem;
    margin-top: 0.5rem;
  }
}

/* ===============================================
   v2.2: BADGE TYPES (BESTSELLER, FAVORITO, PROMOCIÓN)
   =============================================== */

/* Bestseller badge - Verde */
.featuredproducts-section .product-badge-bestseller {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: #fff;
}

/* Favorito badge - Azul */
.featuredproducts-section .product-badge-favorito {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  color: #fff;
}

/* Promoción badge - Naranja */
.featuredproducts-section .product-badge-promocion {
  background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
  color: #fff;
}

/* Badge Agotado */
.product-badge-out-of-stock {
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto !important;
  background: #6c757d !important;
  color: white !important;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
  z-index: 11;
  opacity: 0.9;
}

/* Botón cuando está agotado */
.btn-out-of-stock {
  background: #e9ecef !important;
  color: #6c757d !important;
  cursor: not-allowed !important;
  border: 1px solid #dee2e6 !important;
}

.btn-out-of-stock:hover {
  background: #e9ecef !important;
  color: #6c757d !important;
}

@media (max-width: 768px) {
  .product-badge-out-of-stock {
    top: 6px;
    right: auto;
    left: -35px;
    padding: 4px 8px;
    font-size: 11px;
    z-index: 20;
  }
}

/* ============================================
   BOTONES - ALTURA UNIFORME
   ============================================ */

/* Asegurar que todos los botones tengan la misma altura */
.btn-add-to-cart,
.btn-view-product,
.btn-out-of-stock {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 48px; /* Altura mínima fija */
  width: 100%;
  padding: 0.85rem 1.25rem !important;
  font-size: 0.95rem !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-sizing: border-box;
  text-decoration: none;
  line-height: 1.2;
}

/* Botón "Ver producto" (cuando no hay add_to_cart_url) */
.btn-view-product {
  background: #6c757d !important;
  color: #fff !important;
  border: none !important;
}

.btn-view-product:hover {
  background: #5a6268 !important;
  color: #fff !important;
  transform: translateY(-1px);
}

/* Botón "Agotado" - mantener estilos grises discretos */
.btn-out-of-stock {
  background: #e9ecef !important;
  color: #6c757d !important;
  cursor: not-allowed !important;
  border: 1px solid #dee2e6 !important;
  min-height: 48px !important;
}

.btn-out-of-stock:hover {
  background: #e9ecef !important;
  color: #6c757d !important;
  transform: none !important;
}

/* Mobile - altura uniforme también */
@media (max-width: 767px) {
  .btn-add-to-cart,
  .btn-view-product,
  .btn-out-of-stock {
    min-height: 44px;
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
  }
}

/* ============================================
   TANA BADGES - CSS COMPLETO
   ============================================ */

/* 1. Card debe permitir overflow visible para badges flotantes */
.featuredproducts-section .product-card {
  overflow: visible !important;
}

/* Contenedor de badges */
.tana-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tana-badges--listing {
  top: 8px;
  left: 8px;
}

.tana-badges--product {
  top: 10px;
  left: 10px;
}

/* Badge individual dentro del contenedor */
.tana-badges .tana-badge {
  position: relative;
  top: auto;
  left: auto;
}

/* Badge base */
.tana-badge {
  display: inline-block;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 3px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  color: #fff;
  white-space: nowrap;
  line-height: 1.2;
}

/* FEATURED BADGES */
.tana-badge--lanzamiento {
  background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
  animation: tana-badge-pulse 2s ease-in-out infinite;
}

.tana-badge--novedad {
  background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.tana-badge--nuevo {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

.tana-badge--destacado {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #1a051d;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.tana-badge--promocion {
  background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
}

/* BESTSELLERS BADGES (compatibilidad) */
.tana-badge--bestseller {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #333;
}

.tana-badge--favorito {
  background: linear-gradient(135deg, #E91E63 0%, #C2185B 100%);
}

/* Animación pulse */
@keyframes tana-badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* RESPONSIVE - MÓVIL */
@media (max-width: 767px) {
  /* Card overflow visible en móvil también */
  .featuredproducts-section .product-card {
    overflow: visible !important;
  }
  
  /* Badge flotante hacia la izquierda */
  .tana-badges {
    top: 6px;
    left: -10px;
    gap: 4px;
    z-index: 20;
  }
  
  .tana-badge {
    padding: 4px 8px;
    font-size: 11px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  }
  
  /* Ajustar padding del contenido para que no choque con badge */
  .featuredproducts-section .product-info {
    padding-top: 8px;
  }
}
