/**
 * Kloira - Product Gallery Styles
 * Matches Figma Design EXACTLY: 1440px layout, 792px gallery width
 *
 * @package Onviqa
 * @since 1.0.0
 */

/* ==========================================================================
   CSS Variables for Gallery
   ========================================================================== */

:root {
  --ksq-container-width: 1440px;
  --ksq-gallery-width: 792px;
  --ksq-gallery-height: 680px;
  --ksq-thumb-size: 100px;
  --ksq-thumb-gap: 12px; /* Figma: gap 12px */
  --ksq-gallery-bg: #d9d9d9; /* Figma: background #D9D9D9 */
  --ksq-gallery-radius: 20px; /* Figma: border-radius 20px */
  --ksq-dot-size: 4px; /* Figma: 4px dots */
  --ksq-dot-active: #ffffff;
  --ksq-dot-inactive: rgba(255, 255, 255, 0.5);
  --ksq-trustpilot-green: #00b67a;
  --ksq-badge-orange: #ff6a00;
  --ksq-text-dark: #111111;
  --ksq-text-gray: #777777;
}

/* ==========================================================================
   Remove Extra Spacing from WooCommerce Wrapper
   Gallery starts 220px from top (156px headers + 64px content spacing)
   ========================================================================== */

.woocommerce-wrapper {
  padding-top: 0 !important;
}

.woocommerce-container {
  padding-top: 0 !important;
}

/* ==========================================================================
   Product Page Breadcrumb - 16px Regular, Black links, #666 active
   ========================================================================== */

/* Hide empty WooCommerce notices wrapper spacing */
.single-product .woocommerce-notices-wrapper:empty {
  display: none;
}

/* ==========================================================================
   Product Breadcrumb - Figma: Frame 1437258696
   ========================================================================== */

.ksq-product-breadcrumb {
  height: 60px;
  display: flex;
  align-items: center;
  margin: 0 auto;
  padding: 0;
  max-width: 1440px;
  width: 100%;
}

/* Figma: flex, row, center aligned, gap: 12px */
.ksq-product-breadcrumb .woocommerce-breadcrumb {
  color: #222222;
  font-family: "Roboto Flex", sans-serif;
  font-size: 16px; /* Figma: 16px */
  font-style: normal;
  font-weight: 400;
  line-height: 19px; /* Figma: line-height 19px */
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px; /* Figma: gap 12px */
}

/* Shop All link - Figma: 16px, #222222 */
.ksq-product-breadcrumb .woocommerce-breadcrumb a {
  color: #222222;
  font-family: "Roboto Flex", sans-serif;
  font-size: 16px; /* Figma: 16px */
  font-style: normal;
  font-weight: 400;
  line-height: 19px; /* Figma: line-height 19px */
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.ksq-product-breadcrumb .woocommerce-breadcrumb a:hover,
.ksq-product-breadcrumb .woocommerce-breadcrumb a:focus {
  color: var(--ksq-badge-orange);
  text-decoration: none;
}

/* Separator Arrow - Figma: 4px × 8px, 1px border #222222 */
.ksq-product-breadcrumb .woocommerce-breadcrumb .breadcrumb-separator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 6px;
  height: 10px;
  margin: 0;
  font-size: 0;
  text-indent: -9999px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='10' viewBox='0 0 6 10' fill='none'%3E%3Cpath d='M1 1L5 5L1 9' stroke='%23222222' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 6px 10px;
  background-repeat: no-repeat;
  background-position: center;
}

/* HOME ICON - Figma: 22px × 22px (inner icon 14×16px with 1px border #222222) */
.ksq-product-breadcrumb .woocommerce-breadcrumb > span:first-child a,
.ksq-product-breadcrumb .woocommerce-breadcrumb > a:first-child {
  display: inline-block;
  width: 22px; /* Figma: 22px */
  height: 22px; /* Figma: 22px */
  text-indent: -9999px;
  overflow: hidden;
  /* House icon: 14px wide × 16px tall, centered in 22×22 container */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='none'%3E%3Cpath d='M4 9.5L11 3.5L18 9.5V17.5C18 18.0523 17.5523 18.5 17 18.5H5C4.44772 18.5 4 18.0523 4 17.5V9.5Z' stroke='%23222222' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M9 18.5V12.5H13V18.5' stroke='%23222222' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 22px 22px;
  background-repeat: no-repeat;
  /* Raised 1px: optical centring of the house next to the text (matches breadcrumbs.css) */
  background-position: center calc(50% - 1px);
  vertical-align: middle;
}

