/* Featured Products Section Styles */

/* ========================================
   BEST SELLER CAROUSEL
   ======================================== */

.best-seller-carousel-container {
  position: relative;
  margin: 32px 0 40px;
}

/* Image Carousel - Slide transition */
.best-seller-image-wrapper {
  position: relative;
  overflow: hidden;
  contain: layout paint;
}

.best-seller-image-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Solo el ítem activo o los que están en transición (prev/next) son visibles; el resto oculto para evitar superposiciones */
.best-seller-image-carousel .carousel-image-item {
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.6s ease-in-out,
              transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              visibility 0s linear 0.6s;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  visibility: hidden;
  backface-visibility: hidden;
}

.best-seller-image-carousel .carousel-image-item.active,
.best-seller-image-carousel .carousel-image-item.prev,
.best-seller-image-carousel .carousel-image-item.next {
  visibility: visible;
  transition-delay: 0s;
}

.best-seller-image-carousel .carousel-image-item.active {
  position: relative;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  z-index: 2;
}

.best-seller-image-carousel .carousel-image-item.prev {
  opacity: 1;
  transform: translateX(-100%);
  z-index: 1;
}

.best-seller-image-carousel .carousel-image-item.next {
  opacity: 1;
  transform: translateX(100%);
  z-index: 1;
}

/* Info Carousel - Fade only, fixed position */
.best-seller-info-wrapper {
  position: relative;
  min-height: 400px; /* Prevent layout shift - adjust based on content */
  display: flex;
  flex-direction: column;
}

.best-seller-info-carousel {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.best-seller-info-carousel .carousel-info-item {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  visibility: hidden;
  display: flex;
  flex-direction: column;
}

.best-seller-info-carousel .carousel-info-item.active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* Carousel Controls */
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  padding: 0 20px;
}

.carousel-btn {
  background: #fff;
  border: 2px solid var(--brand);
  color: var(--brand);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.carousel-btn:hover {
  background: var(--brand);
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.carousel-btn:active {
  transform: scale(0.95);
}

.carousel-btn svg {
  width: 20px;
  height: 20px;
}

/* Carousel Dots */
.carousel-dots {
  display: flex;
  gap: 12px;
  align-items: center;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.carousel-dot:hover {
  background: var(--brand);
  transform: scale(1.2);
}

.carousel-dot.active {
  background: var(--brand);
  width: 14px;
  height: 14px;
}

/* ========================================
   BEST SELLING PRODUCT CARD
   ======================================== */

.best-seller-card {
  padding: 0;
  margin: 0;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
  text-align: left;
}

/* Badge */
.best-seller-badge {
  border-bottom: 2px solid var(--brand);
  color: var(--brand);
  margin-top: 32px;
  margin-bottom: 24px;
  font-weight: 600;
  font-size: 2rem;
  text-align: left;
}

.best-seller-badge i {
  color: var(--brand);
  font-size: 1.1rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Content Layout */
.best-seller-content {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 32px;
  padding: 32px;
  align-items: center;
  margin-bottom: 32px;
}

/* Image Section */
.best-seller-image-wrapper {
  position: relative;
  width: 100%;
  min-height: 400px;
}

.best-seller-image {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1/1;
  width: 100%;
  height: 100%;
  min-height: 400px;
  isolation: isolate;
}

.best-seller-image a {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

.best-seller-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transform: scale(1);
  transition: opacity 0.8s ease-in-out, transform 4s linear;
  z-index: 0;
  backface-visibility: hidden;
  pointer-events: none;
}

.best-seller-image img.active {
  opacity: 1;
  z-index: 1;
  transform: scale(1.1);
  pointer-events: auto;
}

.best-seller-card:hover .best-seller-image img.active {
  transform: scale(1.05);
}

.best-seller-image a {
  display: block;
  height: 100%;
}

.best-seller-delivery-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #fff;
  color: var(--brand);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.3px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
}

.best-seller-delivery-badge[data-delivery="best-seller"] { 
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #854d0e;
  border: 2px solid #fbbf24;
}

.best-seller-delivery-badge[data-delivery="best-seller"] i {
  color: #854d0e;
}

/* Info Section */
.best-seller-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.best-seller-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: #071325;
}

.best-seller-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.best-seller-title a:hover {
  color: var(--brand);
}

.best-seller-description {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #5c6368;
}

/* Stats */
.best-seller-stats {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  border-radius: 999px;
  font-weight: 600;
  color: #e65100;
  font-size: 0.95rem;
  width: fit-content;
}

.stats-icon {
  font-size: 1.2rem;
}

/* Price */
.best-seller-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}

.price-label {
  font-size: 0.95rem;
  color: #5c6368;
  font-weight: 400;
}

.price-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand);
}

/* Button */
.best-seller-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  width: fit-content;
  margin-top: 8px;
  box-shadow: none;
}

.best-seller-btn:hover {
  background: var(--brand);
  color: #fff;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.best-seller-btn svg {
  transition: transform 0.3s ease;
}

.best-seller-btn:hover svg {
  transform: translateX(4px);
}


/* ========================================
   FEATURED PRODUCTS GRID
   ======================================== */

.featured-products-title {
  margin-top: 32px;
  margin-bottom: 24px;
  color: var(--brand);
  font-weight: 600;
  font-size: 2rem;
  text-align: center;
}


/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet landscape */
@media (max-width: 1024px) {
  .best-seller-content {
    grid-template-columns: 350px 1fr;
    gap: 24px;
    padding: 24px;
  }
  
  .best-seller-title {
    font-size: 1.75rem;
  }
  
  .price-value {
    font-size: 1.75rem;
  }
}

