.single-product .sunpal-product-video-block {
  grid-column: 1 / -1 !important;
  order: 2;
  margin-top: clamp(40px, 6vw, 72px);
}

.single-product .sunpal-pdp-tabs {
  grid-column: 1 / -1 !important;
  order: 2;
}

.single-product .sunpal-product-reviews-section {
  grid-column: 1 / -1 !important;
  order: 6;
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: clamp(28px, 4vw, 40px);
  border-top: 1px solid var(--line);
}

.sunpal-product-reviews-section > header {
  margin-bottom: 24px;
}

.sunpal-product-reviews-section > header p {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sunpal-product-reviews-section > header h2 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.1;
  letter-spacing: -.02em;
}

.sunpal-product-video-block .sunpal-product-video video,
.sunpal-product-video-block .sunpal-product-video iframe {
  display: block;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 6px;
  background: #0b0f0c;
}

.sunpal-product-video-caption {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
}

.single-product .sunpal-product-experience,
.single-product .sunpal-premium-100ah-shell,
.single-product .sunpal-premium-200ah-shell,
.single-product .sunpal-product-story-shell,
.single-product .sunpal-product-media,
.single-product .sunpal-product-specs {
  grid-column: 1 / -1 !important;
  grid-row: auto !important;
}

.single-product .sunpal-product-experience,
.single-product .sunpal-premium-100ah-shell,
.single-product .sunpal-premium-200ah-shell { order: 3; }
.single-product .sunpal-product-media { order: 4; }
.single-product .sunpal-product-specs { order: 5; }
.single-product section.related {
  grid-column: 1 / -1 !important;
  grid-row: auto !important;
  order: 8;
}

.sunpal-product-experience > header,
.sunpal-product-specs > header,
.sunpal-product-media > header {
  margin-bottom: 28px;
}

.sunpal-product-experience > header p,
.sunpal-product-specs > header p,
.sunpal-product-media > header p {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sunpal-product-experience > header h2,
.sunpal-product-specs > header h2,
.sunpal-product-media > header h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
}

.sunpal-product-story {
  color: #5d6268;
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.75;
}

.sunpal-product-story > :not(.alignwide):not(.alignfull):not(.wp-block-cover):not(.wp-block-gallery):not(.wp-block-video):not(figure):not(video):not(iframe) {
  max-width: 820px;
}

.sunpal-product-story h2,
.sunpal-product-story h3 {
  max-width: 900px;
  margin: clamp(42px, 7vw, 88px) 0 18px;
  color: var(--ink);
  letter-spacing: 0;
  line-height: 1.08;
}

.sunpal-product-story h2 { font-size: clamp(30px, 4.2vw, 58px); }
.sunpal-product-story h3 { font-size: clamp(24px, 3vw, 40px); }

.sunpal-product-story figure,
.sunpal-product-story .wp-block-video,
.sunpal-product-story .wp-block-cover,
.sunpal-product-story video,
.sunpal-product-story iframe {
  width: 100%;
  max-width: none;
  margin: clamp(28px, 5vw, 64px) 0;
  border-radius: 6px;
  overflow: hidden;
}

.sunpal-product-story figure img,
.sunpal-product-story .wp-block-video video,
.sunpal-product-story > video {
  display: block;
  width: 100%;
  height: auto;
}

.sunpal-product-story iframe {
  min-height: min(62vw, 720px);
  border: 0;
}

.sunpal-product-story img {
  cursor: zoom-in;
}

.sunpal-product-story .wp-block-cover {
  min-height: clamp(460px, 68vw, 820px);
}

.sunpal-product-story .wp-block-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: clamp(30px, 5vw, 64px) 0;
}

.sunpal-product-story .wp-block-gallery figure { margin: 0; }

.sunpal-product-media > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.sunpal-product-media > header > span {
  padding-bottom: 7px;
  color: var(--muted);
  font-size: 14px;
}

.sunpal-product-media-track {
  display: grid;
  grid-auto-columns: minmax(310px, 36%);
  grid-auto-flow: column;
  gap: 14px;
  padding-bottom: 15px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scrollbar-color: var(--green) #e8ece9;
  scrollbar-width: thin;
}

