/* Trending Items Section General Styling */
.trending-items-section {
  overflow: hidden;
  box-sizing: border-box;
}

.trending-items-section .trending-items-swiper-container {
  width: 100%;
  height: auto;
  box-sizing: border-box;
  overflow: hidden;
  /* Crucial for clipping Swiper content */
  display: none;
  /* Initially hidden by JS */
}

.trending-items-section .swiper-wrapper {
  display: flex;
  /* Swiper default, ensure it's active */
  position: relative;
  /* Swiper default */
  box-sizing: border-box;
  /* Swiper JS will set width and transform */
}

.trending-items-section .swiper-slide {
  height: auto;
  /* Allow height to be determined by content */
  box-sizing: border-box;
  flex-shrink: 0;
  /* Essential for Swiper */
  display: flex;
  /* For alignment of .medication-card */
  flex-direction: column;
  align-items: stretch;
  /* Make card take full width of slide */
  position: relative;
  /* NO MARGIN OR PADDING HERE - SwiperJS controls this via spaceBetween */
}

/* Individual Medication Card */
.trending-items-section .medication-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  padding: 8px;
  min-height: 280px;
  transition: transform 0.2s ease-in-out;
  width: 100%;
  /* Card takes full width of its parent swiper-slide */
  box-sizing: border-box;
  min-width: 0;
  border: 1px solid var(--card-border-color);
  /* Prevents flex item overflow issues with long content */
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

/* .trending-items-section .medication-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
} */

/* Strain Type Badge */
.trending-items-section .strain-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #f5f5f5;
  color: #666;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 8px;
  z-index: 2;
}

/* Product Image */
.trending-items-section .medication-image {
  width: 100px;
  height: 92px;
  object-fit: contain;
  border-radius: 6px;
  margin: 0 auto 8px auto;
  display: block;
}

/* Card Content */
.trending-items-section .medication-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.trending-items-section .medication-name {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 2px;
  color: #333;
  line-height: 1.2;
  text-align: left;
}

.trending-items-section .medication-manufacturer {
  font-size: 0.7rem;
  color: #999;
  text-align: left;
}

/* Star Rating */
.trending-items-section .star-rating-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.trending-items-section .star-rating {
  display: flex;
  align-items: center;
  gap: 4px;
}

.trending-items-section .star {
  font-size: 0.9rem;
  color: var(--highlight-color);
}

.trending-items-section .rating-value {
  font-size: 0.75rem;
  font-weight: 500;
  color: #333;
}

.trending-items-section .review-count {
  color: #999;
  font-size: 0.7rem;
}

/* THC/CBD Section */
.trending-items-section .thc-cbd-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  justify-content: flex-start;
  align-items: center;
}

.trending-items-section .thc-info,
.trending-items-section .cbd-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 50px;
}

.trending-items-section .thc-cbd-divider {
  width: 1px;
  height: 30px;
  background: #e0e0e0;
  margin: 0 6px;
}

.trending-items-section .thc-label-value,
.trending-items-section .cbd-label-value {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.trending-items-section .thc-label,
.trending-items-section .cbd-label {
  font-size: 0.65rem;
  color: #666;
  font-weight: 500;
}

.trending-items-section .thc-value,
.trending-items-section .cbd-value {
  font-size: 0.65rem;
  color: #333;
  font-weight: 600;
}

.trending-items-section .thc-bar-container,
.trending-items-section .cbd-bar-container {
  width: 50px;
  height: 3px;
  background: #f0f0f0;
  border-radius: 2px;
  overflow: hidden;
}

.trending-items-section .thc-bar {
  height: 100%;
  background: #10b981;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.trending-items-section .cbd-bar {
  height: 100%;
  background: #29B6F6;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Effects and Terpenes Section */
.trending-items-section .effects-terpenes-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  justify-content: flex-start;
}

.trending-items-section .terpene-item,
.trending-items-section .effect-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.trending-items-section .terpene-icon,
.trending-items-section .effect-icon {
  width: 12px;
  height: 12px;
  fill: #666;
  flex-shrink: 0;
}

.trending-items-section .terpene-item span,
.trending-items-section .effect-item span {
  font-size: 0.65rem;
  color: #666;
  font-weight: 500;
}

.trending-items-section .effect-divider {
  width: 1px;
  height: 12px;
  background: #e0e0e0;
  margin: 0 4px;
}

/* Price Section */
.trending-items-section .medication-price-section {
  margin-top: auto;
  padding-top: 8px;
}

.trending-items-section .medication-price {
  font-size: 0.8rem;
  color: #333;
  font-weight: 500;
  text-align: left;
}

.trending-items-section .price-prefix {
  font-size: 0.75rem;
  color: #333;
  font-weight: 500;
}

.trending-items-section .price-number {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--highlight-color);
}