.ksq-product-breadcrumb .woocommerce-breadcrumb > span:first-child a:hover,
.ksq-product-breadcrumb .woocommerce-breadcrumb > a:first-child:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='none'%3E%3Cpath d='M4 9.5L11 3.5L18 9.5V17.5C18 18.0523 17.5523 18.5 17 18.5H5C4.44772 18.5 4 18.0523 4 17.5V9.5Z' stroke='%23ff6a00' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M9 18.5V12.5H13V18.5' stroke='%23ff6a00' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Current product name (last item) - Figma: 16px, #666666 */
.ksq-product-breadcrumb .woocommerce-breadcrumb > span:last-of-type {
  color: #666666; /* Figma: color #666666 */
  font-family: "Roboto Flex", sans-serif;
  font-size: 16px; /* Figma: 16px */
  font-style: normal;
  font-weight: 400;
  line-height: 19px; /* Figma: line-height 19px */
}

/* ==========================================================================
   Single Product Layout - Gallery 792px (55%), Summary 45%
   ========================================================================== */

.single-product-layout {
  display: grid;
  grid-template-columns: var(--ksq-gallery-width) 1fr;
  gap: 40px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

.single-product-layout__gallery {
  width: 100%;
  max-width: var(--ksq-gallery-width);
  /* Sticky behavior for desktop */
  position: sticky;
  top: 150px; /* Header + trustbar + gap */
  height: fit-content;
  align-self: flex-start;
}

.single-product-layout__summary {
  padding-top: 0;
}

/* ==========================================================================
   Gallery Wrapper (Thumbnails + Main Gallery)
   ========================================================================== */

.ksq-gallery-wrapper {
  display: flex;
  gap: 12px;
  width: 100%;
}

/* ==========================================================================
   Vertical Thumbnails (Left Side)
   ========================================================================== */

.ksq-gallery-thumbs {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--ksq-thumb-gap);
  width: var(--ksq-thumb-size);
  flex-shrink: 0;
  max-height: var(--ksq-gallery-height);
  overflow-y: auto;
  /* Hide scrollbar - Figma design shows no visible scrollbar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

/* Hide scrollbar for Chrome, Safari, Opera */
.ksq-gallery-thumbs::-webkit-scrollbar {
  display: none;
}

.ksq-gallery-thumb {
  width: var(--ksq-thumb-size);
  height: var(--ksq-thumb-size);
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s ease;
  flex-shrink: 0;
  background-color: lightgray;
  background-size: cover;
  background-position: 50%;
  background-repeat: no-repeat;
  padding: 0;
}

.ksq-gallery-thumb:hover {
  border-color: #999;
}

.ksq-gallery-thumb.active {
  border-color: #ff5100;
}

.ksq-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   Main Product Gallery
   ========================================================================== */

.ksq-product-gallery {
  position: relative;
  width: 100%;
  height: var(--ksq-gallery-height);
  flex: 1;
  background-color: var(--ksq-gallery-bg);
  border-radius: var(--ksq-gallery-radius);
  overflow: hidden;
}

/* ==========================================================================
   Bestseller Badge - Figma: Frame 1437258699
   137×37px, border-radius 100px, background #FF5100
   ========================================================================== */

.ksq-gallery__badge {
  position: absolute;
  top: 24px; /* Figma: top 24px from gallery edge */
  left: 24px; /* Figma: left 24px from gallery edge */
  z-index: 10;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px; /* Figma: gap 8px */
  padding: 8px 16px; /* Results in ~37px height */
  border-radius: 100px; /* Figma: pill shape */
  background: #ff5100; /* Figma: background #FF5100 */
  color: #ffffff;
  font-family: "Roboto Flex", sans-serif;
  font-size: 18px; /* Figma: 18px */
  font-style: normal;
  font-weight: 400;
  line-height: 21px; /* Figma: line-height 21px */
}

.ksq-gallery__badge--bestseller {
  background: #ff5100;
  color: #ffffff;
}

/* Crown icon - Figma: 20×20px */
.ksq-gallery__badge svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ==========================================================================
   Wishlist Button - Figma: Group 15
   50×50px circle, white background, shadow 2px 2px 4px rgba(0,0,0,0.12)
   ========================================================================== */

.ksq-gallery__wishlist {
  position: absolute;
  top: 24px; /* Figma: aligned with badge top */
  right: 24px; /* Figma: 24px from right */
  z-index: 10;
  width: 50px; /* Figma: 50px */
  height: 50px; /* Figma: 50px */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.12); /* Figma: shadow */
}

