/* Frosted Flakes Theme */
.theme-frosted-flakes .seeds-page-section .bazaarvoice-block {
  --bv-brand-primary: #0061af;
  --bv-block-bg: #eaf6ff;
  --bv-custom-title-color: #0061af;
  --bv-button-bg: #0061af;
  --bv-button-text: #fff;
  --bv-button-hover-bg: #fff;
  --bv-button-hover-text: #0061af;
  --bv-button-border: #0061af;
}

/* Special K Theme */
.theme-special-k .seeds-page-section .bazaarvoice-block {
  --bv-brand-primary: #ED1941;
  --bv-block-bg: #FFF5F7;
  --bv-custom-title-color: #ED1941;
  --bv-button-bg: #ED1941;
  --bv-button-text: #fff;
  --bv-button-hover-bg: #fff;
  --bv-button-hover-text: #ED1941;
  --bv-button-border: #ED1941;
}

/* Raisin Bran Theme */
.theme-raisin-bran .seeds-page-section .bazaarvoice-block {
  --bv-brand-primary: #64154C;
  --bv-block-bg: #EEEAED;
  --bv-custom-title-color: #64154C;
  --bv-button-bg: #64154C;
  --bv-button-text: #fff;
  --bv-button-hover-bg: #fff;
  --bv-button-hover-text: #64154C;
  --bv-button-border: #64154C;
}

/* Frosted Mini-Wheats Theme */
.theme-frosted-mini-wheats .seeds-page-section .bazaarvoice-block {
  --bv-brand-primary: #F38231;
  --bv-block-bg: #FFF5EC;
  --bv-custom-title-color: #F38231;
  --bv-button-bg: #F38231;
  --bv-button-text: #fff;
  --bv-button-hover-bg: #fff;
  --bv-button-hover-text: #E0522F;
  --bv-button-border: #F38231;
}

/* Skeleton loading animation */
@keyframes skeleton-pulse {
  0% {
    background-color: #f0f0f0;
  }

  50% {
    background-color: #e0e0e0;
  }

  100% {
    background-color: #f0f0f0;
  }
}


/* Show skeletons while loading data */
.bv-container-wrapper[data-loading] {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 400px;
}

/* Hide skeletons when content is ready */
.bv-container-wrapper.bv-ready {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: auto;
}

/* Hide container when filter times out */
.bv-container-wrapper.bv-timeout {
  display: none !important;
  visibility: hidden !important;
}

/* Show BV reviews only when ready */
.bv-ready .bv-reviews {
  display: block;
}


/* Skeleton container */
.bv-skeleton-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2rem 0;
}

