/* Product Page Layout */
.product-page {
  padding: 40px 0 100px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-400);
  margin-bottom: 40px;
}

.breadcrumb a {
  transition: color 0.3s;
}

.breadcrumb a:hover {
  color: var(--text-100);
}

.breadcrumb .current {
  color: var(--text-100);
  font-weight: 500;
}

.product-container {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 80px;
  align-items: start;
}

/* Gallery Details */
.product-gallery {
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-gallery-main {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-surface);
  aspect-ratio: 4/5;
}

.product-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.product-gallery-main img.fade-out {
  opacity: 0.5;
}

.product-gallery-main .product-badges {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
}

.product-gallery-thumbs {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none; /* Firefox */
}

.product-gallery-thumbs::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

.thumb-btn {
  width: 80px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: var(--bg-surface);
  transition: border-color 0.3s;
  cursor: pointer;
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.thumb-btn.active {
  border-color: var(--text-100);
}

/* Info Details */
.product-info .product-title {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 16px;
}

.product-info .product-price {
  margin-bottom: 24px;
}

.product-info .product-price .current {
  font-size: 24px;
}

.product-description {
  color: var(--text-200);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--glass-border);
}

.product-variants {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.variant-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.variant-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-100);
}

.selected-value {
  color: var(--text-400);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* Color Variant specifics */
.color-options {
  display: flex;
  gap: 12px;
}

.color-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  position: relative;
  transition: transform 0.3s;
}

.color-btn::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: border-color 0.3s;
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.active::after {
  border-color: var(--text-100);
}

/* Size Variant specifics */
.size-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.size-btn {
  height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-100);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

.size-btn:hover:not(.out-of-stock) {
  border-color: var(--text-100);
}

.size-btn.active {
  background: var(--text-100);
  color: #fff;
  border-color: var(--text-100);
}

.size-btn.out-of-stock {
  opacity: 0.5;
  text-decoration: line-through;
  cursor: not-allowed;
  background: rgba(255,255,255,0.05); /* Faint dark mode */
}

/* Add to cart row */
.add-to-cart-wrapper {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
}

.quantity-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  height: 52px;
  padding: 0 8px;
  background: var(--bg-surface);
}

.qty-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-100);
}

#qtyInput {
  width: 40px;
  border: none;
  background: transparent;
  text-align: center;
  color: var(--text-100);
  font-size: 16px;
  font-weight: 500;
  font-family: var(--font-main);
  outline: none;
}

.btn-add {
  flex: 1;
  height: 52px;
  position: relative;
  overflow: hidden;
}

.btn-loader {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s infinite linear;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.btn-add.loading {
  pointer-events: none;
}
.btn-add.loading .btn-text {
  opacity: 0;
}
.btn-add.loading .btn-loader {
  display: block;
}

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

/* Accordions */
.product-accordions {
  border-top: 1px solid var(--glass-border);
}

.accordion {
  border-bottom: 1px solid var(--glass-border);
}

.accordion-trigger {
  width: 100%;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-100);
}

.accordion-trigger .icon {
  transition: transform 0.3s ease;
}

.accordion.active .accordion-trigger .icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  color: var(--text-200);
  font-size: 15px;
  line-height: 1.6;
}

.accordion.active .accordion-content {
  padding-bottom: 24px;
  /* js sets max-height dynamically */
}

@media (max-width: 1024px) {
  .product-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .product-gallery {
    position: relative;
    top: 0;
  }
}