.ksq-gallery__wishlist:hover {
  transform: scale(1.05);
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.16);
}

/* Heart icon - Figma: 30×30px with 2px stroke */
.ksq-gallery__wishlist svg {
  width: 30px; /* Figma: 30px */
  height: 30px; /* Figma: 30px */
  color: #111111;
  transition: all 0.2s ease;
}

.ksq-gallery__wishlist.active svg {
  fill: var(--ksq-badge-orange);
  color: var(--ksq-badge-orange);
}

.ksq-gallery__wishlist.active {
  border-color: var(--ksq-badge-orange);
}

.ksq-gallery__wishlist.active svg path {
  fill: var(--ksq-badge-orange);
  stroke: var(--ksq-badge-orange);
}

/* ==========================================================================
   Gallery Slider
   ========================================================================== */

.ksq-gallery__slider {
  position: relative;
  width: 100%;
  height: var(--ksq-gallery-height);
  overflow: hidden;
}

.ksq-gallery__track {
  position: relative;
  width: 100%;
  height: 100%;
}

.ksq-gallery__slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.6s ease-in-out,
    visibility 0.6s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ksq-gallery__slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

/* LCP Image - Make visible immediately for Core Web Vitals
   Shows behind active slide (video), but visible for LCP measurement */
.ksq-gallery__slide--lcp {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

/* When JS has initialized and user navigated, remove LCP special visibility */
.ksq-gallery--js-ready .ksq-gallery__slide--lcp:not(.active) {
  opacity: 0;
  visibility: hidden;
  z-index: 0;
}

.ksq-gallery__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* The slide is a flex container with align-items:center, which makes this
	   image a flex item whose percentage height WebKit may resolve against an
	   auto cross-size and collapse to zero - the image then has no box for
	   object-fit to cover and the container's grey shows through. Pinning the
	   image to the slide box takes it out of that calculation entirely; the
	   slide is already position:absolute and fills the track. */
  position: absolute;
  top: 0;
  left: 0;
  align-self: stretch;
}

.ksq-gallery__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ksq-gallery__video-indicator {
  display: none;
}

/* ==========================================================================
   Slider Dots - Figma: Group 10
   Container: 116×20px, rgba(255,255,255,0.16) bg, border-radius 40px
   ========================================================================== */

.ksq-gallery__dots {
  position: absolute;
  bottom: 24px; /* Figma positioning */
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px; /* Figma: gap 8px */
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.16); /* Figma: semi-transparent bg */
  border-radius: 40px; /* Figma: pill container */
}

/* Dots - Figma: 4×4px circles */
.ksq-gallery__dot {
  width: 4px; /* Figma: 4px */
  height: 4px; /* Figma: 4px */
  border-radius: 10px; /* Figma: border-radius 10px */
  background-color: rgba(255, 255, 255, 0.5); /* Figma: rgba(255,255,255,0.5) */
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ksq-gallery__dot:hover {
  background-color: rgba(255, 255, 255, 0.8);
}

/* Active dot - Figma: 20×4px, white, border-radius 10px */
.ksq-gallery__dot.active {
  background-color: #ffffff; /* Figma: white */
  width: 20px; /* Figma: 20px wide */
  height: 4px; /* Figma: 4px height */
  border-radius: 10px; /* Figma: border-radius 10px */
}

/* ==========================================================================
   Gallery Navigation Arrows - Tiny Subtle Design
   ========================================================================== */

.ksq-gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 0;
}

