/* Product details page: gallery + buy box, bundle, product information, reviews, export bar.
   Shared pieces (breadcrumb, carousel, product card, qty, form controls) live in components.css. */
.page-main--product { --section-gap: clamp(40px, 3.33vw, 48px); }

/* ---- gallery | buy box ---- */
.product { display: grid; gap: 24px; align-items: start; }

.gallery { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.carousel--gallery { --track-gap: 0px; --room: 0px; margin-bottom: 0; } /* dots live inside the frame */
.gallery__frame {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  box-shadow: var(--shadow-raised);
}
.gallery__slide { aspect-ratio: 660 / 627; }
.gallery__slide img { width: 100%; height: 100%; object-fit: contain; }
.carousel--gallery .carousel__controls { position: absolute; inset: 0; pointer-events: none; }
.carousel--gallery .carousel__arrow {
  position: absolute;
  top: 50%;
  left: 16px;
  translate: 0 -50%;
  border: 3px solid var(--c-page);
  border-radius: 4px;
  background: var(--c-surface);
  pointer-events: auto;
}
.carousel--gallery .carousel__arrow--next { left: auto; right: 16px; color: var(--c-green); }
.carousel--gallery .carousel__arrow:disabled { opacity: 1; color: var(--c-text-muted); }
.carousel--gallery .carousel__dots { position: absolute; left: 0; right: 0; bottom: 19px; gap: 10px; pointer-events: auto; }
.carousel--gallery .carousel__dot {
  width: 10px;
  height: 10px;
  background: #fafafa;
  box-shadow: inset 0 0 5px rgb(0 0 0 / 30%);
}
.carousel--gallery .carousel__dot[aria-current="true"] { background: var(--c-green); box-shadow: none; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(8px, 1.11vw, 16px); }
.gallery__thumbs button {
  display: block;
  width: 100%;
  aspect-ratio: 120 / 114;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  box-shadow: var(--shadow-raised);
}
.gallery__thumbs button[aria-current="true"] { box-shadow: var(--shadow-raised), inset 0 0 0 2px var(--c-green); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.gallery__zoom { position: absolute; top: 16px; right: 16px; z-index: 1; } /* opens the full-screen view */

/* full-screen view of the gallery (ctheme2.js opens it on the zoom button and shows the current photo): a light
   backdrop, as many photos are dark devices on transparent PNG */
.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  padding: clamp(16px, 4vw, 48px);
  border: 0;
  background: color-mix(in srgb, var(--c-page) 96%, transparent);
}
.lightbox::backdrop { background: var(--c-dim); }
.lightbox[open] { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.lightbox__photo { grid-column: 2; width: 100%; height: 100%; max-height: calc(100dvh - 2 * clamp(16px, 4vw, 48px)); object-fit: contain; }
.lightbox .carousel__arrow { background: var(--c-surface); border-radius: var(--radius-xs); box-shadow: var(--shadow-raised); }
.lightbox__close { position: absolute; top: clamp(16px, 4vw, 48px); right: clamp(16px, 4vw, 48px); }

.buybox { display: flex; flex-direction: column; gap: 24px; min-width: 0; padding: clamp(16px, 1.67vw, 24px); }
.buybox__head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "title title" "rating share" "sku sku";
  align-items: center;
  gap: 4px 24px;
}
.buybox__title { grid-area: title; font-size: var(--fs-h4); line-height: 1.5; }
.buybox__share { grid-area: share; align-self: start; display: grid; place-items: center; width: 32px; height: 32px; }
.buybox__share:hover { color: var(--c-green); }
.buybox__rating { grid-area: rating; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.buybox__sku { grid-area: sku; margin-top: 4px; font-size: var(--fs-md); line-height: 20px; }

.variant { display: flex; flex-direction: column; gap: 16px; }
.variant__label strong { font-weight: 600; }
.variant__options { display: flex; gap: 8px; }
.swatch {
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: var(--radius-xs);
  background: var(--c-surface);
  box-shadow: var(--shadow-raised);
}
.swatch[aria-checked="true"] { box-shadow: var(--shadow-raised), inset 0 0 0 2px var(--c-green); }
.swatch img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }

.buybox__prices { display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-md); line-height: 20px; }
.buybox__prices p { display: flex; flex-direction: column; }
.buybox__price-vat { color: var(--c-green); font-size: var(--fs-h3); font-weight: 700; line-height: 1.3125; letter-spacing: 1px; }
.buybox__price-net { margin-top: 4px; font-size: var(--fs-xl); font-weight: 700; line-height: 24px; }