.bv-skeleton-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bv-skeleton-title {
  width: 40%;
  height: 1.5rem;
  border-radius: 4px;
  background-color: #e8e8e8;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.bv-skeleton-stat {
  width: 100%;
  height: 2rem;
  border-radius: 4px;
  background-color: #e8e8e8;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.bv-skeleton-bar {
  width: 100%;
  height: 0.8rem;
  border-radius: 4px;
  background-color: #e8e8e8;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* Skeleton carousel - 3 review card placeholders */
.bv-skeleton-carousel {
  display: flex;
  gap: 1.5rem;
  overflow-x: hidden;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

.bv-skeleton-card {
  flex: 0 0 calc(33.333% - 2rem);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgb(0 0 0 / 8%);
}

/* User section skeleton */
.bv-skeleton-card > div:first-child {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.bv-skeleton-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background-color: #e8e8e8;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.bv-skeleton-user-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.bv-skeleton-name {
  width: 70%;
  height: 1rem;
  border-radius: 4px;
  background-color: #e8e8e8;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.bv-skeleton-date {
  width: 50%;
  height: 0.8rem;
  border-radius: 4px;
  background-color: #e8e8e8;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* Review title skeleton */
.bv-skeleton-review-title {
  width: 90%;
  height: 1rem;
  border-radius: 4px;
  background-color: #e8e8e8;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  margin-bottom: 0.5rem;
}

/* Review description skeleton */
.bv-skeleton-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.bv-skeleton-line {
  width: 100%;
  height: 0.75rem;
  border-radius: 4px;
  background-color: #e8e8e8;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.bv-skeleton-line.short {
  width: 85%;
}

/* Rating skeleton */
.bv-skeleton-rating {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f0f0f0;
}

.bv-skeleton-stars {
  width: 60px;
  height: 1rem;
  border-radius: 4px;
  background-color: #e8e8e8;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.bv-skeleton-rating-value {
  width: 40px;
  height: 1rem;
  border-radius: 4px;
  background-color: #e8e8e8;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  margin-left: auto;
}

/* Hide skeletons when content is ready */
.bv-ready .bv-skeleton-container {
  display: none;
}

/* Responsive skeleton carousel */
@media (width <= 1200px) {
  .bv-skeleton-card {
    flex: 0 0 calc(50% - 0.75rem);
  }
}

@media (width <= 768px) {
  .bv-skeleton-carousel {
    gap: 1rem;
  }

  .bv-skeleton-card {
    flex: 0 0 calc(100% - 1rem);
  }

  .bv-skeleton-title {
    width: 60%;
  }

  .bv-skeleton-name {
    width: 80%;
  }

  .bv-skeleton-stars {
    width: 50px;
  }
}

.bazaarvoice-block {
  margin: 0 auto;
  max-width: 1440px;
}

.seeds-page-section .bazaarvoice-block {
  background: var(--bv-block-bg);
  border-radius: 16px;
  padding: 3.5rem;
}

.bv-content-wrapper {
  display: flex;
  align-items: stretch;
  gap: 2rem;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}

.bv-left-column:empty {
  display: none;
}

.bv-left-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  flex: 0 0 300px;
  min-width: 0;
  justify-content: center;
}

.bv-right-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  flex: 1;
  min-width: 300px;
  background: #fff;
  border-radius: 24px;
}

.seeds-page-section .bv-right-column {
  padding: 1rem;
}

.bv-product-image-wrapper {
  background: #fff;
  border-radius: 24px;
  padding: 2rem 2rem 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  flex-shrink: 0;
  position: relative;
}

.bv-product-image {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.bv-product-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 1rem;
  background-color: #F7F7F7;
  border-radius: 0 0 24px 24px;
  text-align: center;
  margin: 0;
}

.bv-product-title h3 {
  margin: 0;
  font-family: Montserrat, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #333;
  line-height: 1.4;
}

.bv-ratings-content-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bv-headline-wrapper {
  background-color: var(--primary-color);
  padding: 3.125rem 0;
  margin-top: 3rem;
}

.bv-headline {
  color: var(--white) !important;
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 1.5rem;
}

.bv-headline-plain {
  color: var(--bv-custom-title-color) !important;
  background: none;
  font-family: Montserrat, sans-serif;
  font-size: 40px;
  font-weight: 800;
  line-height: 100%;
  letter-spacing: 0%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 2rem;
  min-height: 40px;
  gap: 1.5rem;
  position: relative;
}

/* Container wrapper for CLS prevention - force skeleton visibility */
.bv-container-wrapper {
  /* Isolate rendering to prevent affecting parent/sibling layouts */
  contain: layout style paint;

  /* Smooth transition when content loads */
  transition: min-height 0.3s ease-out, opacity 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;

  /* Force skeleton visibility with !important */
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Loading state - shows placeholder while reviews load */
.bv-container-wrapper[data-loading="true"] {
  /* Reserve space only while loading to prevent layout shift */
  min-height: 600px;
  opacity: 1;
  visibility: visible;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* Loading spinner animation */
.bv-container-wrapper[data-loading="true"]::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #e0e0e0;
  border-top-color: var(--primary-color, #06c);
  border-radius: 50%;
  animation: bv-spinner 0.8s linear infinite;
}

@keyframes bv-spinner {
  to {
    transform: rotate(360deg);
  }
}

.bv-reviews {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;

  /* Ensure reviews content doesn't cause layout shift */
  contain: layout style;
}

.seeds-page-section .bv-reviews {
  padding: unset !important;
}

/* Ensure BazaarVoice widget respects container constraints */
.bazaarvoice-block [data-bv-show],
.bazaarvoice-block .bv-reviews>* {
  contain: layout style;
  width: 100%;
}

/* Hide all BV content until ready (prevents flicker) */
/* stylelint-disable selector-class-pattern */
.bazaarvoice-block .bv-container-wrapper:not(.bv-ready) [data-bv-show],
.bazaarvoice-block .bv-container-wrapper:not(.bv-ready) .bv-reviews,
.bazaarvoice-block .bv-container-wrapper:not(.bv-ready) .BVRRContainer,
.bazaarvoice-block .bv-container-wrapper:not(.bv-ready) .bv-container,
.bazaarvoice-block .bv-container-wrapper:not(.bv-ready) .bv_rating_content1,
.bazaarvoice-block .bv-container-wrapper:not(.bv-ready) .bv_rating_content2,
.bazaarvoice-block .bv-container-wrapper:not(.bv-ready) .bv_rating_content3 {
  opacity: 0;
  visibility: hidden;
}

/* stylelint-enable selector-class-pattern */

/* Show content once ready */
/* stylelint-disable selector-class-pattern */
.bazaarvoice-block .bv-container-wrapper.bv-ready [data-bv-show],
.bazaarvoice-block .bv-container-wrapper.bv-ready .bv-reviews,
.bazaarvoice-block .bv-container-wrapper.bv-ready .BVRRContainer,
.bazaarvoice-block .bv-container-wrapper.bv-ready .bv-container,
.bazaarvoice-block .bv-container-wrapper.bv-ready .bv_rating_content1,
.bazaarvoice-block .bv-container-wrapper.bv-ready .bv_rating_content2,
.bazaarvoice-block .bv-container-wrapper.bv-ready .bv_rating_content3 {
  opacity: 1;
  visibility: visible;
}

/* stylelint-enable selector-class-pattern */

/* Improve rendering performance during load */
/* stylelint-disable-next-line selector-class-pattern */
.bazaarvoice-block .bv-container-wrapper .BVRRContainer,
.bazaarvoice-block .bv-container-wrapper .bv-container {
  contain: layout style paint;
}

/* View More Button */
.bv-button-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
  width: 100%;
}

.bv-view-more-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.0625rem;
  padding: 1rem 2.25rem 1rem 3rem;
  background-color: var(--bv-button-bg);
  color: var(--bv-button-text) !important;
  text-decoration: none !important;
  border-radius: 500px;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.5rem;
  transition: all 240ms ease;
  border: 2px solid var(--bv-button-border);
  cursor: pointer;
}

.bv-view-more-button:hover {
  background-color: var(--bv-button-hover-bg);
  color: var(--bv-button-hover-text) !important;
  border: 2px solid var(--bv-button-border);
  box-shadow: 0 10px 18px rgb(0 0 0 / 10%);
}

.bv-view-more-button:focus {
  outline: 2px solid var(--bv-button-border);
  border-color: var(--bv-button-text);
  box-shadow: 0 0 0 3px rgb(0 97 175 / 10%);
}

.bv-button-text {
  color: inherit;
  font-size: 1.5rem;
  font-weight: 600;
}

.bv-button-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: inherit;
  flex-shrink: 0;
}