.ksq-product-gallery:hover .ksq-gallery__arrow {
  opacity: 1;
}

.ksq-gallery__arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ksq-gallery__arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.ksq-gallery__arrow--prev {
  left: 12px;
}

.ksq-gallery__arrow--next {
  right: 12px;
}

.ksq-gallery__arrow svg {
  width: 16px;
  height: 16px;
  color: #333;
  flex-shrink: 0;
}

.ksq-gallery__arrow:hover svg {
  color: #111;
}

/* Show arrows on touch devices */
@media (hover: none) and (pointer: coarse) {
  .ksq-gallery__arrow {
    opacity: 0.8;
    width: 32px;
    height: 32px;
  }

  .ksq-gallery__arrow svg {
    width: 14px;
    height: 14px;
  }
}

/* Dragging cursor state */
.ksq-gallery__slider {
  cursor: grab;
}

.ksq-gallery__slider.is-dragging {
  cursor: grabbing;
}

.ksq-gallery__slider.is-dragging .ksq-gallery__slide {
  pointer-events: none;
}

/* ==========================================================================
   Trust Section - Figma: Group 1437258732
   Width: 669px, aligned below main gallery image
   Layout: Trustpilot (303.6px) | Rating Circles (327px)
   ========================================================================== */

.ksq-trust-section {
  margin-top: 38px; /* Figma: 38px spacing below gallery */
  width: 100%;
  max-width: calc(var(--ksq-gallery-width) - var(--ksq-thumb-size) - 12px);
  margin-left: calc(var(--ksq-thumb-size) + 12px);
  display: flex;
  align-items: flex-start;
  gap: 38px; /* Space between Trustpilot and Rating Circles */
}

/* ==========================================================================
   Trustpilot Bar - Figma: Group 1437258727
   Width: 303.6px, height: 63.73px
   ========================================================================== */

.ksq-trustpilot-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 304px; /* Figma: 303.6px */
}

/* Top Row: Trustpilot Logo + Stars - Figma: Group 1437258726 */
.ksq-trustpilot-bar__logo-row {
  display: flex;
  align-items: center;
  gap: 24px; /* Gap between logo and stars */
}

/* Trustpilot Logo - Figma: 99.25×24.37px */
.ksq-trustpilot-bar__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* SVG from library - set proper dimensions */
.ksq-trustpilot-bar__logo svg {
  height: 24px;
  width: auto;
  max-width: 120px;
}

/* Trustpilot Stars Row - Figma: Frame 523 */
.ksq-trustpilot-bar__stars {
  display: flex;
  align-items: center;
  gap: 7.48px; /* Figma: gap 7.48px */
}

/* Individual Star Badge - Figma: 29.9×29.9px, green #219653 */
.ksq-trustpilot-bar__star {
  width: 30px; /* Figma: 29.9px */
  height: 30px; /* Figma: 29.9px */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #219653; /* Figma: green */
  padding: 4.5px;
  flex-shrink: 0;
}

.ksq-trustpilot-bar__star svg {
  width: 21px; /* Figma: 20.93px */
  height: 21px;
  fill: #ffffff;
}

/* Half star for 4.8 rating - Figma: linear-gradient */
.ksq-trustpilot-bar__star--half {
  background: linear-gradient(
    90deg,
    #219653 0%,
    #219653 50%,
    rgba(33, 150, 83, 0) 50.01%,
    #d9d9d9 50.02%,
    #d9d9d9 100%
  );
}

/* Trustpilot Text - Figma: 12.46px, uppercase, #6A6A6A, centered */
.ksq-trustpilot-bar__text {
  font-family: "Inter", sans-serif;
  font-size: 12.46px; /* Figma: 12.4604px */
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 16px; /* Figma: 16px line-height */
  color: #6a6a6a; /* Figma: #6A6A6A */
  white-space: nowrap;
  text-align: center;
  width: 100%;
}

.ksq-trustpilot-bar__text strong {
  color: #111111;
  font-weight: 700;
}

