/* ========================================
   SINGLE PRODUCT PAGE STYLES
   ======================================== */

/* Header styling for single product pages */
body.single-product .site-header {
  background: var(--bg) !important;
}

/* CSS Custom Properties — tokens live in theme.css */

/* ========================================
   MAIN PRODUCT LAYOUT
   ======================================== */

.single-product-page {
  background: var(--product-bg);
  color: var(--product-text);
  min-height: 100vh;
  padding: 20px 0 80px 0;
}

/* Force override any conflicting styles */
body.single-product .single-product-page {
  background: var(--product-bg, #ffffff) !important;
  color: var(--product-text, #0d0d0d) !important;
}

.product-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.product-layout {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
  align-items: start;
}

.added_to_cart {
  display: none !important;
}

/* ========================================
   PRODUCT GALLERY
   ======================================== */

.product-gallery-container {
  --gallery-slide-gap: 8px;
  --gallery-slide-width: calc((100% - var(--gallery-slide-gap)) * 0.93);
  --gallery-slide-height: clamp(300px, 100vw, 400px);
  --desktop-slide-gap: 1px;
  --desktop-slide-width: calc((100% - var(--desktop-slide-gap)) * 0.62);
  width: 100%;
}

/* Desktop gallery */
.product-gallery-desktop {
  width: 100%;
}

.product-gallery-mobile {
  display: none;
  overscroll-behavior-y: contain;
}

.product-thumbnails--hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.product-gallery-desktop-stage {
  position: relative;
  width: 100%;
}

.product-gallery-desktop-viewport {
  overflow: hidden;
  width: 100%;
  --desktop-slide-width: calc((100% - var(--desktop-slide-gap)) * 0.62);
  cursor: grab;
  touch-action: pan-y;
}

.product-gallery-desktop-viewport.is-dragging {
  cursor: grabbing;
  touch-action: none;
  user-select: none;
}

.product-gallery-desktop-track {
  display: flex;
  gap: 4px;
  will-change: transform;
}

.product-gallery-container.is-single-slide {
  --gallery-slide-width: 100%;
  --desktop-slide-width: 100%;
}

.gallery-desktop-slide {
  flex: 0 0 var(--desktop-slide-width);
  width: var(--desktop-slide-width);
  min-width: var(--desktop-slide-width);
  flex-shrink: 0;
}

.gallery-desktop-slide .main-image-wrapper {
  position: relative;
  overflow: hidden;
  background: var(--product-card-bg);
  aspect-ratio: 1;
  touch-action: pan-y pinch-zoom;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.gallery-desktop-slide .main-product-image,
.gallery-desktop-slide .main-product-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
}

/* Mobile peek carousel (hidden on desktop) */
.product-gallery-mobile .product-main-image {
  width: 100%;
}

.product-gallery-carousel {
  overflow: hidden;
  width: 100%;
}

.product-gallery-track {
  display: flex;
  gap: var(--gallery-slide-gap);
  will-change: transform;
}

.product-gallery-slide {
  flex: 0 0 var(--gallery-slide-width);
  min-width: 0;
  flex-shrink: 0;
}

.product-gallery-track.is-infinite .product-gallery-slide--clone {
  pointer-events: none;
}

.gallery-slide-inner {
  position: relative;
  overflow: hidden;
  background: var(--product-card-bg);
  width: 100%;
  height: var(--gallery-slide-height);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.product-gallery-slide .main-product-image,
.product-gallery-slide .main-product-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.gallery-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
}

.product-thumbnails {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 90px;
  flex-shrink: 0;
}

.thumbnail-item {
  width: 90px;
  height: 90px;
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: none;
  padding: 0;
  position: relative;
}

.thumbnail-item:hover {
  border-color: var(--product-border);
}

.thumbnail-item.active {
  border-color: var(--product-text);
}

.thumbnail-item--video::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.thumbnail-item--video::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-40%, -50%);
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid rgba(255, 255, 255, 0.95);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.thumbnail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: optimize-contrast;
  image-rendering: smooth;
  -ms-interpolation-mode: bicubic;
}

.product-gallery-desktop .gallery-controls {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: var(--z-elevated);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding-top: 0;
}

.gallery-counter {
  font-size: 16px;
  line-height: 1;
  color: var(--product-text);
  font-weight: 500;
  letter-spacing: 0.02em;
  user-select: none;
}

/* Legacy wrapper — kept for JS fallbacks during gallery rebuilds */
.main-image-wrapper {
  position: relative;
  overflow: hidden;
  background: var(--product-card-bg);
  aspect-ratio: 1;
  touch-action: pan-y pinch-zoom;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.main-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
  opacity: 1;
  image-rendering: optimize-contrast;
  image-rendering: smooth;
  -ms-interpolation-mode: bicubic;
  /* Allow vertical scrolling while enabling horizontal swipe */
  touch-action: pan-y pinch-zoom;
  /* Improve touch responsiveness */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  /* Smooth transition for non-animated changes */
  transition: opacity 0.2s ease;
}

.main-product-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: var(--product-card-bg);
  /* Prevent controls from causing layout shifts */
  position: relative;
}

/* Hide native video controls to prevent layout shifts on mobile */
.main-product-video::-webkit-media-controls {
  display: none !important;
}

.main-product-video::-webkit-media-controls-enclosure {
  display: none !important;
}

/* For other browsers */
.main-product-video::--webkit-media-controls-panel {
  display: none !important;
}

.main-product-video::-webkit-media-controls-play-button {
  display: none !important;
}

.main-product-video::-webkit-media-controls-start-playback-button {
  display: none !important;
}

.main-product-image.slide-in-active {
  transform: translateX(0) scale(1);
  opacity: 1;
  transition:
    transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 0.25s ease;
}