.buybox__qty { display: flex; align-items: center; justify-content: center; gap: 8px; } /* phones: centred as a group (user 10-05) */
.buybox__actions { display: flex; gap: 8px; }
.buybox__actions .btn--primary { flex: 1; }
.buybox__actions .icon-btn { width: 48px; height: 48px; box-shadow: var(--shadow-raised-sm); } /* as tall as the button at every width */

/* Inbank instalment calculator */
.instalment { display: flex; flex-direction: column; gap: 24px; }
.instalment__summary { display: flex; flex-direction: column; gap: 4px; padding-inline: 8px; }
.instalment__summary strong { font-weight: 600; line-height: 22px; }
.instalment__summary span { color: var(--c-text-muted); font-size: var(--fs-sm); line-height: 16px; }
.calculator {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 16px 12px;
  border-radius: var(--radius-md);
  background: var(--c-green-tint);
}
.calculator__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.calculator__monthly {
  padding: 2px 8px;
  border: 1px solid var(--c-green);
  border-radius: var(--radius-xs);
  color: var(--c-green);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 20px;
}
.calculator__form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.calculator__field {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 4px;
  border-radius: var(--radius-xs);
  background: var(--c-surface);
}
.calculator__field select {
  padding-right: 20px;
  border: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6l4.5 4.5L12.5 6' fill='none' stroke='%231b1b1b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right center / 16px no-repeat;
  appearance: none;
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 20px;
}
.calculator__form .btn { flex: 1 1 160px; min-height: 32px; padding-block: 6px; }
.calculator__terms { font-size: var(--fs-sm); line-height: 15px; }

.note { display: flex; flex-direction: column; gap: 8px; }
.note__title { font-size: var(--fs-xl); font-weight: 600; line-height: 30px; }

/* ---- "Dažnai perkama": two products + bundle price ---- */
/* stacked on narrow screens; from 1024 one row: card + card + bundle price */
.bundle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8px;
  border-radius: var(--radius-xl);
  background: var(--c-surface-muted);
  box-shadow: var(--shadow-raised);
}
.bundle > .product-card { width: min(100%, 360px); }
.bundle__plus { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: var(--c-green); color: #fff; }
.bundle__total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 24px;
  text-align: center;
}
.bundle__title { font-size: var(--fs-lg); font-weight: 600; line-height: 22px; }
.bundle__prices { display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-sm); line-height: 16px; }
.bundle__prices p { display: flex; flex-direction: column; align-items: center; }
.bundle__price { color: var(--c-green); font-size: var(--fs-h3); font-weight: 700; line-height: 1.3125; letter-spacing: 1px; }
.bundle__price-regular { margin-top: 4px; font-size: var(--fs-xl); font-weight: 700; line-height: 24px; }

/* ---- product information + reviews panels ---- */

/* specifications: attribute groups in .flow-columns (balanced 1 / 2 / 3 columns); a group may continue in the
   next column */
.specs__group {
  margin-bottom: 16px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--c-surface-muted);
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 22px;
}
.specs__row {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--c-border);
}
.specs__row:last-child { padding-bottom: 0; border-bottom: 0; }
.specs__row dt { flex: 1; color: var(--c-text-muted); }
.specs__row dd { flex: 1; margin: 0; font-weight: 600; line-height: 22px; padding-top: 1px; }
.specs__report { color: var(--c-text-muted); }
.specs__report a { color: var(--c-green); }
.specs__report a:hover { text-decoration: underline; }
.disclaimer { display: flex; align-items: center; gap: 4px; color: var(--c-text-muted); }