/* ==========================================================================
   Rating Circles - Figma: Frame 1437258738
   Width: 327px, Gap: 32px between items
   ========================================================================== */

.ksq-rating-circles {
  display: flex;
  align-items: center;
  gap: 32px; /* Figma: gap 32px */
}

/* Individual Rating Circle Item - Figma: Frame 1437258737 */
.ksq-rating-circle {
  display: flex;
  align-items: center;
  gap: 16px; /* Figma: gap 16px */
}

/* Rating Circle Badge - Figma: 60×60px with dual border */
.ksq-rating-circle__badge {
  position: relative;
  width: 60px; /* Figma: 60px */
  height: 60px; /* Figma: 60px */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: #ffffff;
  flex-shrink: 0;
  /* Dual border effect: gray background + orange overlay */
  border: 2px solid #dddddd; /* Figma: Ellipse 3495 - 2px solid #DDDDDD */
  box-shadow: inset 0 0 0 0.5px #ffa033; /* Orange accent */
}

/* Full orange border for 5/5 rating */
.ksq-rating-circle__badge--full {
  border: 2.5px solid #ffa033; /* Figma: Ellipse 3496 - 2.5px solid #FFA033 */
}

/* Rating Score - Figma: 18px, bold, #111111, letter-spacing 0.04em */
.ksq-rating-circle__score {
  font-family: "Roboto Flex", sans-serif;
  font-size: 18px; /* Figma: 18px */
  font-weight: 700;
  line-height: 21px; /* Figma: line-height 21px */
  color: #111111;
  letter-spacing: 0.04em; /* Figma: letter-spacing 0.04em */
  text-align: center;
}

/* Rating Label - Figma: 16px, weight 500, #222222, 73px wide */
.ksq-rating-circle__label {
  font-family: "Roboto Flex", sans-serif;
  font-size: 16px; /* Figma: 16px */
  font-weight: 500;
  line-height: 19px; /* Figma: line-height 19px */
  color: #222222;
  max-width: 73px; /* Figma: 73px width for "Item Build Quality" */
}

/* ==========================================================================
   Try It On Button - Figma: Frame 1437258843
   137×52px, gradient background, border-radius 70px
   ========================================================================== */

