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

/* ==========================================================================
   DESKTOP LAYOUT - Sticky Gallery
   ========================================================================== */

@media (min-width: 1025px) {
  
  /* Product container - max width wrapper */
  .product-container {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--pad);
  }
  
  /* Main grid - 60/40 split */
  .product-main {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: var(--space-3xl);
    margin-top: var(--space-xl);
    align-items: start;
  }
  
  /* Gallery - STICKY (stops automatically at parent end) */
  .product-gallery {
    position: sticky;
    top: 0;
    height: auto;
    max-height: 100vh;
    overflow: hidden;
    align-self: start;
  }
  
  /* Summary scrolls normally */
  .product-summary {
    min-height: 100vh; 
    padding-bottom: var(--space-3xl);
  }
}

/* Gallery wrapper and slides */
.product-gallery-wrapper {
  position: relative;
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-lg);
}

.product-gallery-slides {
  position: relative;
  width: 100%;
  height: 70vh;
  max-height: 600px;
}

.product-gallery-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-gallery-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.product-gallery-slide img {
  width: 100%;
  height: auto;
  max-height: 100%;
  display: block;
  object-fit: contain;
}

/* Gallery Navigation */
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
  color: white;
}

.gallery-nav:hover {
  background: rgba(0, 0, 0, 0.7);
}

.gallery-nav-prev {
  left: var(--space-base);
}

.gallery-nav-next {
  right: var(--space-base);
}

/* Gallery Dots */
.product-gallery-dots {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 10;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s;
}

.gallery-dot.active {
  background: rgba(0, 0, 0, 0.8);
}

/* Gallery Thumbnails */
.product-gallery-thumbs {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 11;
  pointer-events: none;
}

.product-gallery-wrapper:hover .product-gallery-thumbs {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.product-gallery-wrapper:hover .product-gallery-dots {
  opacity: 0;
  visibility: hidden;
}

.gallery-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  background: white;
}

.gallery-thumb.active {
  border-color: var(--c-black);
}

.gallery-thumb:hover {
  border-color: var(--c-gray-400);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

/* ==========================================================================
   PRODUCT SUMMARY TYPOGRAPHY
   ========================================================================== */

.product-title {
  font-size: var(--text-3xl);
  font-family: var(--font-heading);
  font-weight: 800;
  margin: 0 0 var(--space-base);
  line-height: 1.2;
}

.product-price {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-base);
}

.product-sku {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  margin-bottom: var(--space-lg);
}

.variations-title {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-heading);
  margin-bottom: var(--space-base);
}

/* ==========================================================================
   ACCORDION PANELS
   ========================================================================== */

/* ==========================================================================
   ACCORDION PANELS - SMOOTH VERSION
   Replace the accordion section in your single-product.css
   ========================================================================== */

.product-details {
  margin-top: var(--space-2xl);
}

.product-detail-panel {
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-base);
  overflow: hidden;
}

.product-detail-panel__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-base) var(--space-lg);
  background: var(--c-white);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  text-align: left;
}

.product-detail-panel__toggle:hover {
  background: var(--c-bg-secondary);
}

.product-detail-panel__title {
  font-size: var(--text-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.product-detail-panel__icon {
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.product-detail-panel.is-open .product-detail-panel__icon {
  transform: rotate(180deg);
}

/* Content wrapper - uses grid for smooth animation */
.product-detail-panel__content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.product-detail-panel.is-open .product-detail-panel__content {
  grid-template-rows: 1fr;
}

/* Inner content */
.product-detail-panel__content > div {
  overflow: hidden;
}

.product-detail-panel__inner {
  padding: 0 var(--space-lg) var(--space-lg);
}

.product-detail-panel__inner p {
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}

.product-detail-panel__inner ul,
.product-detail-panel__inner ol {
  margin-left: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.product-detail-panel__inner li {
  margin-bottom: var(--space-xs);
  line-height: 1.6;
}

/* ==========================================================================
   TRUST BADGES
   ========================================================================== */

.product-trust-badges {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: var(--c-bg-secondary);
  border-radius: var(--radius-md);
}

.trust-badge {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
}

.trust-badge svg,
.trust-badge img {
  flex-shrink: 0;
  color: var(--c-text-primary);
  margin-top: 2px;
  width: 45px;
  height: 20px;
  vertical-align: center;
  object-fit: contain;
}

.trust-badge-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.payment-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.payment-methods img {
  height: 28px;
  width: 45px;
  object-fit: contain;
}

/* ==========================================================================
   PRODUCT SLIDER
   ========================================================================== */

.aor-ps {
  position: relative;
  padding: 24px 0 32px;
}

.aor-ps__heading {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-2xl);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 var(--space-lg);
}

.aor-ps__viewport {
  overflow: hidden;
  margin: 0 calc(var(--aor-teaser, 0px) * -1);
}

.aor-ps__track {
  display: flex;
  gap: var(--space-base);
  transition: transform 0.4s ease;
}

.aor-ps__item {
  flex: 0 0 calc((100% - var(--aor-teaser, 0px)) / 4 - var(--space-base) * 3 / 4);
  min-width: 0;
}

@media (max-width: 1100px) {
  .aor-ps__item {
    flex: 0 0 calc(100% / 3 - var(--space-base) * 2 / 3);
  }
}

@media (max-width: 820px) {
  .aor-ps__item {
    flex: 0 0 calc(100% / 2 - var(--space-base) / 2);
  }
}

.aor-ps__media {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  background: var(--c-bg-secondary);
}

.aor-ps__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s;
}

.aor-ps__media:hover img {
  transform: scale(1.05);
}

.aor-ps__title {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--c-text-primary);
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
  line-height: 1.3;
}

.aor-ps__title:hover {
  color: var(--c-red);
}

.aor-ps__price {
  font-weight: 700;
  font-size: var(--text-base);
}

.aor-ps__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aor-ps__arrow:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.7);
}