/* Loading state for image transitions — only show if load takes >200ms */
.main-image-wrapper.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid var(--product-border);
  border-top: 2px solid var(--product-text);
  border-radius: 50%;
  z-index: var(--z-elevated);
  opacity: 0;
  animation:
    gallery-spinner-fade-in 0.15s ease 200ms forwards,
    spin 0.8s linear 200ms infinite;
  pointer-events: none;
}

@keyframes gallery-spinner-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.7;
  }
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Navigation Arrows */
.gallery-controls .image-nav {
  position: static;
  transform: none;
  background: none;
  border: none;
  width: auto;
  height: auto;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s ease;
  color: var(--product-text);
  padding: 0;
  z-index: auto;
}

.gallery-controls .image-nav:hover {
  opacity: 0.6;
  background: none;
}

.gallery-controls .image-nav svg {
  display: block;
}

/* Legacy overlay nav (fallback) */
.image-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--button-transition);
  color: var(--nav-svg);
  z-index: var(--z-elevated);
}

.image-nav:hover {
  background: rgba(255, 255, 255, 1);
}

.image-nav-prev {
  left: 20px;
}

.image-nav-next {
  right: 20px;
}

/* ========================================
   PRODUCT DETAILS
   ======================================== */

.product-details-container {
  padding: 0;
}

/* Desktop product breadcrumbs (mobile uses header) */
.product-breadcrumbs {
  display: none;
  margin-bottom: 16px;
}

