/* ─────────────────────────────────────────────────────────────────────────────
   GNEXT API — styles for API-driven UI only.

   Scoped to classes the API layer introduces, so it cannot affect existing
   page styling. Safe to remove alongside the /api folder.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Loading skeletons ── */
@keyframes gnextShimmer {
  0%   { background-position: -420px 0; }
  100% { background-position: 420px 0; }
}

/* .product-card starts at opacity:0 in common.css and only reaches 1 via
   the page's scroll-in IntersectionObserver adding .animate — skeleton
   cards are synthetic loading placeholders, not scroll-triggered content,
   so they need to be visible immediately rather than waiting for that. */
.gnext-skeleton {
  pointer-events: none;
  opacity: 1;
}

.gnext-skeleton .product-card-image,
.gnext-skeleton .sk-line {
  background: linear-gradient(90deg, #f0f0f2 25%, #e6e6e9 50%, #f0f0f2 75%);
  background-size: 840px 100%;
  animation: gnextShimmer 1.3s linear infinite;
  border-radius: 8px;
}

.gnext-skeleton .product-card-image { min-height: 150px; }

.gnext-skeleton .sk-line {
  height: 12px;
  margin: 12px auto 0;
  border-radius: 999px;
}

.gnext-skeleton .sk-line-title { width: 65%; }
.gnext-skeleton .sk-line-price { width: 45%; height: 10px; }

@media (prefers-reduced-motion: reduce) {
  .gnext-skeleton .product-card-image,
  .gnext-skeleton .sk-line { animation: none; }
}

/* ── Product configurator ── */
.gnext-pdp {
  width: min(1148px, 100% - 32px);
  margin: 0 auto;
  padding: 28px 0 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 44px;
  align-items: start;
}

/* Gallery */
.gnext-gallery { position: sticky; top: 120px; }

.gnext-gallery-main {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  background: #f5f5f7;
  border-radius: 16px;
  overflow: hidden;
}

.gnext-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 24px;
  transition: opacity 180ms ease;
}

.gnext-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.gnext-thumb {
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  padding: 6px;
  display: grid;
  place-items: center;
  background: #f5f5f7;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.gnext-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gnext-thumb:hover { transform: translateY(-2px); }
.gnext-thumb.is-active { border-color: #e60012; }

/* Options panel */
.gnext-pdp-title {
  margin: 0 0 6px;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1d1d1f;
}

.gnext-pdp-sku {
  margin: 0 0 4px;
  color: #6e6e73;
  font-size: 0.82rem;
}

.gnext-pdp-price {
  margin: 0 0 26px;
  font-size: 1.06rem;
  font-weight: 600;
  color: #1d1d1f;
}

.gnext-pdp-price .was {
  margin-left: 10px;
  color: #6e6e73;
  font-weight: 400;
  text-decoration: line-through;
}

.gnext-group { margin-bottom: 26px; }

.gnext-group-label {
  display: block;
  margin-bottom: 11px;
  font-size: 0.95rem;
  font-weight: 650;
  color: #1d1d1f;
}

.gnext-options { display: flex; flex-wrap: wrap; gap: 10px; }

/* Text swatches (storage etc.) */
.gnext-opt {
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid #d2d2d7;
  border-radius: 10px;
  color: #1d1d1f;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.gnext-opt:hover { border-color: #86868b; transform: translateY(-1px); }

.gnext-opt.is-active {
  border-color: #e60012;
  background: rgba(230, 0, 18, 0.04);
}

.gnext-opt:focus-visible { outline: 2px solid #e60012; outline-offset: 2px; }

/* Colour swatches */
.gnext-opt-color {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  position: relative;
}

.gnext-opt-color .dot {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.gnext-opt-color.is-active { box-shadow: 0 0 0 2px #fff inset; }

.gnext-color-name {
  margin-top: 9px;
  color: #6e6e73;
  font-size: 0.84rem;
}

/* States */
.gnext-status {
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.gnext-status-error {
  background: #fff4f4;
  border: 1px solid #ffd4d4;
  color: #a3161d;
}

.gnext-status-info {
  background: #f5f5f7;
  border: 1px solid #e3e3e6;
  color: #424245;
}

.gnext-pdp-loading { opacity: 0.55; pointer-events: none; }

@media (max-width: 900px) {
  .gnext-pdp { grid-template-columns: 1fr; gap: 30px; }
  .gnext-gallery { position: static; }
}
