.product-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 22px;
  align-items: stretch;
  margin: 18px 0 22px;
}

.product-detail-gallery {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh);
  overflow: hidden;
}

.product-detail-gallery__badge {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 4;
  background: var(--grad);
  color: #fff;
  border-radius: 99px;
  font-family: "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 7px 14px;
}

.trwplus-product-gallery {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 100%;
  background: linear-gradient(180deg, #fbfdff 0%, #f2f6fb 100%);
}

.trwplus-product-gallery--single .trwplus-product-gallery__overlay {
  display: none;
}

.trwplus-product-gallery__stage {
  position: relative;
  min-height: 620px;
  display: flex;
  flex: 1 1 auto;
}

.trwplus-product-gallery__frame {
  position: relative;
  width: 100%;
  min-height: 620px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, rgba(45, 127, 240, 0.05), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(238, 244, 251, 0.75));
}

.trwplus-product-gallery__image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  margin: auto;
  transition: opacity 0.3s ease, transform 0.35s ease;
}

.trwplus-product-gallery__frame.is-switching .trwplus-product-gallery__image {
  opacity: 0.18;
  transform: scale(0.985);
}

.trwplus-product-gallery__placeholder-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  margin: auto;
}

.trwplus-product-gallery__empty {
  width: 100%;
  height: 100%;
  min-height: 620px;
  display: grid;
  place-items: center;
  gap: 14px;
  color: var(--grey);
  text-align: center;
  padding: 24px;
}

.trwplus-product-gallery__empty-text {
  font-family: "Prompt", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.trwplus-product-gallery__lightbox {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(8, 53, 112, 0.78);
  color: #fff;
  box-shadow: 0 10px 24px rgba(5, 29, 66, 0.18);
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.trwplus-product-gallery__lightbox:hover {
  background: rgba(8, 53, 112, 0.92);
  transform: translateY(-1px);
}

.trwplus-product-gallery__overlay {
  position: absolute;
  inset: auto 0 0;
  z-index: 4;
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, rgba(4, 10, 20, 0) 0%, rgba(4, 10, 20, 0.38) 18%, rgba(4, 10, 20, 0.9) 100%);
  backdrop-filter: blur(10px) saturate(1.1);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.trwplus-product-gallery:hover .trwplus-product-gallery__overlay,
.trwplus-product-gallery.is-overlay-open .trwplus-product-gallery__overlay,
.trwplus-product-gallery.is-touch .trwplus-product-gallery__overlay {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.trwplus-product-gallery__overlay-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.trwplus-product-gallery__control {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.trwplus-product-gallery__control:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.trwplus-product-gallery__thumbs {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.trwplus-product-gallery__thumbs::-webkit-scrollbar {
  height: 5px;
}

.trwplus-product-gallery__thumbs::-webkit-scrollbar-track {
  background: transparent;
}

.trwplus-product-gallery__thumbs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

.trwplus-product-gallery__thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  opacity: 0.72;
  transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.trwplus-product-gallery__thumb:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.trwplus-product-gallery__thumb.is-active {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(45, 127, 240, 0.28);
  transform: translateY(-2px);
}

.product-detail-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh);
  padding: 24px;
}

.product-detail-panel .product-info {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.product-detail-panel .add-to-cart-section {
  margin-bottom: 0 !important;
}

.product-detail-service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
}

@media (hover: none) and (pointer: coarse) {
  .trwplus-product-gallery__overlay {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

@media (max-width: 991.98px) {
  .product-detail-hero {
    grid-template-columns: 1fr;
  }

  .trwplus-product-gallery__stage,
  .trwplus-product-gallery__frame,
  .trwplus-product-gallery__empty {
    min-height: 420px;
  }

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

@media (max-width: 767.98px) {
  .trwplus-product-gallery__stage,
  .trwplus-product-gallery__frame,
  .trwplus-product-gallery__empty {
    min-height: 360px;
  }

  .trwplus-product-gallery__overlay {
    padding: 14px 12px 12px;
  }

  .trwplus-product-gallery__overlay-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .trwplus-product-gallery__control {
    width: 38px;
    height: 38px;
  }

  .trwplus-product-gallery__thumb {
    width: 54px;
    height: 54px;
    border-radius: 14px;
  }
}