.product-breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-breadcrumbs .breadcrumb-item {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.product-breadcrumbs .breadcrumb-item:not(:last-child)::after {
  content: ">";
  margin: 0 0.55em;
  color: var(--product-muted);
}

.product-breadcrumbs .breadcrumb-item a,
.product-breadcrumbs .breadcrumb-item span {
  color: var(--product-text);
  text-decoration: none;
}

.product-breadcrumbs .breadcrumb-item a:hover {
  opacity: 0.7;
}

@media (min-width: 1025px) {
  .product-breadcrumbs {
    display: block;
  }
}

/* Product meta styling */
.product-sku {
  margin-bottom: 20px;
}

.sku-label {
  display: inline-block;
  background: var(--product-text);
  color: var(--product-bg);
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-title {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 20px 0;
  color: var(--product-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.product-color {
  margin-bottom: 24px;
}

.color-label {
  font-size: 14px;
  color: var(--product-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.color-value {
  font-size: 14px;
  color: var(--product-text);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.product-price {
  margin-bottom: 16px;
}

.product-description {
  margin-bottom: 32px;
}

.product-description__content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--product-text);
}

.product-description__content p {
  margin: 0 0 16px 0;
}

.product-description__content p:last-child {
  margin-bottom: 0;
}

.product-description.is-collapsed .product-description__content {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 12;
  line-clamp: 12;
  overflow: hidden;
}

.product-description__toggle {
  margin-top: 10px;
  padding: 0;
  border: none;
  background: none;
  color: var(--product-text);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product-description__toggle:hover {
  color: var(--product-muted);
}

.product-price .price {
  font-size: 20px;
  color: var(--product-text);
  font-weight: 600;
}

.product-price .price del {
  color: var(--product-muted);
  text-decoration: line-through;
  margin-right: 12px;
  font-weight: 400;
}

.product-price .price ins {
  text-decoration: none;
  color: var(--product-accent);
  font-weight: 600;
}

.wccs-live-price-container {
  display: none !important;
}

/* Color Selection */
.product-color-selection {
  margin-bottom: 32px;
}

.color-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.color-option {
  width: 80px;
  height: 80px;
  border: 1px solid var(--product-border);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  position: relative;
  padding: 0;
}

.color-option.active,
.color-option.selected {
  border-color: var(--product-accent);
  border-width: 1px;
}

.color-swatch {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.color-name {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 10px;
  text-align: center;
  padding: 2px 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Size Selection */
.product-size-selection {
  margin-bottom: 32px;
}

.product-size-selection.is-prompted {
  margin-bottom: 32px;
}

.product-size-selection.is-prompted .size-options {
  display: grid;
  width: fit-content;
  max-width: 100%;
  grid-template-columns: repeat(
    var(--size-option-count, 5),
    var(--size-option-width, 1fr)
  );
  gap: var(--size-option-gap, 8px);
  border: 1px solid #ff4444;
  /*padding: 16px;*/
  margin-bottom: 8px;
  box-sizing: border-box;
}

.product-size-selection.is-prompted .size-options + .size-selection-prompt {
  margin: 0 0 16px;
  width: fit-content;
}

.size-selection-prompt {
  margin: 0 0 32px;
  color: #ff4444;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.size-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.size-options:has(> :only-child) {
  display: none;
}

.size-option {
  padding: 12px 8px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--product-border);
  background: transparent;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.size-option.selected {
  color: var(--product-text);
  background: var(--product-overlay);
  border-color: var(--product-accent);
  border-width: 1px;
}

.size-option:disabled:hover {
  color: var(--product-muted);
}

.size-option.unavailable {
  position: relative;
  opacity: 0.6;
  cursor: not-allowed;
  color: var(--product-muted);
  background-color: var(--product-card-bg);
}

.size-option.unavailable::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    transparent 50%,
    var(--product-muted) 50%,
    var(--product-muted) 50%,
    transparent 55%
  );
  pointer-events: none;
  z-index: 2;
}

/* Specific button implementations */
.size-option.loading {
  opacity: 0.7;
  cursor: wait;
  position: relative;
}

.size-option.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid var(--product-border);
  border-top: 2px solid var(--product-text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.single_add_to_cart_button.loading {
  position: relative;
  opacity: 0.85;
  cursor: wait;
  color: transparent;
}

.single_add_to_cart_button.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  color: inherit;
}

.single_add_to_cart_button.loading::after {
  border-color: var(--product-border, rgba(0, 0, 0, 0.2));
  border-top-color: var(--product-text, currentColor);
}

.single_add_to_cart_button.error {
  background: #dc3545 !important;
  border-color: #dc3545 !important;
  color: white !important;
}

.size-guide-link {
  font-size: 12px;
  color: var(--product-muted);
  text-decoration: underline;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.size-guide-link:hover {
  color: var(--product-text);
}

/* Stock Notice */
.stock-notice {
  margin-bottom: 24px;
}

.stock-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--product-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Product Actions */
.product-actions {
  margin-top: 40px;
}

.product-actions .primefit-variations-form,
.product-actions .cart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.quantity-input-wrapper {
  flex-shrink: 0;
}

.product-actions .cart .quantity {
  flex-shrink: 0;
}

/* Quantity is managed in the mini cart only */
.single-product-page .product-actions .quantity,
.single-product-page .product-actions .quantity-input-wrapper {
  display: none;
}

/* Quantity label styling - consolidated */
.quantity-input-wrapper label,
.quantity label {
  display: block;
  font-size: 14px;
  color: var(--product-text);
  margin-bottom: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* WooCommerce Quantity Controls */
.single-product-page .quantity {
  display: flex;
  align-items: center;
  gap: 0;
  width: fit-content;
}

.single-product-page .quantity input[type="number"] {
  width: 60px;
  height: 40px;
  padding: 0 8px;
  background: transparent;
  color: var(--product-text);
  font-size: 14px;
  text-align: center;
  border: none;
  border-radius: 0;
  appearance: textfield;
  -moz-appearance: textfield;
  font-weight: 500;
}

.single-product-page .quantity input[type="number"]::-webkit-outer-spin-button,
.single-product-page .quantity input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.single-product-page .quantity input[type="number"]:focus {
  outline: 2px solid var(--product-accent);
  outline-offset: 2px;
}

/* Specific quantity button implementations */
.single-product-page .quantity .plus,
.single-product-page .quantity .minus {
  width: 40px;
  height: 42px;
  font-size: 18px;
  border: 1px solid var(--product-border);
  background: transparent;
  color: var(--product-text);
  cursor: pointer;
  transition: var(--button-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  position: relative;
}

.single-product-page .quantity .plus:hover:not(:disabled),
.single-product-page .quantity .minus:hover:not(:disabled) {
  background: var(--product-text);
  color: var(--product-bg);
}

.single-product-page .quantity .plus:hover:not(:disabled)::before,
.single-product-page .quantity .minus:hover:not(:disabled)::before {
  background-color: var(--product-bg);
}

.single-product-page .quantity .plus:disabled,
.single-product-page .quantity .minus:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.single-product-page .quantity .minus {
  border-right: none;
}

.single-product-page .quantity .plus {
  border-left: none;
}

/* Hide WooCommerce default button text and add custom icons */
.single-product-page .quantity .plus,
.single-product-page .quantity .minus {
  font-size: 0; /* Hide default text */
  position: relative;
}

.single-product-page .quantity .plus::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: all 0.2s ease;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E")
    no-repeat center;
  -webkit-mask-size: contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E")
    no-repeat center;
  mask-size: contain;
  background-color: var(--product-text);
  background-image: none;
}

.single-product-page .quantity .minus::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: all 0.2s ease;
  color: var(--product-text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E")
    no-repeat center;
  -webkit-mask-size: contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E")
    no-repeat center;
  mask-size: contain;
  background-color: var(--product-text);
  background-image: none;
}

/* Responsive quantity controls */
@media (max-width: 768px) {
  .single-product-page .quantity {
    width: 100%;
    justify-content: center;
  }

  .single-product-page .quantity .plus,
  .single-product-page .quantity .minus {
    width: 44px;
    height: 48px;
  }

  .single-product-page .quantity .plus::before,
  .single-product-page .quantity .minus::before {
    width: 20px;
    height: 20px;
  }

  .single-product-page .quantity input[type="number"] {
    width: 70px;
    height: 46px;
    font-size: 16px;
  }
}

.notify-button {
  width: 100%;
  padding: 16px 24px;
  background: transparent;
  border: 1px solid var(--product-border);
  color: var(--product-muted);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: var(--button-transition);
}

.notify-button:hover {
  border-color: var(--product-text);
  color: var(--product-text);
}

.product-actions-purchase[hidden],
.product-actions .notify-button[hidden] {
  display: none;
}

.notify-form-overlay:not(.notify-form-overlay--sheet) {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
}

.notify-form-container {
  flex: 0 0 auto;
  width: 400px;
  max-width: calc(100vw - 40px);
  box-sizing: border-box;
  padding: 16px;
  background: var(--product-bg, #fff);
  border: 1px solid var(--product-border, #ddd);
}

.notify-form-container h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.notify-form .form-group {
  margin-bottom: 16px;
}

.notify-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.notify-form input[type="email"] {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--product-border, #ddd);
  background: transparent;
  color: var(--product-text, #111);
}

.notify-form .form-actions {
  display: flex;
  gap: 12px;
}

.notify-submit,
.notify-form-cancel {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--product-text, #111);
  background: var(--product-text, #111);
  color: var(--product-bg, #fff);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: var(--button-transition);
}

.notify-form-cancel {
  background: transparent;
  color: var(--product-text, #111);
}

.notify-form-overlay--sheet {
  display: none;
}

@media (max-width: 768px) {
  .notify-form-overlay--sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10000;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear 0.28s;
    clip-path: inset(0 0 100% 0);
    overflow: hidden;
  }

  .notify-form-overlay--sheet.active {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
    clip-path: none;
    overflow: visible;
  }

  .notify-form-sheet-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.34);
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  .notify-form-overlay--sheet.active .notify-form-sheet-overlay {
    opacity: 1;
  }

  .notify-form-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateY(100%);
    transition: transform 0.28s ease;
    max-height: 88vh;
    overflow-y: auto;
    will-change: transform;
    backface-visibility: hidden;
  }

  .notify-form-overlay--sheet.active .notify-form-sheet-panel {
    transform: translateY(0);
  }

  .notify-form-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px;
    border-top: 1px solid var(--product-border);
    border-radius: 26px 26px 0 0;
    background: var(--product-bg);
  }

  .notify-form-sheet-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .notify-form-close {
    border: none;
    background: transparent;
    color: var(--product-text);
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .notify-form-close svg {
    width: 24px;
    height: 24px;
    display: block;
  }

  .notify-form-sheet-body {
    padding: 0 16px 24px;
    background: var(--product-bg);
  }

  .notify-form-overlay--sheet .notify-form-cancel {
    display: none;
  }

  .notify-form-overlay--sheet .notify-submit {
    width: 100%;
  }
}

/* WooCommerce Add to Cart Button Override */
.product-actions .single_add_to_cart_button {
  flex: 1;
  width: auto;
  min-width: 0;
  height: 42px;
  padding: 0 24px;
  display: flex;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: var(--product-text);
  border: 1px solid var(--product-text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: var(--button-transition);
}

.product-actions .single_add_to_cart_button:hover:not(:disabled) {
  background: var(--product-muted);
  border-color: var(--product-muted);
}

.product-actions .single_add_to_cart_button:disabled {
  background: var(--product-border);
  border-color: var(--product-border);
  color: var(--product-muted);
  cursor: not-allowed;
}

/* Wrapper keeps layout space when the action button is pinned */
.sticky-action-slot {
  flex: 1;
  min-width: 0;
  display: flex;
}

.product-actions > .sticky-action-slot {
  width: 100%;
}

/* Sticky action button — mobile only (uses the real add-to-cart / notify button) */
/* primefit-critical:start sticky-cart product */
@media (max-width: 768px) {
  body.has-mobile-bottom-bar.single-product {
    --sticky-add-to-cart-bottom: calc(
      var(--mobile-bottom-bar-height, 56px) + env(safe-area-inset-bottom, 0px)
    );
  }

  .product-actions {
    margin-top: 24px;
  }

  .product-actions .primefit-variations-form,
  .product-actions .cart {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .sticky-action-slot {
    width: 100%;
    flex: none;
  }

  .product-actions .single_add_to_cart_button,
  .product-actions .notify-button {
    width: 100%;
    min-height: 48px;
    height: 48px;
    padding: 0 24px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
  }

  .notify-button {
    background: var(--product-text);
    border-color: var(--product-text);
    color: var(--product-bg);
  }

  .notify-button:hover {
    background: var(--product-muted);
    border-color: var(--product-muted);
    color: var(--product-bg);
  }

  /* Sticky CTA — no bg bar; content shows through behind the floating button */
  body.single-product::before {
    display: none;
  }

  .product-actions .single_add_to_cart_button.is-sticky,
  .product-actions .notify-button.is-sticky {
    position: fixed;
    left: 15px;
    right: 15px;
    width: auto;
    flex: none;
    min-width: 0;
    z-index: calc(var(--z-dropdown) + 1);
    margin: 0;
    will-change: top;
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  /* Hide pinned add-to-cart while the size or notify sheet is open */
  body.size-sheet-open .product-actions .single_add_to_cart_button.is-sticky,
  body.size-sheet-open .product-actions .notify-button.is-sticky,
  body.notify-sheet-open .product-actions .single_add_to_cart_button.is-sticky,
  body.notify-sheet-open .product-actions .notify-button.is-sticky {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  /* Hide pinned add-to-cart while page transition loader is active */
  body.page-loading .product-actions .single_add_to_cart_button.is-sticky,
  body.page-loading .product-actions .notify-button.is-sticky {
    opacity: 0;
    pointer-events: none;
  }

  /* Hide pinned add-to-cart while mini cart drawer is open */
  body.cart-open .product-actions .single_add_to_cart_button.is-sticky,
  body.cart-open .product-actions .notify-button.is-sticky,
  .cart-wrap.open .product-actions .single_add_to_cart_button.is-sticky,
  .cart-wrap.open .product-actions .notify-button.is-sticky {
    opacity: 0;
    pointer-events: none;
  }

  /* Hide pinned add-to-cart while search is open */
  body.search-open .product-actions .single_add_to_cart_button.is-sticky,
  body.search-open .product-actions .notify-button.is-sticky {
    opacity: 0;
    pointer-events: none;
  }
}
/* primefit-critical:end sticky-cart */

.sticky-size-sheet {
  display: none;
}

@media (max-width: 768px) {
  .sticky-size-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear 0.28s;
    clip-path: inset(0 0 100% 0);
    overflow: hidden;
  }

  body.has-mobile-bottom-bar .sticky-size-sheet-panel {
    bottom: calc(
      var(--mobile-bottom-bar-height, 56px) + env(safe-area-inset-bottom, 0px)
    );
    max-height: calc(
      88vh - var(--mobile-bottom-bar-height, 56px) -
        env(safe-area-inset-bottom, 0px)
    );
  }

  body.has-mobile-bottom-bar .sticky-size-sheet-overlay {
    bottom: calc(
      var(--mobile-bottom-bar-height, 56px) + env(safe-area-inset-bottom, 0px)
    );
  }
}

.sticky-size-sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.34);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sticky-size-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateY(100%);
  transition: transform 0.28s ease;
  max-height: 88vh;
  overflow-y: auto;
  will-change: transform;
  backface-visibility: hidden;
}

.sticky-size-sheet.active {
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
  clip-path: none;
  overflow: visible;
}

.sticky-size-sheet.active .sticky-size-sheet-overlay {
  opacity: 1;
}

.sticky-size-sheet.active .sticky-size-sheet-panel {
  transform: translateY(0);
}

.sticky-size-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 18px;
  border-top: 1px solid var(--product-border);
  border-radius: 26px 26px 0 0;
  background: var(--product-bg);
}

.sticky-size-sheet-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.sticky-size-sheet-close {
  border: none;
  background: transparent;
  color: var(--product-text);
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticky-size-sheet-close svg {
  width: 24px;
  height: 24px;
  display: block;
}

.sticky-size-sheet-product {
  padding: 8px 16px 12px;
  background: var(--product-bg);
}

.sticky-size-sheet-product-inner {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  align-items: start;
}

.sticky-size-sheet-product-image {
  width: 78px;
  height: 96px;
  object-fit: cover;
  background: var(--product-overlay);
}

.sticky-size-sheet-product-title {
  margin: 0 0 8px;
  color: var(--product-text);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
  text-transform: uppercase;
}

.sticky-size-sheet-product-color {
  margin: 0 0 8px;
  color: var(--product-muted);
  font-size: 12px;
  line-height: 1.1;
  text-transform: uppercase;
  font-weight: 400;
}

.sticky-size-sheet-product-price {
  color: var(--product-text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
}

.sticky-size-sheet-product-price .price {
  display: block;
}

.sticky-size-sheet-body {
  padding-bottom: 14px;
  background: var(--product-bg);
}

.sticky-size-sheet-heading {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--product-border);
  color: var(--product-text);
  font-size: 12px;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.sticky-size-sheet-option {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--product-border);
  background: transparent;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--product-text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

.sticky-size-sheet-option:last-child {
  border-bottom: none;
}

.sticky-size-sheet-status {
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
}

.sticky-size-sheet-option.unavailable {
  color: var(--product-muted);
  cursor: not-allowed;
}

.sticky-size-sheet-status.out-of-stock {
  text-decoration: line-through;
  opacity: 0.85;
}

/* Collapsible Sections */
.product-collapsible-sections {
  margin-top: 40px;
}

.collapsible-section {
  border-bottom: 1px solid var(--product-border);
}

.collapsible-section:last-child {
  border-bottom: none;
}

.collapsible-toggle {
  width: 100%;
  padding: 20px 0;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--product-text);
  text-align: left;
}

.collapsible-toggle:hover {
  color: var(--product-muted);
}

.collapsible-title {
  font-size: 16px;
  color: var(--product-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.collapsible-icon {
  transition: transform 0.2s ease;
  width: 16px;
  height: 16px;
}

.collapsible-icon svg {
  width: 100%;
  height: 100%;
  color: var(--product-text);
}

.collapsible-content {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.collapsible-content.closed {
  max-height: 0;
}

.collapsible-inner {
  padding: 0 0 20px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--product-text);
}

.collapsible-inner p {
  margin: 0 0 16px 0;
}

.collapsible-inner p:last-child {
  margin-bottom: 0;
}

/* ========================================
   PRODUCT FEATURES
   ======================================== */

.product-features-container {
  margin-bottom: 80px;
  padding-top: 60px;
}

.features-title {
  font-size: 24px;
  color: var(--product-text);
  margin-bottom: 40px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.feature-item {
  text-align: center;
}

.feature-image {
  margin-bottom: 16px;
  background: var(--product-card-bg);
  overflow: hidden;
  aspect-ratio: 1;
}

.feature-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-title {
  font-size: 18px;
  color: var(--product-text);
  margin: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.feature-description {
  font-size: 16px;
  color: var(--product-muted);
  margin: 8px 0 0 0;
  line-height: 1.4;
}

/* ========================================
   TECHNICAL HIGHLIGHTS
   ======================================== */

.product-technical-highlights-container {
  margin-bottom: 120px;
}

.technical-highlights-title {
  font-size: 24px;
  color: var(--product-text);
  margin-bottom: 40px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.technical-highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.technical-highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.highlight-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.highlight-icon svg {
  width: 40px;
  height: 40px;
  color: var(--product-text);
}

.highlight-icon-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.highlight-content {
  flex: 1;
}

.highlight-title {
  font-size: 16px;
  color: var(--product-text);
  margin: 0 0 8px 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.highlight-description {
  font-size: 14px;
  color: var(--product-muted);
  margin: 0;
  line-height: 1.4;
}

/* ========================================
   PRODUCT INFORMATION
   ======================================== */

.information-toggle {
  width: 100%;
  padding: 20px 0;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--product-text);
}

.information-toggle:hover {
  color: var(--product-muted);
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.toggle-icon {
  transition: transform 0.2s ease;
}

.toggle-icon svg {
  width: 16px;
  height: 16px;
  color: var(--product-text);
}

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

/* Tablet */
@media (max-width: 1024px) {
  .product-container {
    padding: 0 15px;
  }

  .product-layout {
    gap: 20px;
  }

  .features-grid,
  .technical-highlights-grid {
    gap: 30px;
  }

  .product-title {
    font-size: 28px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  body.has-mobile-bottom-bar.single-product .single-product-page {
    padding-bottom: calc(
      24px + var(--mobile-bottom-bar-height, 56px) +
        env(safe-area-inset-bottom, 0px)
    );
  }

  body.has-mobile-bottom-bar.sticky-cart-visible.single-product
    .single-product-page {
    padding-bottom: calc(
      96px + var(--mobile-bottom-bar-height, 56px) +
        env(safe-area-inset-bottom, 0px)
    );
  }

  .product-container {
    padding: 0 15px;
  }

  .product-layout {
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 60px;
  }

  .product-gallery-container {
    order: 1;
    --gallery-gutter-left: 5px;
  }

  .product-gallery-desktop {
    display: none;
  }

  .product-gallery-mobile {
    display: block;
    width: 100%;
  }

  .product-gallery-mobile .product-gallery-carousel {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-padding-left: var(--gallery-gutter-left);
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-left: -5px;
    margin-right: -5px;
    width: calc(100% + 30px);
    padding-left: var(--gallery-gutter-left);
    box-sizing: border-box;
  }

  /* pan-y on .main-product-image (desktop drag) blocks horizontal scroll on mobile */
  .product-gallery-mobile .gallery-slide-inner,
  .product-gallery-mobile .main-product-image,
  .product-gallery-mobile .main-product-video {
    touch-action: manipulation;
  }

  .product-gallery-mobile .product-gallery-carousel::-webkit-scrollbar {
    display: none;
  }

  .product-gallery-mobile .product-gallery-slide {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .product-gallery-track {
    padding-left: 0;
    will-change: auto;
  }

  .product-gallery-track::after {
    content: "";
    flex: 0 0 15px;
  }

  .product-gallery-mobile .product-main-image {
    order: 1;
    width: 100%;
  }

  .gallery-controls {
    padding-left: 0;
    gap: 10px;
  }
  .product-details-container,
  .summary.entry-summary {
    order: 2;
  }

  .product-title {
    font-size: 24px;
  }

  .features-grid,
  .technical-highlights-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .highlight-content {
    text-align: left;
  }

  .technical-highlight-item {
    flex-direction: column;
    text-align: left;
    gap: 12px;
  }

  .highlight-icon {
    align-self: left;
  }

  .color-options {
    gap: 8px;
  }

  .color-option {
    width: 80px;
    height: 80px;
  }

  .size-options {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .size-option {
    padding: 10px 8px;
    font-size: 12px;
  }

  .size-option.unavailable::before {
    font-size: 18px;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .product-container {
    padding: 0 16px;
  }

  .product-layout {
    gap: 30px;
    margin-bottom: 40px;
  }

  .product-title {
    font-size: 20px;
  }

  .product-price .price {
    font-size: 20px;
  }

  .features-title,
  .technical-highlights-title {
    font-size: 20px;
    margin-bottom: 30px;
  }

  .feature-image {
    aspect-ratio: 1;
  }

  .information-toggle {
    padding: 16px 0;
  }

  .section-title {
    font-size: 14px;
  }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Focus styles */
.image-nav:focus,
.thumbnail-item:focus,
.color-option:focus,
.size-option:focus,
.notify-button:focus,
.information-toggle:focus {
  outline: 2px solid var(--product-accent);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .main-product-image,
  .thumbnail-item,
  .image-dot {
    transition: none;
    animation: none;
  }

  .thumbnail-item:hover,
  .thumbnail-item.active {
    transform: none;
  }

  .image-dot:hover,
  .image-dot.active {
    transform: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --product-border: #0d0d0d;
    --product-muted: #0d0d0d;
  }

  [data-theme="dark"] {
    --product-border: #ffffff;
    --product-muted: #ffffff;
  }
}

/* ========================================
   SIZE GUIDE MODAL STYLES
   ======================================== */

.size-guide-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.size-guide-modal.active {
  opacity: 1;
  visibility: visible;
}

.size-guide-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.size-guide-modal-content {
  position: relative;
  background: var(--product-bg);
  max-width: 90vw;
  max-height: 90vh;
  width: 100%;
  max-width: 1000px;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.size-guide-modal.active .size-guide-modal-content {
  transform: scale(1);
}

.size-guide-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--product-border);
  background: var(--product-card-bg);
}

.size-guide-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--product-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.size-guide-modal-close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--product-text);
  border-radius: 6px;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.size-guide-modal-close:hover {
  background: var(--product-overlay);
  color: var(--product-accent);
}

.size-guide-modal-close svg {
  width: 20px;
  height: 20px;
}

.size-guide-modal-body {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: calc(90vh - 100px);
  overflow: auto;
}

.size-guide-image {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  width: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .size-guide-modal-content {
    max-width: 95vw;
    max-height: 95vh;
    margin: 20px;
  }

  .size-guide-modal-header {
    padding: 16px 20px;
  }

  .size-guide-modal-title {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .size-guide-modal-content {
    margin: 10px;
    max-width: calc(100vw - 20px);
  }

  .size-guide-modal-header {
    padding: 12px 16px;
  }

  .size-guide-modal-body {
    padding: 16px;
  }
}

/* Animation for modal entrance */
@keyframes size-guide-modal-fade-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.size-guide-modal.active .size-guide-modal-content {
  animation: size-guide-modal-fade-in 0.3s ease-out;
}

/* Focus management for accessibility */
.size-guide-modal-close:focus {
  outline: 2px solid var(--product-accent);
  outline-offset: 2px;
}

/* Dark mode specific adjustments */
[data-theme="dark"] .size-guide-modal-overlay {
  background: rgba(0, 0, 0, 0.9);
}

[data-theme="dark"] .size-guide-image {
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Virtual Scrolling Performance Optimizations */
.size-options {
  /* Enable hardware acceleration for smooth scrolling */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
  /* Optimize for virtual scrolling */
  contain: layout style;
  -webkit-contain: layout style;
}

.size-option {
  /* Enable hardware acceleration */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  /* Optimize rendering */
  will-change: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.size-option:hover {
  /* Optimize hover animations */
  will-change: transform;
}

.size-option:focus {
  /* Optimize focus states */
  outline: 2px solid var(--product-accent);
  outline-offset: 2px;
}

/* Virtual scroller container */
.size-options.virtual-scroll {
  position: relative;
  overflow-y: auto;
  /* Enable momentum scrolling on iOS */
  -webkit-overflow-scrolling: touch;
}

.size-options.virtual-scroll .size-option {
  position: absolute;
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Smooth transitions */
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

/* Performance optimizations for large lists */
.size-options.large-list {
  /* Use content-visibility for better performance */
  content-visibility: auto;
  -webkit-content-visibility: auto;
  contain-intrinsic-size: 50px;
}

/* Debounced input optimizations */
input[type="number"],
input[type="search"] {
  /* Optimize input rendering */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  /* Disable unnecessary features */
  resize: none;
  /* Optimize font rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Reduce reflows during updates */
.product-variations-updating * {
  /* Disable transitions during updates */
  transition: none !important;
  animation: none !important;
}

/* ========================================
   MOBILE LIGHTBOX STYLES
   ======================================== */

.mobile-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.mobile-lightbox.active {
  opacity: 1;
  visibility: visible;
  overscroll-behavior: none;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--text);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  cursor: pointer;
  z-index: 10;
  transition: var(--button-transition);
  opacity: 0.8;
}

.lightbox-close:hover,
.lightbox-close:focus {
  opacity: 1;
  outline: none;
}

.lightbox-controls {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.lightbox-zoom-in,
.lightbox-zoom-out {
  background: var(--text);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  cursor: pointer;
  transition: var(--button-transition);
  opacity: 0.8;
}

.lightbox-zoom-in:hover,
.lightbox-zoom-out:hover,
.lightbox-zoom-in:focus,
.lightbox-zoom-out:focus {
  opacity: 1;
  outline: none;
}

.lightbox-zoom-in:disabled,
.lightbox-zoom-out:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.lightbox-image-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  max-height: calc(100% - 120px);
  overflow: hidden;
  position: relative;
}

.lightbox-image-container.is-zoomed {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition:
    width 0.3s ease,
    height 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.8;
}

/* Light mode specific overrides */
[data-theme="light"] .lightbox-overlay {
  background: #ffffff;
}

[data-theme="light"] .lightbox-close,
[data-theme="light"] .lightbox-zoom-in,
[data-theme="light"] .lightbox-zoom-out,
[data-theme="light"] .lightbox-counter {
  background: #0d0d0d;
  color: #ffffff;
}

/* Dark mode specific overrides */
[data-theme="dark"] .lightbox-overlay {
  background: #0d0d0d;
}

[data-theme="dark"] .lightbox-close,
[data-theme="dark"] .lightbox-zoom-in,
[data-theme="dark"] .lightbox-zoom-out,
[data-theme="dark"] .lightbox-counter {
  background: #ffffff;
  color: #0d0d0d;
}

/* Hide lightbox on desktop */
@media (min-width: 769px) {
  .mobile-lightbox {
    display: none !important;
  }
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  .lightbox-content {
    padding: 15px;
  }

  .lightbox-close {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
  }

  .lightbox-controls {
    top: 15px;
    left: 15px;
    gap: 8px;
  }

  .lightbox-zoom-in,
  .lightbox-zoom-out {
    width: 40px;
    height: 40px;
  }

  .lightbox-counter {
    bottom: 15px;
    font-size: 13px;
    padding: 6px 12px;
  }
}

@media (max-width: 480px) {
  .lightbox-content {
    padding: 10px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
  }

  .lightbox-controls {
    top: 10px;
    left: 10px;
    gap: 6px;
  }

  .lightbox-zoom-in,
  .lightbox-zoom-out {
    width: 36px;
    height: 36px;
  }

  .lightbox-counter {
    bottom: 10px;
    font-size: 12px;
    padding: 5px 10px;
  }

  .lightbox-image-container {
    max-height: calc(100% - 100px);
  }
}

/* ========================================
   IMAGE NAVIGATION ELEMENTS
   ======================================== */

/* Show image navigation arrows on desktop, hide on mobile */
.image-nav,
.image-nav-prev,
.image-nav-next {
  display: flex !important;
}

/* Hide image navigation arrows on mobile */
@media (max-width: 768px) {
  .image-nav,
  .image-nav-prev,
  .image-nav-next {
    display: none !important;
  }
}

/* ========================================
   BUNDLE PRODUCT ITEMS
   ======================================== */

.primefit-bundle-items {
  margin-bottom: 30px;
}

.primefit-bundle-submit--disabled {
  cursor: pointer;
}

@keyframes primefit-bundle-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    border-color: var(--product-border);
  }
  35% {
    box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.1);
    border-color: rgba(255, 68, 68, 0.95);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    border-color: var(--product-border);
  }
}

.primefit-bundle-pulse {
  animation: primefit-bundle-pulse 0.9s ease-in-out 2;
  will-change: box-shadow, border-color;
}

@media (prefers-reduced-motion: reduce) {
  .primefit-bundle-pulse {
    animation: none !important;
    border-color: rgba(255, 68, 68, 0.95) !important;
    box-shadow: 0 0 0 1px rgba(255, 68, 68, 0.1) !important;
  }
}

.primefit-bundle-item {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--product-border);
}

.primefit-bundle-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.primefit-bundle-item__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.primefit-bundle-item__title-wrapper {
  display: flex;
  align-items: center;
  flex: 1;
}

.primefit-bundle-item__title-wrapper .primefit-bundle-item__status {
  position: static;
  width: auto;
  height: auto;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.primefit-bundle-item__label {
  font-size: 18px;
  font-weight: 600;
  color: var(--product-text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.primefit-bundle-item__qty {
  font-size: 14px;
  color: var(--product-muted);
  font-weight: 400;
  margin-left: 4px;
}

.primefit-bundle-item__hint {
  font-size: 16px;
  color: var(--product-muted);
  font-weight: 400;
  margin-left: 8px;
  text-transform: none;
  letter-spacing: 0;
}

.primefit-bundle-item__price {
  display: none;
}

/* Bundle item color and size selections */
.primefit-bundle-item .product-color-selection {
  margin-bottom: 10px;
}

.primefit-bundle-item .product-size-selection {
  margin-bottom: 0;
}

/* Bundle pricing section */
.primefit-bundle-pricing {
  margin: 15px 0 30px;
  padding: 12px;
  background: #0d0d0d;
  color: #ffffff;
}

[data-theme="dark"] .primefit-bundle-pricing {
  background: #ffffff;
  color: #0d0d0d;
}

.primefit-bundle-pricing__line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 16px;
}

.primefit-bundle-pricing__line:last-child {
  margin-bottom: 0;
}

.primefit-bundle-pricing__line .label {
  color: inherit;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.primefit-bundle-pricing__line .value {
  color: inherit;
  font-weight: 600;
}

.primefit-bundle-pricing__bundle {
  font-size: 18px;
}

.primefit-bundle-pricing__bundle .label,
.primefit-bundle-pricing__bundle .value {
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.primefit-bundle-pricing__savings .value {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  padding: 4px 12px;
  background: var(--green);
  border-radius: 12px;
}

.primefit-bundle-pricing__savings .label {
  color: var(--green);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Bundle summary section */
.primefit-bundle-summary {
  margin: 24px 0;
  padding: 16px;
  background: #0d0d0d;
  color: #ffffff;
}

[data-theme="dark"] .primefit-bundle-summary {
  background: #ffffff;
  color: #0d0d0d;
}

.primefit-bundle-summary__status {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.primefit-bundle-summary__text {
  font-size: 14px;
  font-weight: 500;
  color: inherit;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.primefit-bundle-summary__progress {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  padding: 4px 12px;
  background: var(--product-accent);
  border-radius: 12px;
  min-width: 50px;
  text-align: center;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.primefit-bundle-summary--complete .primefit-bundle-summary__progress {
  background-color: var(--green);
  color: #fff;
}

.primefit-bundle-summary__missing {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

[data-theme="dark"] .primefit-bundle-summary__missing {
  color: rgba(0, 0, 0, 0.7);
}

.primefit-bundle-summary__missing-list {
  margin-top: 8px;
}

.primefit-bundle-summary__missing-item {
  margin-bottom: 6px;
  position: relative;
  text-transform: uppercase;
}

.primefit-bundle-summary__missing-item strong {
  color: inherit;
  font-weight: 600;
}

/* Bundle item visual state indicators */
.primefit-bundle-item__status {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.primefit-bundle-item__status--complete {
  opacity: 1;
}

.primefit-bundle-item__checkmark {
  width: 16px;
  height: 16px;
  color: var(--green);
  stroke-width: 2.5;
}

.primefit-bundle-item--complete .primefit-bundle-item__label {
  color: var(--green);
}

.primefit-bundle-item--complete .primefit-bundle-item__status {
  opacity: 1;
}

/* Responsive adjustments for bundle items */
@media (max-width: 768px) {
  .primefit-bundle-item__label {
    font-size: 16px;
  }

  .primefit-bundle-item__hint {
    font-size: 13px;
  }

  .primefit-bundle-pricing {
    padding: 20px;
  }

  .primefit-bundle-pricing__line {
    font-size: 14px;
  }

  .primefit-bundle-pricing__bundle {
    font-size: 16px;
  }

  .primefit-bundle-pricing__bundle .label,
  .primefit-bundle-pricing__bundle .value {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .primefit-bundle-item__title-wrapper {
    gap: 8px;
  }

  .primefit-bundle-item__label {
    font-size: 14px;
  }

  .primefit-bundle-pricing {
    padding: 16px;
  }
}

/* ========================================
   RELATED PRODUCTS CAROUSEL
   ======================================== */

.related-products-section {
  margin-top: 56px;
  padding-top: 8px;
  --carousel-gutter: 20px;
}

.related-products-section .pf-mini-cart-section-title {
  margin-bottom: 20px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.related-products-section .pf-mini-cart-carousel {
  margin-right: calc(50% - 50vw);
  padding-right: calc(50vw - 50%);
}

.related-products-section .pf-mini-cart-carousel__track {
  margin-right: 0;
  padding-right: 0;
  margin-left: calc(-1 * var(--carousel-gutter));
  padding-left: var(--carousel-gutter);
  scroll-padding-left: var(--carousel-gutter);
}

.related-products-section .pf-mini-cart-product-card {
  flex: 0 0 calc(28.571% - 11px);
}

@media (max-width: 1024px) {
  .related-products-section {
    --carousel-gutter: 15px;
  }

  .related-products-section .pf-mini-cart-product-card {
    flex: 0 0 calc(40% - 8px);
  }
}

@media (max-width: 640px) {
  .related-products-section {
    margin-top: 40px;
  }

  .related-products-section .pf-mini-cart-section-title {
    font-size: 22px;
    margin-bottom: 14px;
  }

  .related-products-section .pf-mini-cart-product-card {
    flex: 0 0 calc(66.667% - 8px);
  }
}

@media (max-width: 480px) {
  .related-products-section {
    --carousel-gutter: 16px;
  }
}