.sunpal-product-media-item {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9f7;
  cursor: zoom-in;
  overflow: hidden;
  scroll-snap-align: start;
}

.sunpal-product-media-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .45s cubic-bezier(.22, .75, .18, 1);
}

.sunpal-product-media-item:hover img { transform: scale(1.025); }

.sunpal-product-media-item > .dashicons,
.sunpal-product-media-item > .sunpal-media-zoom-icon {
  position: absolute;
  right: 14px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .08);
}

.sunpal-product-media-item > .sunpal-media-zoom-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.sunpal-spec-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.sunpal-spec-group {
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f8f7;
}

.sunpal-spec-group h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  font-size: 20px;
  letter-spacing: 0;
}

.sunpal-spec-group h3 .dashicons,
.sunpal-spec-group h3 .sunpal-spec-group-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--green);
  font-size: 27px;
  flex-shrink: 0;
}

.sunpal-spec-group h3 .sunpal-spec-group-icon svg {
  display: block;
  width: 24px;
  height: 24px;
}

.sunpal-spec-group dl { display: block; margin: 0; border: 0; }

.sunpal-spec-group dl > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, .9fr);
  gap: 22px;
  min-height: 0;
  padding: 13px 0;
  border: 0;
  border-top: 1px solid #dde1de;
}

.sunpal-spec-group dt {
  color: #686d72;
  font-weight: 500;
}

.sunpal-spec-group dd {
  margin: 0;
  color: var(--ink);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.sunpal-media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  background: rgba(4, 7, 5, .96);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.sunpal-media-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sunpal-media-lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
}

.sunpal-media-lightbox-count { color: rgba(255, 255, 255, .72); font-size: 13px; }

.sunpal-media-lightbox button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  cursor: pointer;
  font-size: 28px;
}

.sunpal-media-lightbox-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
}

.sunpal-media-lightbox-stage img {
  width: auto;
  max-width: min(1180px, calc(100vw - 110px));
  height: auto;
  max-height: calc(100dvh - 104px);
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  transform: scale(.975);
  transition: transform .3s cubic-bezier(.22, .75, .18, 1);
}

.sunpal-media-lightbox.is-open img { transform: none; }
.sunpal-media-lightbox-prev,
.sunpal-media-lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); }
.sunpal-media-lightbox-prev { left: 0; }
.sunpal-media-lightbox-next { right: 0; }
body.sunpal-lightbox-open { overflow: hidden; }

.sunpal-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .55s ease, transform .55s cubic-bezier(.22, .75, .18, 1);
}

.sunpal-reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .single-product .sunpal-product-experience,
  .single-product .sunpal-product-media,
  .single-product .sunpal-product-specs { margin-top: 58px !important; }

  .sunpal-product-story .wp-block-gallery { grid-template-columns: 1fr; }
  .sunpal-product-story figure,
  .sunpal-product-story .wp-block-video,
  .sunpal-product-story .wp-block-cover,
  .sunpal-product-story video,
  .sunpal-product-story iframe { margin: 28px 0; }

  .sunpal-product-media-track { grid-auto-columns: 86%; }
  .sunpal-product-media > header { align-items: start; flex-direction: column; gap: 8px; }
  .sunpal-spec-groups { grid-template-columns: 1fr; }
  .sunpal-spec-group { padding: 22px 20px; }
  .sunpal-spec-group dl > div { grid-template-columns: minmax(0, 1fr) minmax(110px, .9fr); gap: 16px; }
  .sunpal-media-lightbox { padding-right: 10px; padding-left: 10px; }
  .sunpal-media-lightbox-stage img { max-width: calc(100vw - 20px); max-height: calc(100dvh - 118px); }
  .sunpal-media-lightbox-prev,
  .sunpal-media-lightbox-next { top: auto; bottom: 10px; transform: none; }
  .sunpal-media-lightbox-prev { left: calc(50% - 58px); }
  .sunpal-media-lightbox-next { right: calc(50% - 58px); }
}

@media (prefers-reduced-motion: reduce) {
  .sunpal-product-media-item img,
  .sunpal-media-lightbox,
  .sunpal-media-lightbox-stage img,
  .sunpal-reveal { transition: none; }
  .sunpal-reveal { opacity: 1; transform: none; }
}
