.custom-trailer-gallery {
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.custom-trailer-gallery .featured-item .item-holder {
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    position: relative;
    overflow: hidden;
}

.custom-trailer-gallery .featured-item .item-holder:before {
    content: '';
    position: absolute;
    top: -10px;  /* Slightly larger to cover blur edges */
    left: -10px;
    right: -10px;
    bottom: -10px;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    filter: blur(10px) brightness(0.5);
}

.custom-trailer-gallery .featured-item .item-holder img,
.custom-trailer-gallery .featured-item .item-holder iframe,
.custom-trailer-gallery .featured-item .item-holder video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1; /* Ensure content is above the blurred background */
}

/* Gallery Navigation Arrows */
.gallery-nav-holder {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    color: white;
    border: none;
    padding: 15px 10px;
    cursor: pointer;
    font-size: 20px;
    z-index: 999; /* Increased z-index to be above the image */
    transition: background-color 0.3s ease;
    display: block;
    width: 100%;
    pointer-events: none;
}

.gallery-nav {
    pointer-events: auto;
}

.gallery-nav {
    background: rgba(0, 0, 0, 0.2);
    color: #ccc;
    border: none;
    transition: all 0.3s ease;
}

.gallery-nav:hover,
.gallery-nav:focus,
.gallery-nav:active {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
}

.gallery-prev {
    float: left;
}

.gallery-next {
    float: right;
}

/* YouTube play button overlay */
.gallery-grid .gallery-link.youtube-thumbnail {
    position: relative;
}

.gallery-grid .gallery-link.youtube-thumbnail::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: 25px solid #fff;
    transition: border-left-color 0.3s ease;
}

.gallery-grid .gallery-link.youtube-thumbnail:hover::after {
    border-left-color: rgba(230, 33, 23);
}


.custom-trailer-gallery .gallery-grid {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
}

/* Default scrollbar state */
.gallery-grid::-webkit-scrollbar {
    height: 6px;
    opacity: 0.3;
}

.gallery-grid::-webkit-scrollbar-track {
    background: rgba(241, 241, 241, 0.3);
    border-radius: 3px;
}

.gallery-grid::-webkit-scrollbar-thumb {
    background: rgba(136, 136, 136, 0.3);
    border-radius: 3px;
    transition: background 0.3s ease;
}

/* Hover state */
.gallery-grid:hover::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.gallery-grid:hover::-webkit-scrollbar-thumb {
    background: #888;
}

/* For Firefox */
.gallery-grid {
    scrollbar-color: rgba(136, 136, 136, 0.3) rgba(241, 241, 241, 0.3);
}

.gallery-grid:hover {
    scrollbar-color: #888 #f1f1f1;
}