.ksq-gallery__try-on {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px; /* Figma: gap 8px */
  padding: 16px 24px; /* Figma: padding 16px 24px */
  background:
    linear-gradient(
      109.6deg,
      rgba(122, 150, 172, 0.6) 12.55%,
      rgba(234, 239, 243, 0.6) 26.75%,
      rgba(194, 212, 225, 0.6) 37.39%,
      rgba(255, 255, 255, 0.6) 51.35%,
      rgba(212, 222, 229, 0.6) 61.05%,
      rgba(171, 189, 200, 0.6) 74.46%,
      rgba(188, 202, 215, 0.6) 87.86%
    ),
    #ffffff;
  border-radius: 70px; /* Figma: border-radius 70px */
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ksq-gallery__try-on:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Camera icon - Figma: 20×20px */
.ksq-gallery__try-on svg {
  width: 20px;
  height: 20px;
  color: #111111;
  flex-shrink: 0;
}

/* Try It On text - Figma: 16px, weight 600, #111111 */
.ksq-gallery__try-on span {
  font-family: "Roboto Flex", sans-serif;
  font-size: 16px; /* Figma: 16px */
  font-weight: 600;
  line-height: 19px; /* Figma: line-height 19px */
  color: #111111;
  white-space: nowrap;
}

/* ==========================================================================
   Hide Default WooCommerce Gallery
   ========================================================================== */

.single-product-layout__gallery .woocommerce-product-gallery {
  display: none !important;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 1200px) {
  .single-product-layout {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 24px;
  }

  :root {
    --ksq-gallery-width: 100%;
  }
}

@media (max-width: 1024px) {
  /* .single-product-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  } */

  /* Disable sticky when single column */
  .single-product-layout__gallery {
    position: relative;
    top: auto;
  }

  .ksq-gallery-wrapper {
    max-width: 600px;
    margin: 0 auto;
  }
}

@media (max-width: 1024px) {
  .single-product-layout {
    padding: 0 16px;
  }

  /* Disable sticky on mobile */
  .single-product-layout__gallery {
    position: relative;
    top: auto;
  }

  .ksq-gallery-wrapper {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .ksq-gallery-thumbs {
    flex-direction: row;
    width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
  }

  .ksq-gallery-thumb {
    width: 60px;
    height: 60px;
    min-width: 60px;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
  }

  .ksq-product-gallery {
    width: 100%;
  }

  .ksq-gallery__badge {
    top: 10px;
    left: 10px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .ksq-gallery__wishlist {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
  }

  .ksq-gallery__wishlist svg {
    width: 16px;
    height: 16px;
  }

  .ksq-gallery__dots {
    bottom: 12px;
    gap: 6px;
  }

  .ksq-gallery__dot {
    width: 8px;
    height: 8px;
  }

  .ksq-gallery__dot.active {
    width: 20px;
  }

  /* Mobile arrows */
  .ksq-gallery__arrow {
    width: 28px;
    height: 28px;
    opacity: 0.85;
  }

  .ksq-gallery__arrow--prev {
    left: 8px;
  }

  .ksq-gallery__arrow--next {
    right: 8px;
  }

  .ksq-gallery__arrow svg {
    width: 12px;
    height: 12px;
  }

  .ksq-trust-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .ksq-trustpilot-bar {
    flex-wrap: wrap;
    gap: 6px;
  }

  .ksq-rating-circles {
    gap: 12px;
  }

  .ksq-rating-circle__badge {
    width: 36px;
    height: 36px;
  }

  .ksq-rating-circle__score {
    font-size: 11px;
  }

  .ksq-rating-circle__label {
    font-size: 10px;
  }
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes ksqFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes wishlistPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.ksq-gallery__wishlist.just-added {
  animation: wishlistPulse 0.3s ease;
}

/* ==========================================================================
   Lightbox Modal Styles
   ========================================================================== */

.ksq-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2147483647; /* Maximum possible z-index */
  display: none;
  background: #000;
  isolation: isolate; /* Create new stacking context */
}

.ksq-lightbox[aria-hidden="false"] {
  display: flex;
}

.ksq-lightbox__overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: -1;
}

.ksq-lightbox__container {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #000;
}

/* Hide everything else when lightbox is open */
body.ksq-lightbox-open {
  overflow: hidden !important;
}

/* Hide elements when lightbox is open */
body.ksq-lightbox-open {
  overflow: hidden !important;
}

/* 1. Hide topbar */
body.ksq-lightbox-open .header-top {
  display: none !important;
}

/* 2. Hide main header */
body.ksq-lightbox-open .site-header,
body.ksq-lightbox-open .header-main,
body.ksq-lightbox-open #masthead {
  display: none !important;
}

/* 3. Hide testimonial videos */
body.ksq-lightbox-open .ksq-pdp-testimonials,
body.ksq-lightbox-open .ksq-pdp-testimonial-thumb {
  display: none !important;
}

/* 4. Hide variant buttons */
body.ksq-lightbox-open .ksq-pdp-variants {
  display: none !important;
}

/* 5. Hide BNPL/Affirm icons */
body.ksq-lightbox-open .ksq-pdp-bnpl,
body.ksq-lightbox-open [class*="affirm"],
body.ksq-lightbox-open [class*="klarna"],
body.ksq-lightbox-open [class*="afterpay"] {
  display: none !important;
}

/* 6. Hide review slider */
body.ksq-lightbox-open .ksq-pdp-reviews-slider {
  display: none !important;
}

/* 7. Hide trust bar */
body.ksq-lightbox-open .trust-bar {
  display: none !important;
}

/* Close Button */
.ksq-lightbox__close {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 100;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ksq-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Main Image Area */
.ksq-lightbox__main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 20px;
  background: #000;
  min-width: 0;
}

/* Navigation Arrows */
.ksq-lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ksq-lightbox__arrow:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ksq-lightbox__arrow--prev {
  left: 16px;
}

.ksq-lightbox__arrow--next {
  right: 16px;
}

/* Image Wrapper */
.ksq-lightbox__image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ksq-lightbox__image-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-x pan-y pinch-zoom;
  transform-origin: center center;
  transition: transform 0.1s ease;
  cursor: grab;
}

