/* Product details composition layer */

.product-section {
  padding-block: var(--sf-space-8);
}

.container {
  width: min(100%, var(--sf-container-max));
  margin-inline: auto;
  padding-inline: var(--sf-space-4);
}

.product-container {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--sf-space-6);
}

.product-images {
  background: var(--theme-card-bg);
  border: 1px solid var(--sf-border-subtle);
  border-radius: var(--sf-radius-lg);
  padding: var(--sf-space-4);
  box-shadow: var(--sf-shadow-soft);
  max-width: 620px;
  width: 100%;
  margin-inline: auto;
}

.product-image-main {
  width: 100%;
  min-height: 0;
  height: auto;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--theme-section-bg) 88%, transparent);
  border-radius: var(--sf-radius-md);
  border: 1px solid color-mix(in srgb, var(--theme-border) 80%, transparent);
}

.product-image-main img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(620px, 72vh);
  object-fit: contain !important;
  object-position: center;
}

.product-image-main .premium-badge-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

.product-thumbnails {
  margin-top: var(--sf-space-3);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: var(--sf-space-2);
}

.thumbnail {
  width: 100%;
  min-height: 82px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--theme-border);
  cursor: pointer;
  background: color-mix(in srgb, var(--theme-section-bg) 85%, transparent);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center;
}

.thumbnail.active {
  border-color: var(--theme-primary-btn-border);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-primary-btn-bg) 24%, transparent);
}

.product-details {
  display: grid;
  gap: var(--sf-space-4);
}

.product-name {
  font-size: clamp(1.4rem, 2.8vw, 2rem);
}

.product-description {
  line-height: 1.9;
}

.product-info {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sf-space-3);
}

.price-range {
  color: var(--theme-nav-active);
  font-weight: 700;
}

.product-form {
  background: color-mix(in srgb, var(--theme-section-bg) 92%, transparent);
  border: 1px solid var(--sf-border-subtle);
  border-radius: var(--sf-radius-lg);
  padding: var(--sf-space-4);
}

.selected-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.price-display {
  color: var(--theme-nav-active);
}

.share-btn {
  background: var(--theme-secondary-btn-bg);
  color: var(--theme-secondary-btn-text);
  border-color: var(--theme-secondary-btn-border);
}

.stock-info {
  border: 1px dashed color-mix(in srgb, var(--theme-border) 75%, transparent);
  border-radius: var(--sf-radius-md);
  padding: 10px 12px;
  color: var(--theme-text-muted);
  text-align: center;
}

.product-form .add-to-cart-btn,
.product-form .share-btn {
  width: 100%;
}

@media (max-width: 900px) {
  .product-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .product-section {
    padding-block: var(--sf-space-5);
  }

  .container {
    padding-inline: 12px;
  }

  .product-images,
  .product-form {
    padding: var(--sf-space-3);
  }

  .product-image-main {
    min-height: 0;
    height: auto;
  }

  .product-image-main img {
    max-height: min(420px, 62vh);
  }

  .product-thumbnails {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .selected-price {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .product-name {
    font-size: 1.25rem;
  }
}