.gallery-grid .gallery-link {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

@media screen and (max-width: 992px) {
    .gallery-grid .gallery-link {
        flex: 0 0 calc(25% - 10px); /* 4 items per row */
    }
}

@media screen and (max-width: 768px) {
    .gallery-grid .gallery-link {
        flex: 0 0 calc(33.333% - 10px); /* 3 items per row */
    }
}


.gallery-grid .gallery-link img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.gallery-grid .gallery-link.current-featured {
    opacity: 1;
}

.gallery-grid .gallery-link:hover {
    opacity: 1;
}

.lightbox {
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

.lightbox-prev,
.lightbox-prev:focus,
.lightbox-next,
.lightbox-next:focus {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 15px;
    border: none;
    cursor: pointer;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.status-banner {
    position: absolute;
    top: 20px;
    left: -35px;
    background: #ff4444;
    color: white;
    padding: 8px 40px;
    transform: rotate(-45deg);
    z-index: 1000;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/*=============================================
=            Unit Carousel Styles            =
=============================================*/

.wh-unit-carousel-flexgrid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  width: 100%;
}

.wh-unit-carousel-flexgrid .wh-unit-carousel__item {
  box-sizing: border-box;
  margin: 0;
  aspect-ratio: 320 / 270;
  display: flex;
  flex-direction: column;
}

.wh-unit-carousel-flexgrid.columns-1 .wh-unit-carousel__item {
  flex: 0 0 calc(100% - 7.5px);
  max-width: calc(100% - 7.5px);
}

.wh-unit-carousel-flexgrid.columns-2 .wh-unit-carousel__item {
  flex: 0 0 calc(50% - 7.5px);
  max-width: calc(50% - 7.5px);
}

.wh-unit-carousel-flexgrid.columns-3 .wh-unit-carousel__item {
  flex: 0 0 calc(33.333% - 7.5px);
  max-width: calc(33.333% - 10px);
}

.wh-unit-carousel-flexgrid.columns-4 .wh-unit-carousel__item {
  flex: 0 0 calc(25% - 7.5px);
  max-width: calc(25% - 11.3px);
}

.wh-unit-carousel__item, .unit-card__link {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
}

.unit-card.post-block-1 {
  box-shadow: 0 2px 1px rgba(0,0,0,0.3), 0 0 4px rgba(0,0,0,0.1);
  background: #fff;
  border-radius: 0;
  position: relative;
  z-index: 1;
}

.unit-card__image.featured-cover {
  width: 100%;
  flex: 0 0 auto;
  background: center center no-repeat;
  background-size: contain;
  position: relative;
  display: block;
}

.unit-card__content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.post-block-1 .meta {
  text-align: left;
  font-size: 11px;
  min-height: 18px;
  position: absolute;
  top: 12px;
  left: 10px;
  margin: 0;
}

.post-block-1 .meta span {
  background: rgba(255,255,255,0.75);
  padding: 2px 6px;
  border-radius: 5px;
  text-transform: uppercase;
  transition: background 0.25s ease;
  font-weight: 500;
  font-size: 11px;
}

.post-block-1 h5, .trailer-details {
  flex: 0 0 auto;
}

.post-block-1 h5 {
  font-size: 13px!important;
  font-weight: 100;
  padding: 10px 10px 0 10px;
  text-align: left;
  width: 100%;
  height: 30px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.trailer-details {
  display: flex;
  border-top: #ccc 1px solid;
  min-height: 36px;
  box-sizing: border-box;
  width: 100%;
  padding: 0;
  margin: 0;
}

.trailer-cost {
  background: #333;
  color: #fff;
  font-weight: bold;
  padding-left: 10px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  font-size: 16px;
  line-height: 36px;
  padding-bottom: 5px;
  text-align: left;
}

.view-trailer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  box-sizing: border-box;
  padding: 0;
}

.view-trailer .unit-card__view {
  border-left: 1px solid #ccc;
  padding: 10px;
  font-size: 14px;
  color: #2a5d8f;
  background: #fff;
  text-align: center;
  font-weight: 500;
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-transform: uppercase;
  transition: background 0.25s ease;
}

.view-trailer .unit-card__view:hover {
  background: #eaf4fb;
}

/* Full-width view button when no price */
.trailer-details .view-trailer.full-width {
  flex: 1 1 100%;
  margin-left: 0;
  justify-content: center;
}
.trailer-details .view-trailer.full-width .unit-card__view {
  border-left: 0;
}

/* Swiper carousel styles */
.carousel-wrapper {
    position: relative;
    width: 100%;
}

.wh-unit-carousel.swiper-container {
  padding: 0 2px 48px;
  position: relative;
  overflow: hidden;
  max-width: 100%;
}

.wh-unit-carousel .swiper-wrapper {
  box-sizing: border-box;
}

.wh-unit-carousel .swiper-slide {
  height: auto;
  display: block;
}

.carousel-wrapper .swiper-button-next,
.carousel-wrapper .swiper-button-prev {
  color: #777777;
  width: 56px;
  height: 56px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2em;
  padding: 0;
}

.carousel-wrapper .swiper-button-prev {
  left: -48px;
}

.carousel-wrapper .swiper-button-next {
  right: -48px;
}

.carousel-wrapper .swiper-button-next:after,
.carousel-wrapper .swiper-button-prev:after {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
}

.carousel-wrapper .swiper-button-prev:after {
  background-image: url('data:image/svg+xml;utf8,<svg fill="%232a5d8f" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>');
}

.carousel-wrapper .swiper-button-next:after {
  background-image: url('data:image/svg+xml;utf8,<svg fill="%232a5d8f" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6z"/></svg>');
}

.wh-unit-carousel .swiper-pagination {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -24px;
  text-align: center;
  z-index: 2;
}

.wh-unit-carousel__item.unit-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
}

.unit-card__image {
  aspect-ratio: 4 / 3;
  width: 100%;
  height: auto;
  background: #f7f7f7;
  overflow: hidden;
  position: relative;
  display: block;
}

.unit-card__image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 800px) {
  .wh-unit-carousel-flexgrid.columns-3 .wh-unit-carousel__item {
    flex: 0 0 calc(50% - 7.5px);
    max-width: calc(50% - 7.5px);
  }
  .wh-unit-carousel-flexgrid.columns-4 .wh-unit-carousel__item {
    flex: 0 0 calc(50% - 7.5px);
    max-width: calc(50% - 7.5px);
  }
}
@media (max-width: 768px) {
  .wh-unit-carousel-flexgrid.columns-3 .wh-unit-carousel__item {
    flex: 0 0 calc(100% - 7.5px);
    max-width: calc(100% - 7.5px);
  }
  .wh-unit-carousel-flexgrid.columns-4 .wh-unit-carousel__item {
    flex: 0 0 calc(100% - 7.5px);
    max-width: calc(100% - 7.5px);
  }

  .carousel-wrapper .swiper-button-prev {
    left: -40px;
  }
  
  .carousel-wrapper .swiper-button-next {
    right: -40px;
  }
}

/* Reviews Shortcode Styles */
.wh-reviews-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin: 32px 0;
}

