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

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

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

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

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

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

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

.new-products-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;
}

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

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

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

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

@media (min-width: 1200px) {
  .new-products-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) {
  .new-products-section {
    padding: 20px 16px;
  }
  
  .new-products-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  
  .product-card {
    display: flex;
    flex-direction: row;
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    overflow: visible;
    padding: 12px;
    gap: 12px;
    min-height: 110px;
    position: relative;
  }
  
  .product-card-inner {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 30px;
  }
  
  .product-image {
    width: 80px;
    min-width: 80px;
    height: 80px;
    flex-shrink: 0;
    background: #f3eff7;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    padding: 0;
    top: 25px;
  }
  
  .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .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 */
  .new-products-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);
  }
  
  .new-products-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;
  }
}


/* ===============================================
   OPTIMIZED CONVERSION - SAME AS BESTSELLERS
   =============================================== */

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

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

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

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

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

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

/* Discount badge */
.new-products-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 CTA button - Color #d22a56 */
.new-products-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);
  margin-top: 0.75rem;
}

.new-products-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);
}

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

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

/* Mobile optimizations */
@media (max-width: 767px) {
  .new-products-section .product-price-block {
    margin: 0.6rem 0;
  }
  
  .new-products-section .product-price-sale {
    font-size: 1.2rem;
  }
  
  .new-products-section .btn-add-to-cart-primary {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  .new-products-section .cart-icon {
    width: 16px;
    height: 16px;
  }
}

/* ===============================================
   v3.1: BADGES MÚLTIPLES CON CONTROL TEMPORAL
   =============================================== */

/* Positioning */
.new-products-section .product-card {
  position: relative;
}

.new-products-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);
  color: #fff;
}

/* Badge: "Recién lanzado" (3 días) - Naranja-rojo brillante - PRIORIDAD 1 */
.new-products-section .product-badge-lanzamiento {
  background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
}

/* Badge: "Novedad" (7 días) - Naranja - PRIORIDAD 2 */
.new-products-section .product-badge-novedad {
  background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

/* Badge: "Nuevo" (14 días) - Azul - PRIORIDAD 3 */
.new-products-section .product-badge-nuevo {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

/* Badge: "Destacado" (sin límite) - Morado - PRIORIDAD 4 */
.new-products-section .product-badge-destacado {
  background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
}

/* Mobile: badges más pequeños */
@media (max-width: 767px) {
  .new-products-section .product-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    top: 0.4rem;
    left: 0.4rem;
  }
}

/* ============================================
   TANA BADGES - CSS UNIFICADO
   v1.0.0 - Compartido entre todos los módulos
   ============================================ */

/* Posicionamiento: badges sobre la imagen del producto */
.product-card {
    position: relative;
}

.product-card .tana-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    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 2px 6px rgba(0, 0, 0, 0.2);
    color: #fff;
    white-space: nowrap;
    line-height: 1.2;
}

/* NEWPRODUCTS BADGES */
.tana-badge--lanzamiento {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
}

.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, #9C27B0 0%, #7B1FA2 100%);
}

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

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

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

/* RESPONSIVE */
@media (max-width: 767px) {
    .product-card .tana-badge {
        top: 8px;
        left: 8px;
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* ANIMACIÓN OPCIONAL */
@keyframes tana-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.tana-badge--lanzamiento {
    animation: tana-badge-pulse 2s ease-in-out infinite;
}

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

/* 1. Card debe permitir overflow visible para badges flotantes */
.new-products-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;
}

/* NEWPRODUCTS 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, #9C27B0 0%, #7B1FA2 100%);
}

.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); }
}