/* reviews */
.reviews { display: grid; gap: 48px; }
.reviews__main { display: flex; flex-direction: column; gap: 48px; min-width: 0; }
.reviews__subtitle { font-size: var(--fs-xl); font-weight: 600; line-height: 30px; }
.rating-summary { display: flex; flex-direction: column; gap: 24px; }
.rating-summary__body { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.rating-summary__score {
  flex: 0 0 144px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-right: 16px;
  border-right: 1px solid var(--c-divider);
  font-size: var(--fs-md);
  line-height: 20px;
}
.rating-summary__value { font-size: var(--fs-h3); font-weight: 700; line-height: 1.3125; letter-spacing: 1px; }
.rating-summary__score .stars { margin-bottom: -4px; }
.rating-bars { flex: 1 1 260px; display: flex; flex-direction: column; gap: 16px; }
.rating-bars li { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); line-height: 16px; }
.rating-bars progress {
  flex: 1;
  height: 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--c-border);
  appearance: none;
  overflow: hidden;
}
.rating-bars progress::-webkit-progress-bar { background: var(--c-border); }
.rating-bars progress::-webkit-progress-value { background: var(--c-green); border-radius: var(--radius-pill); }
.rating-bars progress::-moz-progress-bar { background: var(--c-green); border-radius: var(--radius-pill); }
.rating-bars span { min-width: 21px; text-align: right; }

.review-list { display: flex; flex-direction: column; gap: 16px; }
.review {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--c-surface-muted);
}
.review__main { display: flex; flex-direction: column; gap: 8px; }
/* phones: avatar | name over date, stars + label across the card; from 480: avatar | name ... date, stars below */
.review__head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-areas: "avatar name" "avatar date" "rating rating";
  align-items: start;
  gap: 4px 8px;
}
.review__avatar { grid-area: avatar; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.review__name { grid-area: name; padding-top: 1px; font-weight: 600; line-height: 22px; }
.review__rating { grid-area: rating; display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; color: var(--c-text-muted); font-size: var(--fs-md); line-height: 20px; }
.review__rating > span:last-child { flex-basis: 100%; } /* own line under the stars below 1024 */
.review__date { grid-area: date; color: var(--c-text-muted); font-size: var(--fs-sm); line-height: 16px; white-space: nowrap; }
.review__text { color: var(--c-text-muted); font-size: var(--fs-md); line-height: 20px; }
.review__helpful { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; white-space: nowrap; color: var(--c-text-muted); font-size: var(--fs-sm); line-height: 16px; }
.review__votes { display: flex; gap: 16px; }
.review__votes button { display: grid; place-items: center; color: var(--c-text); }
.review__votes button:hover { color: var(--c-green); }

.review-form { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.review-form__fields { display: flex; flex-direction: column; gap: 16px; }
.rating-input { display: flex; align-items: center; gap: 8px; }
.rating-input__stars { display: flex; }
.rating-input__stars button { display: grid; place-items: center; width: 24px; height: 24px; color: var(--c-star); }
.rating-input__stars [aria-checked="true"] ~ button { color: var(--c-border); }
.rating-input__hint { color: var(--c-text-muted); font-size: var(--fs-sm); line-height: 16px; }

/* ---- export bar ---- */
.export-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 24px; }
.export-bar__title { flex: 1 1 280px; }
.export-bar__link {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  background: var(--c-surface);
  color: var(--c-green);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 24px;
}
.export-bar__link:hover { background: var(--c-green-tint); }

@media (min-width: 480px) {
  .review__head { grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-areas: "avatar name date" "avatar rating rating"; }
}
@media (min-width: 768px) {
  .buybox__qty { justify-content: flex-start; }
  .buybox__head { grid-template-areas: "title share" "rating rating" "sku sku"; }
  .bundle { display: grid; grid-template-columns: 1fr 48px 1fr; }
  .bundle > .product-card { width: auto; }
  .bundle__total { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .bundle { grid-template-columns: 318fr 48px 318fr 318fr; gap: 24px; width: min(100%, 1090px); }
  .bundle__total { grid-column: auto; }
  .reviews { grid-template-columns: minmax(0, 629fr) minmax(0, 571fr); }
  .product { grid-template-columns: 1fr 1fr; }
  .review__rating { flex-wrap: nowrap; }
  .review__rating > span:last-child { flex-basis: auto; }
}