/* Review Carousel - Non-product pages */
.bv-carousel-wrapper {
  display: block;
  width: 100%;
  position: relative;
  margin-top: 2rem;
}

.bv-carousel-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  background: #fff;
  border: 2px solid var(--bv-brand-primary);
  border-radius: 999px;
  cursor: pointer;
  color: var(--bv-brand-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
  padding: 0;
  z-index: 20;
  font-size: 2rem;
}

.bv-carousel-arrow-left {
  left: 12px;
}

.bv-carousel-arrow-right {
  right: 12px;
}

.bv-carousel-arrow:hover {
  background-color: var(--primary-color);
  color: #fff !important;
}

.bv-carousel-arrow-hidden {
  visibility: hidden;
  pointer-events: none;
}

.bv-reviews-carousel {
  display: flex;
  justify-content: flex-start;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  margin-top: 2rem;
  scrollbar-width: none;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.bv-reviews-carousel.bv-reviews-carousel-centered {
  justify-content: center;
}

.bv-reviews-carousel::-webkit-scrollbar {
  display: none;
}

.bv-review-card {
  flex: 0 0 calc(33.333% - 2rem);
  min-width: 0;
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgb(0 0 0 / 8%);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.bv-review-card:hover {
  box-shadow: 0 4px 16px rgb(0 0 0 / 12%);
  transform: translateY(-2px);
}

.bv-review-user {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.bv-review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  width: 100%;
}

.bv-review-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.bv-review-user-info {
  flex: 1;
  min-width: 0;
}

.bv-review-name {
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: 0.87rem;
  line-height: 1;
  margin: 0;
  color: #000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}

.bv-review-date {
  font-size: 0.85rem;
  color: #666;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.bv-review-title {
  font-family: Montserrat, sans-serif;
  font-size: 1.1563rem;
  font-weight: 700 !important;
  line-height: 1.06;
  margin: 0.75rem 0;
  color: #000 !important;
}

.bv-review-description {
  font-family: Montserrat, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.5;
  color: #000;
  margin: 0.75rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}

.bv-review-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f0f0f0;
}

.bv-review-stars {
  color: #FBBC05;
  font-size: 1rem;
  letter-spacing: 0.2em;
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.bv-review-stars svg {
  width: 16px;
  height: 15px;
  display: inline-block;
}

.bv-review-rating-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #666;
  margin-left: auto;
}

/* Responsive carousel */
@media (width <= 1200px) {
  .bv-review-card {
    flex: 0 0 calc(50% - 0.75rem);
  }
}

@media (width <= 1024px) {
  .bv-content-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .bv-left-column {
    flex: 0 0 auto;
    width: 100%;
  }

  .bv-right-column {
    width: 100%;
    flex: 0 0 auto;
    justify-content: flex-start;
  }

  .bv-reviews-carousel {
    gap: 1.25rem;
  }
}

@media (width <=768px) {
  .seeds-page-section .bazaarvoice-block {
    padding: 3.5rem 1rem;
  }

  .bv-content-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .bv-left-column {
    flex: 0 0 auto;
    width: 100%;
  }

  .bv-right-column {
    width: 100%;
    flex: 0 0 auto;
    justify-content: flex-start;
  }

  .bv-product-image-wrapper {
    order: -1;
  }

  .bv-carousel-wrapper {
    padding: 0;
    position: relative;
    margin: 1.5rem 0 0;
  }

  .bv-carousel-arrow {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    font-size: 1.5rem;
  }

  .bv-carousel-arrow-left {
    left: 12px;
  }

  .bv-carousel-arrow-right {
    right: 12px;
  }

  .bv-reviews-carousel {
    gap: 0.75rem;
    margin-top: 0;
    scroll-padding: 3.5rem;
  }

  .bv-review-card {
    flex: 0 0 calc(100vw - 7rem);
    min-height: auto;
  }

  .bv-review-title {
    font-size: 0.95rem;
  }

  .bv-review-description {
    font-size: 0.85rem;
  }

  .bv-headline-plain {
    font-size: 24px;
  }
}