/*
 * TravelPoint custom layer — Product Media / Product Detail R4
 * ThemeForest-safe: loaded AFTER vendor shop.css and scoped to tp-* selectors.
 */

.page-title-area.product-detail-breadcrumb {
  padding-top: 44px !important;
  padding-bottom: 44px !important;
  min-height: 170px;
}
.page-title-area.product-detail-breadcrumb .bg-img { object-position: center; }
.page-title-area.product-detail-breadcrumb .content h3 {
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.25;
  max-width: 900px;
  margin-bottom: 8px;
}

.tp-travel-product-page .row.align-items-start { align-items: flex-start !important; }

.tp-product-media,
.tp-r4-product-media {
  position: relative;
  width: 100%;
  min-width: 0;
  margin-bottom: 28px;
}

.tp-r4-slider-shell {
  position: relative;
  width: 100%;
  min-width: 0;
}

.tp-r4-main-slider {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
}

.tp-r4-main-slider .swiper-wrapper,
.tp-r4-main-slider .swiper-slide {
  height: auto !important;
  min-height: 0 !important;
}

.tp-r4-main-slider .swiper-slide {
  display: block;
  width: 100% !important;
}

.tp-r4-media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.07);
  background: #f7f6f8;
}

.tp-r4-media-frame > a,
.tp-r4-media-frame picture,
.tp-r4-thumb-frame picture {
  display: block;
  width: 100%;
  height: 100%;
}

.tp-r4-media-frame img,
.tp-r4-thumb-frame img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
}

.tp-r4-media-frame[data-fit="cover"] img,
.tp-r4-thumb-frame[data-fit="cover"] img { object-fit: cover; }
.tp-r4-media-frame[data-fit="contain"] img,
.tp-r4-thumb-frame[data-fit="contain"] img { object-fit: contain; }

.tp-r4-slider-navigation {
  position: absolute;
  inset: 50% 14px auto 14px;
  transform: translateY(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.tp-r4-nav {
  pointer-events: auto;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.94);
  color: #222;
  box-shadow: 0 7px 22px rgba(0,0,0,.14);
  transition: transform .2s ease, opacity .2s ease;
}
.tp-r4-nav:hover { transform: scale(1.05); }
.tp-r4-nav.swiper-button-disabled { opacity: .35; cursor: default; }

/* Never inherit ThemeForest's legacy absolute .shop-thumb positioning. */
.tp-r4-thumbs {
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden;
  margin-top: 12px;
}

.tp-r4-thumbs .swiper-wrapper {
  align-items: stretch;
  height: auto !important;
}

.tp-r4-thumbs .swiper-slide {
  width: 110px !important;
  height: auto !important;
  opacity: .66;
  transition: opacity .2s ease;
}
.tp-r4-thumbs .swiper-slide-thumb-active { opacity: 1; }

.tp-r4-thumb-frame {
  width: 100%;
  aspect-ratio: 3 / 2;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #f7f6f8;
  cursor: pointer;
}
.tp-r4-thumbs .swiper-slide-thumb-active .tp-r4-thumb-frame {
  border-color: var(--color-primary);
}

.tp-product-media-empty {
  width: 100%;
  aspect-ratio: 3 / 2;
  border: 1px dashed rgba(0,0,0,.18);
  border-radius: 14px;
  background: #f8f8fa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #777;
}
.tp-product-media-empty i { font-size: 2rem; }

/* Product-detail commercial hierarchy. Kept here so stale vendor shop.css cannot break R3/R4 markup. */
.tp-product-booking-card {
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 16px;
  padding: clamp(22px, 3vw, 34px);
  background: #fff;
  box-shadow: 0 14px 38px rgba(22,18,28,.06);
}
.tp-product-provider {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.tp-product-title {
  font-size: clamp(1.8rem, 2.45vw, 2.65rem) !important;
  line-height: 1.13 !important;
  overflow-wrap: anywhere;
  margin-bottom: 18px;
}
.tp-product-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 5px;
}
.tp-price-label { color: #666; font-weight: 600; }
.tp-product-price { color: var(--color-primary); font-size: clamp(1.4rem, 2vw, 1.9rem); }
.tp-old-price { color: #999; text-decoration: line-through; }
.tp-price-note { font-size: .88rem; color: #777; }
.tp-product-summary { font-size: 1rem; line-height: 1.72; color: #555; margin-bottom: 20px; }
.tp-quick-facts { display: grid; gap: 9px; padding: 16px 0; border-top: 1px solid #eee; border-bottom: 1px solid #eee; }
.tp-quick-facts span { display: flex; align-items: flex-start; gap: 9px; color: #555; }
.tp-quick-facts i { color: var(--color-primary); margin-top: 4px; }
.tp-product-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.tp-share-links { display: flex; align-items: center; flex-wrap: wrap; }
.tp-product-content-section {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 16px;
  background: #fff;
}
.tp-content-heading span { color: var(--color-primary); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; }
.tp-content-heading h2 { font-size: clamp(1.45rem, 2.2vw, 2rem); margin: 5px 0 22px; }
.tp-product-long-content { color: #555; line-height: 1.8; }
.tp-product-long-content h1,
.tp-product-long-content h2,
.tp-product-long-content h3 { line-height: 1.25; margin-top: 28px; margin-bottom: 12px; }
.tp-product-long-content h1 { font-size: 1.75rem; }
.tp-product-long-content h2 { font-size: 1.5rem; }
.tp-product-long-content h3 { font-size: 1.25rem; }
.tp-product-long-content ul,
.tp-product-long-content ol { padding-left: 1.25rem; margin-bottom: 18px; }
.tp-product-long-content p { margin-bottom: 15px; }

/* Sticky media only where two-column desktop has enough width. */
@media (min-width: 1200px) {
  .tp-r4-product-media { position: sticky; top: 105px; }
}

@media (max-width: 1199.98px) {
  .tp-r4-product-media { position: relative; top: auto; }
}

@media (max-width: 991.98px) {
  .tp-travel-product-page { padding-top: 38px !important; }
  .tp-product-booking-card { box-shadow: none; }
  .tp-r4-thumbs .swiper-slide { width: 96px !important; }
}

@media (max-width: 575.98px) {
  .page-title-area.product-detail-breadcrumb {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
    min-height: 140px;
  }
  .tp-product-title { font-size: 1.75rem !important; }
  .tp-product-actions .btn { width: 100%; justify-content: center; }
  .tp-product-content-section { padding: 22px 18px; }
  .tp-r4-thumbs .swiper-slide { width: 86px !important; }
  .tp-r4-nav { width: 38px; height: 38px; }
  .tp-r4-slider-navigation { inset-inline: 8px; }
}