.wh-review-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 24px 24px;
    box-shadow: 0 4px 16px rgba(60, 64, 67, 0.15);
    display: flex;
    flex-direction: column;
    min-height: 260px;
    position: relative;
    transition: box-shadow 0.3s;
}

.wh-review-card:hover {
    box-shadow: 0 8px 24px rgba(60, 64, 67, 0.18);
}

.wh-review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.wh-review-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.wh-review-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
    background: #f1f3f4;
}

.wh-review-user-info {
    display: flex;
    flex-direction: column;
}

.wh-review-name {
    font-weight: 600;
    color: #202124;
    font-size: 16px;
    line-height: 1.2;
}

.wh-review-handle {
    color: #5f6368;
    font-size: 13px;
    font-weight: 400;
    margin-top: 2px;
}

.wh-review-google-logo {
    margin-left: 8px;
    display: flex;
    align-items: center;
}

.wh-google-logo {
    width: 28px;
    height: 28px;
    display: block;
}

.wh-review-stars {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin: 0 0 14px 0;
    font-size: 20px;
    gap: 2px;
}

.wh-star {
    color: #e0e0e0;
    font-size: 22px;
    line-height: 1;
}

.wh-star.filled {
    color: #fbbc04;
}

.wh-review-content {
    color: #202124;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 0;
    margin-top: 0;
}

.wh-reviews-pagination {
    margin-top: 30px;
    text-align: center;
}

.wh-reviews-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #5f6368;
    text-decoration: none;
    transition: all 0.3s ease;
}

.wh-reviews-pagination .page-numbers.current {
    background-color: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

.wh-reviews-pagination .page-numbers:hover:not(.current) {
    background-color: #f1f3f4;
}

.wh-reviews-empty {
    text-align: center;
    padding: 40px;
    color: #5f6368;
    font-size: 16px;
}

/* Responsive styles */
@media (max-width: 1024px) {
    .wh-reviews-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .wh-reviews-container {
        grid-template-columns: 1fr;
    }
    .wh-review-card {
        padding: 20px 12px 16px 12px;
    }
    .wh-review-avatar {
        width: 40px;
        height: 40px;
    }
}