.aor-ps__arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.aor-ps__arrow--prev {
  left: -22px;
}

.aor-ps__arrow--next {
  right: -22px;
}

.aor-ps__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: var(--space-lg);
}

.aor-ps__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-gray-300);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s;
}

.aor-ps__dot.is-active {
  background: var(--c-black);
}

/* ==========================================================================
   STICKY BAR
   ========================================================================== */

.product-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--c-white);
  border-top: 1px solid var(--c-border-medium);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
  z-index: 999;
}

.product-sticky-bar__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: var(--space-base) var(--space-lg);
  display: grid;
  grid-template-columns: 2fr 2fr 3fr;
  gap: var(--space-2xl);
  align-items: center;
}

/* LEFT: Image + Name */
.sticky-bar-left {
  display: flex;
  align-items: center;
  gap: var(--space-base);
}

.sticky-bar-thumb {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: white;
}

.sticky-bar-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sticky-bar-name {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-heading);
  line-height: 1.3;
}

/* CENTER: Selected options + Stock */
.sticky-bar-center {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.sticky-bar-variations {
  font-size: 14px;
  color: var(--c-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.stock-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.stock-badge.in-stock {
  color: #16a34a;
  background: #f0fdf4;
}

.stock-badge.out-of-stock {
  color: #dc2626;
  background: #fef2f2;
}

.stock-badge.low {
  color: #ea580c;
  background: #fff7ed;
}

/* RIGHT: Price + Button */
.sticky-bar-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 40px;
}

.sticky-bar-price {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-price);
  flex-shrink: 0;
  white-space: nowrap;
}

.sticky-bar-button {
  padding: 10px 32px;
  min-height: 42px;
  background: var(--c-black);
  color: var(--c-white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.sticky-bar-button:hover:not(:disabled) {
  background: var(--c-gray-800);
  transform: translateY(-1px);
}

.sticky-bar-button:disabled {
  background: var(--c-gray-400);
  cursor: not-allowed;
  opacity: 0.6;
}

/* ==========================================================================
   MOBILE - Responsive Layout
   ========================================================================== */

@media (max-width: 1024px) {
  .product-main {
    display: block;
    padding-bottom: 120px;
  }

  .product-gallery {
    position: relative !important;
    height: auto !important;
    margin-bottom: var(--space-xl);
  }
  
  .product-gallery-wrapper {
    padding: 0;
  }
  
  .product-gallery-slides {
    height: auto;
    min-height: 400px;
  }

  .product-summary {
    width: 100%;
    padding-bottom: 0;
    min-height: 0 !important;
  }

  /* Mobile sticky bar */
  .product-sticky-bar__inner {
    grid-template-columns: 1fr auto;
    gap: var(--space-base);
    padding: var(--space-base);
    align-items: stretch;
  }

  .sticky-bar-left {
    grid-column: 1;
    grid-row: 1;
    flex-direction: row;
    align-items: center;
    gap: var(--space-sm);
  }

  .sticky-bar-thumb {
    width: 44px;
    height: 44px;
  }

  .sticky-bar-name {
    font-size: 12px;
  }

  .sticky-bar-center {
    grid-column: 1;
    grid-row: 2;
    padding-top: 0;
  }

  .sticky-bar-variations {
    font-size: 11px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .sticky-bar-right {
    grid-column: 2;
    grid-row: 1 / 3;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    align-items: flex-end;
  }

  .sticky-bar-price {
    font-size: 16px;
    font-weight: 700;
  }

  .sticky-bar-button {
    padding: 12px 20px;
    min-height: 44px;
    font-size: 13px;
    width: auto;
    white-space: nowrap;
  }
}