.ksq-lightbox__image-container.is-zoomed {
  cursor: move;
}

.ksq-lightbox__image-container.is-dragging {
  cursor: grabbing;
  transition: none;
}

/* Slides */
.ksq-lightbox__slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.ksq-lightbox__slide.active {
  position: relative;
  opacity: 1;
  visibility: visible;
}

.ksq-lightbox__media {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

/* Zoom Controls */
.ksq-lightbox__zoom-controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 30, 30, 0.9);
  padding: 6px 12px;
  border-radius: 20px;
}

.ksq-lightbox__zoom-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.ksq-lightbox__zoom-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.ksq-lightbox__zoom-level {
  color: #fff;
  font-family: "Roboto Flex", sans-serif;
  font-size: 13px;
  font-weight: 500;
  min-width: 45px;
  text-align: center;
}

/* Thumbnails Sidebar */
.ksq-lightbox__thumbs {
  width: 120px;
  height: 100%;
  background: #111;
  display: flex;
  flex-direction: column;
  padding: 16px 16px;
  margin: 0px 10px 0px 0px;
  flex-shrink: 0;
  border-left: 1px solid #222;
}

.ksq-lightbox__thumbs-header {
  padding-bottom: 12px;
  margin-bottom: 12px;
  text-align: center;
}

.ksq-lightbox__counter {
  color: rgba(255, 255, 255, 0.7);
  font-family: "Roboto Flex", sans-serif;
  font-size: 13px;
  font-weight: 500;
}

.ksq-lightbox__thumbs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.ksq-lightbox__thumbs-list::-webkit-scrollbar {
  width: 3px;
}

.ksq-lightbox__thumbs-list::-webkit-scrollbar-track {
  background: transparent;
}

.ksq-lightbox__thumbs-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.ksq-lightbox__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  background: #222;
  padding: 0;
  flex-shrink: 0;
}

.ksq-lightbox__thumb:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.ksq-lightbox__thumb.active {
  border-color: #ff5100;
}

.ksq-lightbox__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ksq-lightbox__thumb-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: rgba(253, 184, 20, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.ksq-lightbox__thumb-play svg {
  width: 10px;
  height: 10px;
  margin-left: 1px;
}

/* Mobile Lightbox */
@media (max-width: 1024px) {
  .ksq-lightbox__container {
    flex-direction: column;
  }

  .ksq-lightbox__main {
    flex: 1;
    padding: 50px 10px 10px;
  }

  .ksq-lightbox__arrow {
    width: 36px;
    height: 36px;
  }

  .ksq-lightbox__arrow--prev {
    left: 8px;
  }

  .ksq-lightbox__arrow--next {
    right: 8px;
  }

  .ksq-lightbox__image-wrapper {
    width: 100%;
    height: 100%;
  }

  .ksq-lightbox__media {
    max-height: calc(100vh - 180px);
  }

  .ksq-lightbox__thumbs {
    width: 100%;
    height: auto;
    max-height: 90px;
    padding: 8px;
    border-left: none;
    border-top: 1px solid #222;
  }

  .ksq-lightbox__thumbs-header {
    display: none;
  }

  .ksq-lightbox__thumbs-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    justify-content: center;
  }

  .ksq-lightbox__thumb {
    width: 60px;
    min-width: 60px;
    height: 60px;
  }

  .ksq-lightbox__close {
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
  }

  .ksq-lightbox__zoom-controls {
    bottom: 100px;
  }
}

/* Clickable slide for opening lightbox */
.ksq-gallery__slide {
  cursor: pointer;
}

/* ==========================================================================
   Inner Zoom on Hover - Main Gallery
   ========================================================================== */

.ksq-gallery__slide.ksq-zoom-active {
  cursor: zoom-in;
}

.ksq-gallery__slide .ksq-gallery__image {
  transition: transform 0.1s ease-out;
  transform-origin: center center;
}

.ksq-gallery__slide.ksq-zoom-active .ksq-gallery__image {
  transform: scale(2);
}