.trending-items-section .price-unit {
  font-size: 0.75rem;
  color: #666;
  font-weight: 500;
}

/* Swiper Pagination Styling */
.trending-items-section .swiper-pagination {
  position: relative;
  /* Placed in normal flow below swiper */
  margin-top: 15px;
  /* Default Swiper bullets will apply or can be further styled here */
}

/* Skeleton Loader Styles for Trending Items */
.trending-items-loader {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  /* Padding handled by items or section */
  box-sizing: border-box;
  margin-bottom: 36px;
  /* Matches section's bottom margin */
}

.trending-loader-item {
  width: calc((100% - 40px) / 3);
  /* Desktop: 3 items, 20px spaceBetween (Swiper 1024 breakpoint) */
  background-color: #ffffff;
  /* Card background */
  border-radius: 18px;
  border: 1px solid var(--card-border-color);
  /* Match real medication card border */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  position: relative;
  box-sizing: border-box;
  margin-top: 0;
  /* Removed artificial overlap effect */
  min-height: 250px;
  /* Adjusted for content closer to real card */
}

.trending-loader-image {
  height: 92px;
  /* Match real medication image height */
  width: 100px;
  /* Match real medication image width */
  margin: 8px auto 8px auto;
  /* Match real medication image margin */
  background-color: #ebebeb;
  border-radius: 6px;
  /* Match real medication image border-radius */
  animation: pulse 1.5s infinite ease-in-out;
  display: block;
  /* Match real medication image display */
}

.trending-loader-info {
  padding: 0 8px 8px 8px;
  /* Match real medication card padding */
}

.trending-loader-text-line {
  background-color: #ebebeb;
  border-radius: 4px;
  animation: pulse 1.5s infinite ease-in-out;
}

.trending-loader-stats-area {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  margin-top: 52px;
  /* Space above stats */
}

.trending-loader-stat-item-placeholder {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Pulse Animation Keyframes */
@keyframes pulse {
  0% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.6;
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .trending-items-section {
    padding: 0;
    /* Remove padding for full-width feel */
    overflow-x: hidden !important;
    /* Still important to prevent accidental page overflow */
  }

  .trending-items-section .trending-items-swiper-container {
    /* padding and margin are 0 by default, overflow:hidden is critical */
  }

  /* .swiper-slide on mobile: No specific width, margin, or padding. 
     SwiperJS handles slide width via slidesPerView and spacing via spaceBetween. 
     Essential flex properties are inherited or remain from base. */

  .trending-items-section .medication-card {
    min-height: 240px;
  }

  .trending-items-section .medication-image {
    width: 56px;
    height: 78px;
  }

  .trending-items-section .medication-name {
    font-size: 0.8rem;
  }

  .trending-items-section .medication-manufacturer {
    font-size: 0.7rem;
  }
}

@media (max-width: 576px) {

  /* Card content adjustments for smaller screens */
  .trending-items-section .medication-card {
    min-height: 232px;
  }

  .trending-items-section .medication-image {
    width: 50px;
    height: 70px;
  }

  .trending-items-section .medication-name {
    font-size: 0.8rem;
  }

  .trending-items-section .medication-manufacturer {
    font-size: 0.7rem;
  }
}

/* Responsive Skeleton Loader Items */
@media (max-width: 767px) {
  .trending-loader-item {
    width: calc(50% - 7.5px);
    /* Mobile: 2 items, 15px spaceBetween (Swiper 0 breakpoint) */
    margin-top: 0;
    /* Removed artificial overlap */
    min-height: 180px;
    /* Adjusted for mobile */
  }

  .trending-loader-item:nth-child(3) {
    display: none;
    /* Hide third item on mobile */
  }

  .trending-loader-image {
    height: 78px;
    /* Match real medication image height at 768px breakpoint */
    width: 56px;
    /* Match real medication image width at 768px breakpoint */
    margin: 0 auto 8px auto;
    /* Match real medication image margin */
  }
}

/* Extra small devices - match real medication image dimensions */
@media (max-width: 576px) {
  .trending-loader-image {
    height: 70px;
    /* Match real medication image height at 576px breakpoint */
    width: 50px;
    /* Match real medication image width at 576px breakpoint */
  }
}

.trending-items-explore-btn {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}
.trending-items-explore-btn:hover {
  background: var(--primary-color-opacity);
  color: var(--secondary-color);
}