/* =================================
    storefront/product-pages.css
================================= */

/* ========================================
   PRODUCT PAGE LAYOUT
======================================== */

.product-page {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr), minmax(420px, 0.85fr);
  gap: clamp(3rem, 6vw, 6rem);
  margin-top: var(--space-6);
  padding: 0 var(--space-7);
}

.product-page > * {
  min-width: 0;
}

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

.product-gallery {
  margin-bottom: auto;
  width: 100%;
  max-width: 42rem;
  padding: var(--space-4);
}

.product-gallery__main {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.product-gallery__main > .product-gallery__img {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery__thumbs {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.product-gallery__thumb {
  flex: 0 0 auto;
  width: clamp(60px, 8vw, 80px);
  height: clamp(60px, 8vw, 80px);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 0;
  cursor: pointer;
  opacity: 0.85;
  transition:
    opacity 0.2s ease,
    border-color 0.2s ease;
}

.product-gallery__thumb > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-gallery__thumb:hover {
  opacity: 1;
}

.product-gallery__thumb.is-active {
  opacity: 1;
  border-color: var(--color-text-muted);
}

/* ========================================
   HEADER
======================================== */

.product-panel {
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  gap: var(--space-6);
  padding-top: var(--space-8);
}

.product-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.product-title {
  margin: 0;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-rating {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* ========================================
   BUY BOX
======================================== */

.visually-hidden {
  display: none;
}

.product-buy {
  padding: var(--space-4);
}

.product-buy__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.product-price {
  font-size: var(--fs-6);
  font-weight: 700;
  color: var(--color-text-strong);
}

.product-price__note {
  font-size: var(--fs-2);
  margin-top: var(--space-1);
}

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

.form__hint {
  margin-top: 0.35rem;
  font-size: var(--fs-1);
}

.product-cta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  align-items: center;
}

.product-cta ion-icon {
  width: 1.4rem;
  height: 1.4rem;
}

.badge {
  margin-top: var(--space-2);
}

/* ========================================
   DESCRIPTION / SPECIFICATIONS
======================================== */

.product-description {
  line-height: 1.6;
  color: var(--color-text);
}

.spec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.spec-list__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-2);
}

.spec-list__label {
  font-size: var(--fs-2);
}

.spec-list__value {
  font-size: var(--fs-2);
  text-align: right;
}

/* ========================================
   RESPONSIVE TWEAKS
======================================== */

@media (max-width: 767px) {
  .product-gallery {
    padding: var(--space-2);
  }

  .product-gallery__main {
    aspect-ratio: 1 / 1;
  }

  .product-gallery__thumbs {
    max-width: 100%;
    overflow-x: auto;
  }

  .product-gallery__thumb {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
  }

  .product-cta {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) {
  .product-page {
      grid-template-columns: 1fr 1fr;
      align-items: center;
      gap: var(--space-7);
  }
}

@media (min-width: 1024px) {
  .product-page {
      grid-template-columns:
        minmax(0, 1.1fr)
        minmax(0, 0.9fr);
  }
}