/* Tablet portrait */
@media (max-width: 768px) {
  .best-seller-carousel-container {
    margin: 24px 0 32px;
  }
  
  .best-seller-card {
    margin: 0;
    /* Disable hover effects on touch devices */
  }
  
  .carousel-controls {
    margin-top: 20px;
    gap: 12px;
  }
  
  .carousel-btn {
    width: 44px;
    height: 44px;
  }
  
  .carousel-btn svg {
    width: 18px;
    height: 18px;
  }
  
  .carousel-dots {
    gap: 10px;
  }
  
  .best-seller-card:hover {
    transform: none;
  }
  
  .best-seller-content {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 20px;
  }

  .best-seller-info-wrapper {
    min-height: 0;
  }
  
  .best-seller-image {
    max-width: 100%;
    min-height: 350px;
    width: 100%;
    margin: 0 auto;
  }
  
  .best-seller-title {
    font-size: 1.5rem;
    text-align: center;
  }
  
  .best-seller-description {
    text-align: center;
  }
  
  .best-seller-stats {
    margin: 0 auto;
  }
  
  .best-seller-price {
    justify-content: right;
  }
  
  .best-seller-btn {
    margin: 0 auto;
  }
  
  .featured-products-title {
    margin-top: 24px;
    margin-bottom: 20px;
    font-size: 1.75rem;
  }
}

/* Mobile large */
@media (max-width: 480px) {
  .best-seller-carousel-container {
    margin: 20px 0 24px;
  }
  
  .best-seller-card {
    margin: 0;
    border-radius: 12px;
  }
  
  .carousel-controls {
    margin-top: 16px;
    gap: 8px;
  }
  
  .carousel-btn {
    width: 40px;
    height: 40px;
  }
  
  .carousel-btn svg {
    width: 16px;
    height: 16px;
  }
  
  .carousel-dots {
    gap: 8px;
  }
  
  .carousel-dot {
    width: 10px;
    height: 10px;
  }
  
  .carousel-dot.active {
    width: 12px;
    height: 12px;
  }
  
  .best-seller-badge {
    padding: 10px 16px;
    font-size: 0.8rem;
    gap: 8px;
  }
  
  .best-seller-badge svg {
    width: 16px;
    height: 16px;
  }
  
  .best-seller-content {
    padding: 20px 16px;
    gap: 20px;
  }
  
  .best-seller-image {
    border-radius: 8px;
    min-height: 300px;
    width: 100%;
  }
  
  .best-seller-delivery-badge {
    top: 8px;
    left: 8px;
    padding: 5px 9px;
    font-size: 0.7rem;
    gap: 4px;
  }
  
  .best-seller-title {
    font-size: 1.4rem;
    line-height: 1.3;
  }
  
  .best-seller-description {
    font-size: 0.9rem;
    line-height: 1.5;
  }
  
  .best-seller-stats {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  
  .stats-icon {
    font-size: 1.1rem;
  }
  
  .best-seller-price {
    margin-top: 4px;
  }
  
  .price-label {
    font-size: 0.85rem;
  }
  
  .price-value {
    font-size: 1.6rem;
  }
  
  .best-seller-btn {
    padding: 14px 24px;
    font-size: 1rem;
    width: 100%;
    justify-content: center;
    border-radius: 8px;
    /* Better touch target */
    min-height: 48px;
  }
  
  .best-seller-btn:active {
    transform: scale(0.98);
  }
  
  .featured-products-title {
    margin-top: 20px;
    margin-bottom: 16px;
    font-size: 1.5rem;
    padding: 0 15px;
  }
}

/* Mobile small */
@media (max-width: 360px) {
  .best-seller-carousel-container {
    margin: 16px 0 20px;
  }
  
  .best-seller-card {
    margin: 0;
  }
  
  .carousel-controls {
    margin-top: 12px;
    gap: 6px;
  }
  
  .carousel-btn {
    width: 36px;
    height: 36px;
  }
  
  .carousel-btn svg {
    width: 14px;
    height: 14px;
  }
  
  .best-seller-badge {
    padding: 8px 12px;
    font-size: 0.75rem;
    gap: 6px;
  }
  
  .best-seller-badge svg {
    width: 14px;
    height: 14px;
  }
  
  .best-seller-content {
    padding: 16px 12px;
    gap: 16px;
  }
  
  .best-seller-title {
    font-size: 1.2rem;
  }
  
  .best-seller-description {
    font-size: 0.85rem;
  }
  
  .best-seller-stats {
    font-size: 0.8rem;
    padding: 5px 10px;
  }
  
  .price-value {
    font-size: 1.4rem;
  }
  
  .best-seller-btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
  
  .featured-products-title {
    margin-top: 16px;
    font-size: 1.3rem;
  }
}

/* Prevent text selection on double-tap (mobile) */
@media (hover: none) and (pointer: coarse) {
  .best-seller-card {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
  }
  
  /* Disable hover animations on touch devices */
  .best-seller-card:hover {
    transform: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }
  
  .best-seller-card:hover .best-seller-image img {
    transform: none;
  }
  
  .best-seller-btn:hover {
    transform: none;
  }
  
  /* Add active state for touch feedback */
  .best-seller-btn:active {
    transform: scale(0.96);
    background: var(--brand);
    color: #fff;
  }
}

/* Fix for very small screens */
@media (max-width: 320px) {
  .best-seller-badge {
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    text-align: center;
  }
  
  .best-seller-title {
    font-size: 1.1rem;
  }
  
  .best-seller-description {
    font-size: 0.8rem;
  }
}
  

@media (max-width: 360px) {
  .best-seller-badge {
    padding: 8px 16px;
    font-size: 0.8rem;
  }
  
  .best-seller-content {
    padding: 12px;
  }
  
  .best-seller-title {
    font-size: 1.2rem;
  }
  
  .featured-products-title {
    margin-top: 16px;
    font-size: 1.3rem;
  }
}
