/* templates/blocks/dynamic-gallery/style.css — v6.6.1 */
.pf-dynamic-gallery,
.pf-dynamic-gallery * {
  box-sizing: border-box;
}

.pf-dynamic-gallery {
  --pf-dg-gap: 8px;
  --pf-dg-radius: 14px;
  --pf-dg-image-radius: 14px;
  --pf-dg-hero-h: 440px;
  --pf-dg-mobile-hero-h: 280px;
  --pf-dg-thumb-h: 216px;
  --pf-dg-bg: transparent;
  --pf-dg-text-color: inherit;
  --pf-dg-padding: 0;
  --pf-dg-margin: 0 0 24px 0;
  --pf-dg-border-width: 0;
  --pf-dg-border-style: solid;
  --pf-dg-border-color: transparent;
  --pf-dg-shadow: none;
  --pf-dg-overlay-color: rgba(15, 23, 42, .68);
  --pf-dg-overlay-opacity: .68;
  --pf-dg-title-color: inherit;
  --pf-dg-title-size: 24px;
  --pf-dg-title-weight: 700;
  --pf-dg-title-line-height: 1.25;
  --pf-dg-title-margin: 0 0 16px 0;
  --pf-dg-title-letter-spacing: 0px;
  --pf-dg-title-align: left;
  --pf-dg-title-transform: none;
  --pf-dg-caption-color: #ffffff;
  --pf-dg-caption-bg: rgba(15, 23, 42, .72);
  --pf-dg-caption-size: 13px;
  --pf-dg-cols-desktop: 4;
  --pf-dg-cols-tablet: 3;
  --pf-dg-cols-mobile: 2;
  --pf-dg-slider-item-width: 320px;
  --pf-dg-active-color: #2563eb;
  --pf-dg-product-thumb-w: 126px;
  --pf-dg-product-thumb-h: 78px;
  --pf-dg-product-thumb-border: 2px;
  --pf-dg-product-thumb-opacity: .82;
  --pf-dg-product-thumb-radius: 10px;
  --pf-dg-hotel-side-w: 220px;
  --pf-dg-hotel-mobile-thumb-w: 42%;

  width: 100%;
  color: var(--pf-dg-text-color);
  background: var(--pf-dg-bg);
  padding: var(--pf-dg-padding);
  margin: var(--pf-dg-margin);
  border: var(--pf-dg-border-width) var(--pf-dg-border-style) var(--pf-dg-border-color);
  border-radius: var(--pf-dg-radius);
  box-shadow: var(--pf-dg-shadow);
  container-name: pf-dg;
  container-type: inline-size;
}

.pf-dg__title {
  margin: var(--pf-dg-title-margin);
  color: var(--pf-dg-title-color);
  font-size: var(--pf-dg-title-size);
  font-weight: var(--pf-dg-title-weight);
  line-height: var(--pf-dg-title-line-height);
  letter-spacing: var(--pf-dg-title-letter-spacing);
  text-align: var(--pf-dg-title-align);
  text-transform: var(--pf-dg-title-transform);
}

.pf-dg__inner {
  position: relative;
  width: 100%;
}

.pf-dynamic-gallery a {
  color: inherit;
  text-decoration: none;
}

.pf-dg__main,
.pf-dg__thumb,
.pf-dg__item,
.pf-dg__strip-item,
.pf-dg__film-item,
.pf-dg__list-item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--pf-dg-image-radius);
  background: #e5e7eb;
  min-width: 0;
}

.pf-dg__main img,
.pf-dg__thumb img,
.pf-dg__item img,
.pf-dg__strip-item img,
.pf-dg__film-item img,
.pf-dg__list-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease, filter .35s ease;
}

.pf-dynamic-gallery a:hover img {
  transform: scale(1.045);
}

.pf-dg__caption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  display: block;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--pf-dg-caption-color);
  background: var(--pf-dg-caption-bg);
  font-size: var(--pf-dg-caption-size);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pf-dg__more {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: var(--pf-dg-overlay-color);
  font-weight: 800;
  font-size: clamp(18px, 3vw, 34px);
  text-align: center;
  padding: 14px;
}

.pf-dg__more span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.pf-dg__more--hotel {
  flex-direction: column;
  gap: 6px;
  font-size: inherit;
  line-height: 1.15;
}
.pf-dg__more--hotel strong {
  display: block;
  font-size: clamp(22px, 2.4vw, 36px);
  font-weight: 850;
}
.pf-dg__more--hotel span {
  display: block;
  min-height: 0;
  font-size: clamp(11px, 1.15vw, 15px);
  font-weight: 750;
}

.pf-dg__count {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, .82);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .25);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.pf-dg__count::before {
  content: "📷";
  font-size: 13px;
}

.pf-dg-count-top-right .pf-dg__count { top: 14px; right: 14px; bottom: auto; left: auto; }
.pf-dg-count-top-left .pf-dg__count { top: 14px; left: 14px; bottom: auto; right: auto; }
.pf-dg-count-bottom-left .pf-dg__count { left: 14px; right: auto; bottom: 14px; top: auto; }
.pf-dg-count-bottom-right .pf-dg__count { right: 14px; left: auto; bottom: 14px; top: auto; }

/* Hero BĐS */
.pf-dg-layout-hotel_showcase .pf-dg__hotel-showcase {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, var(--pf-dg-hotel-side-w));
  grid-template-areas: "main side";
  gap: var(--pf-dg-gap);
  height: var(--pf-dg-hero-h);
  width: 100%;
  max-width: 100%;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}
.pf-dg-layout-hotel_showcase .pf-dg__hotel-showcase > .pf-dg__hotel-main {
  grid-area: main;
  grid-column: 1;
  grid-row: 1;
  position: relative;
  height: 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  transform: none;
}
.pf-dg-layout-hotel_showcase .pf-dg__hotel-showcase > .pf-dg__hotel-side {
  grid-area: side;
  grid-column: 2;
  grid-row: 1;
  position: relative;
  display: grid;
  grid-template-rows: repeat(var(--pf-dg-hotel-visible-thumbs, 4), minmax(0, 1fr));
  gap: var(--pf-dg-gap);
  height: 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  inset: auto;
  transform: none;
  z-index: 1;
}
.pf-dg-layout-hotel_showcase .pf-dg__hotel-side .pf-dg__thumb {
  width: 100%;
  height: auto;
  min-height: 0;
}

/* Hero BĐS */
.pf-dg-layout-hero_bds .pf-dg__hero-bds {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: var(--pf-dg-gap);
  min-height: var(--pf-dg-hero-h);
}
.pf-dg-layout-hero_bds .pf-dg__main {
  height: var(--pf-dg-hero-h);
}
.pf-dg-layout-hero_bds .pf-dg__side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--pf-dg-gap);
  height: var(--pf-dg-hero-h);
}
.pf-dg-layout-hero_bds .pf-dg__thumb {
  min-height: 0;
}

/* Hero classic */
.pf-dg-layout-hero_classic .pf-dg__hero-classic {
  position: relative;
}
.pf-dg-layout-hero_classic .pf-dg__main {
  height: var(--pf-dg-hero-h);
}
.pf-dg-layout-hero_classic .pf-dg__strip {
  display: grid;
  grid-template-columns: repeat(var(--pf-dg-cols-desktop), minmax(0, 1fr));
  gap: var(--pf-dg-gap);
  margin-top: var(--pf-dg-gap);
}
.pf-dg-layout-hero_classic .pf-dg__strip-item {
  height: var(--pf-dg-thumb-h);
}


/* Product album: main image + thumbnails */
.pf-dg__product {
  position: relative;
  display: grid;
  gap: var(--pf-dg-gap);
}
.pf-dg__product-main {
  position: relative;
  display: block;
  height: var(--pf-dg-hero-h);
  overflow: hidden;
  border-radius: var(--pf-dg-image-radius);
  background: #e5e7eb;
}
.pf-dg__product-main img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pf-dg__product-thumbs {
  display: flex;
  gap: var(--pf-dg-gap);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  padding: 2px 2px 7px;
}
.pf-dg__product-thumbs::-webkit-scrollbar { height: 7px; }
.pf-dg__product-thumbs::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
.pf-dg__product-thumb {
  flex: 0 0 var(--pf-dg-product-thumb-w);
  width: var(--pf-dg-product-thumb-w);
  height: var(--pf-dg-product-thumb-h);
  padding: 0;
  border: var(--pf-dg-product-thumb-border) solid transparent;
  border-radius: var(--pf-dg-product-thumb-radius);
  overflow: hidden;
  background: #e5e7eb;
  cursor: pointer;
  opacity: var(--pf-dg-product-thumb-opacity);
  transition: opacity .2s ease, border-color .2s ease, transform .2s ease;
}
.pf-dg__product-thumb:hover,
.pf-dg__product-thumb.is-active {
  opacity: 1;
  border-color: var(--pf-dg-active-color);
}
.pf-dg__product-thumb.is-active { transform: translateY(-1px); }
.pf-dg__product-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pf-dg__product-product_top,
.pf-dg__product-thumb_carousel {
  grid-template-columns: 1fr;
}
.pf-dg__product-product_left,
.pf-dg__product-product_right {
  align-items: stretch;
}
.pf-dg__product-product_left { grid-template-columns: var(--pf-dg-product-thumb-w) minmax(0, 1fr); }
.pf-dg__product-product_right { grid-template-columns: minmax(0, 1fr) var(--pf-dg-product-thumb-w); }
.pf-dg__product-product_left .pf-dg__product-thumbs,
.pf-dg__product-product_right .pf-dg__product-thumbs {
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: var(--pf-dg-hero-h);
  padding: 2px 7px 2px 2px;
}
.pf-dg__product-product_left .pf-dg__product-thumb,
.pf-dg__product-product_right .pf-dg__product-thumb {
  flex: 0 0 var(--pf-dg-product-thumb-h);
  width: 100%;
  height: var(--pf-dg-product-thumb-h);
}
.pf-dg__product-product_right .pf-dg__product-main { order: 1; }
.pf-dg__product-product_right .pf-dg__product-thumbs { order: 2; }
.pf-dg__product-nav {
  position: absolute;
  top: calc(var(--pf-dg-hero-h) / 2);
  z-index: 9;
  width: 42px;
  height: 58px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: rgba(15, 23, 42, .5);
  font-size: 38px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease;
}
.pf-dg__product-nav:hover { background: rgba(15, 23, 42, .78); }
.pf-dg__product-prev { left: 12px; }
.pf-dg__product-next { right: 12px; }
.pf-dg__product-product_left .pf-dg__product-prev { left: calc(var(--pf-dg-product-thumb-w) + 14px); }
.pf-dg__product-product_right .pf-dg__product-next { right: calc(var(--pf-dg-product-thumb-w) + 14px); }

/* Split album */
.pf-dg__split {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr);
  gap: var(--pf-dg-gap);
  min-height: var(--pf-dg-hero-h);
}
.pf-dg__split-right { grid-template-columns: minmax(260px, 1fr) minmax(0, 1.55fr); }
.pf-dg__split .pf-dg__main { height: var(--pf-dg-hero-h); }
.pf-dg__split-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--pf-dg-gap);
  height: var(--pf-dg-hero-h);
}
.pf-dg__split-side .pf-dg__thumb { min-height: 0; }

/* Grid */
.pf-dg__grid {
  display: grid;
  grid-template-columns: repeat(var(--pf-dg-cols-desktop), minmax(0, 1fr));
  gap: var(--pf-dg-gap);
}
.pf-dg__grid .pf-dg__item {
  height: var(--pf-dg-thumb-h);
}

/* Masonry */
.pf-dg__masonry {
  column-count: var(--pf-dg-cols-desktop);
  column-gap: var(--pf-dg-gap);
}
.pf-dg__masonry .pf-dg__item {
  display: block;
  break-inside: avoid;
  margin: 0 0 var(--pf-dg-gap) 0;
  height: auto;
}
.pf-dg__masonry .pf-dg__item img {
  height: auto;
}

/* Slider */
.pf-dg__slider {
  display: flex;
  gap: var(--pf-dg-gap);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  padding-bottom: 8px;
}
.pf-dg__slider::-webkit-scrollbar {
  height: 7px;
}
.pf-dg__slider::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
.pf-dg__slider .pf-dg__item {
  flex: 0 0 calc((100% - (var(--pf-dg-gap) * (var(--pf-dg-cols-desktop) - 1))) / var(--pf-dg-cols-desktop));
  min-width: min(var(--pf-dg-slider-item-width), 86vw);
  height: var(--pf-dg-thumb-h);
  scroll-snap-align: start;
}

/* Mosaic */
.pf-dg__mosaic {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: minmax(120px, calc(var(--pf-dg-thumb-h) / 1.8));
  gap: var(--pf-dg-gap);
}
.pf-dg__mosaic .pf-dg__mosaic-item {
  min-height: 120px;
}
.pf-dg__mosaic-item-1,
.pf-dg__mosaic-item-6 {
  grid-column: span 3;
  grid-row: span 2;
}
.pf-dg__mosaic-item-2,
.pf-dg__mosaic-item-3,
.pf-dg__mosaic-item-4,
.pf-dg__mosaic-item-5,
.pf-dg__mosaic-item-7,
.pf-dg__mosaic-item-8 {
  grid-column: span 3;
}

/* Collage */
.pf-dg__collage {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  grid-template-rows: repeat(2, minmax(160px, calc(var(--pf-dg-hero-h) / 2)));
  gap: var(--pf-dg-gap);
}
.pf-dg__collage-item-1 {
  grid-row: span 2;
}
.pf-dg__collage-item {
  min-height: 150px;
}

/* Filmstrip */
.pf-dg__filmstrip {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, minmax(120px, .65fr));
  gap: var(--pf-dg-gap);
  align-items: stretch;
}
.pf-dg__film-item {
  height: var(--pf-dg-thumb-h);
}
.pf-dg__film-item:first-child {
  height: var(--pf-dg-hero-h);
  grid-row: span 2;
}

/* List */
.pf-dg__list {
  display: grid;
  gap: var(--pf-dg-gap);
}
.pf-dg__list-item {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  height: 160px;
}
.pf-dg__list-item img {
  border-radius: var(--pf-dg-image-radius);
}

@media (max-width: 991px) {
  .pf-dg-layout-hotel_showcase .pf-dg__hotel-showcase {
    grid-template-columns: 1fr;
    grid-template-areas: "main" "side";
    height: auto;
  }
  .pf-dg-layout-hotel_showcase .pf-dg__hotel-showcase > .pf-dg__hotel-main {
    grid-column: 1;
    grid-row: 1;
    height: var(--pf-dg-mobile-hero-h);
  }
  .pf-dg-layout-hotel_showcase .pf-dg__hotel-showcase > .pf-dg__hotel-side {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .pf-dg-layout-hotel_showcase .pf-dg__hotel-side::-webkit-scrollbar { display: none; }
  .pf-dg-layout-hotel_showcase .pf-dg__hotel-side .pf-dg__thumb {
    flex: 0 0 var(--pf-dg-hotel-mobile-thumb-w);
    width: var(--pf-dg-hotel-mobile-thumb-w);
    aspect-ratio: var(--pf-dg-thumb-ratio, 4 / 3);
    scroll-snap-align: start;
  }
  .pf-dg__product-product_left,
  .pf-dg__product-product_right,
  .pf-dg__split,
  .pf-dg__split-right { grid-template-columns: 1fr; }
  .pf-dg__product-product_left .pf-dg__product-thumbs,
  .pf-dg__product-product_right .pf-dg__product-thumbs { order: 2; flex-direction: row; overflow-x: auto; overflow-y: hidden; max-height: none; }
  .pf-dg__product-product_left .pf-dg__product-main,
  .pf-dg__product-product_right .pf-dg__product-main { order: 1; height: var(--pf-dg-mobile-hero-h); }
  .pf-dg__product-product_left .pf-dg__product-thumb,
  .pf-dg__product-product_right .pf-dg__product-thumb { flex: 0 0 110px; width: 110px; height: 74px; }
  .pf-dg__product-product_left .pf-dg__product-prev,
  .pf-dg__product-product_right .pf-dg__product-next { left: 12px; right: auto; }
  .pf-dg__split .pf-dg__main { height: var(--pf-dg-mobile-hero-h); }
  .pf-dg__split-side { height: auto; grid-template-columns: repeat(var(--pf-dg-cols-tablet), minmax(0, 1fr)); }
  .pf-dg__split-side .pf-dg__thumb { height: var(--pf-dg-thumb-h); }
  .pf-dg-layout-hero_bds .pf-dg__hero-bds {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .pf-dg-layout-hero_bds .pf-dg__main {
    height: var(--pf-dg-mobile-hero-h);
  }
  .pf-dg-layout-hero_bds .pf-dg__side {
    height: auto;
    grid-template-columns: repeat(var(--pf-dg-cols-tablet), minmax(0, 1fr));
  }
  .pf-dg-layout-hero_bds .pf-dg__thumb {
    height: var(--pf-dg-thumb-h);
  }
  .pf-dg-layout-hero_classic .pf-dg__strip,
  .pf-dg__grid {
    grid-template-columns: repeat(var(--pf-dg-cols-tablet), minmax(0, 1fr));
  }
  .pf-dg__masonry {
    column-count: var(--pf-dg-cols-tablet);
  }
  .pf-dg__slider .pf-dg__item {
    flex-basis: calc((100% - (var(--pf-dg-gap) * (var(--pf-dg-cols-tablet) - 1))) / var(--pf-dg-cols-tablet));
  }
  .pf-dg__collage,
  .pf-dg__filmstrip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }
  .pf-dg__collage-item-1,
  .pf-dg__film-item:first-child {
    grid-row: auto;
  }
  .pf-dg__film-item:first-child,
  .pf-dg__film-item {
    height: var(--pf-dg-thumb-h);
  }
}

@media (max-width: 767px) {
  .pf-dg-layout-hotel_showcase .pf-dg__hotel-side .pf-dg__thumb {
    flex-basis: min(72%, 220px);
    width: min(72%, 220px);
  }
  .pf-dg__product-main,
  .pf-dg__product-product_top .pf-dg__product-main,
  .pf-dg__product-thumb_carousel .pf-dg__product-main { height: var(--pf-dg-mobile-hero-h); }
  .pf-dg__product-nav { top: calc(var(--pf-dg-mobile-hero-h) / 2); }
  .pf-dg__split-side { grid-template-columns: repeat(var(--pf-dg-cols-mobile), minmax(0, 1fr)); }
  .pf-dg-layout-hero_bds .pf-dg__main,
  .pf-dg-layout-hero_classic .pf-dg__main {
    height: var(--pf-dg-mobile-hero-h);
  }
  .pf-dg-layout-hero_bds .pf-dg__side,
  .pf-dg-layout-hero_classic .pf-dg__strip,
  .pf-dg__grid {
    grid-template-columns: repeat(var(--pf-dg-cols-mobile), minmax(0, 1fr));
  }
  .pf-dg-layout-hero_bds .pf-dg__thumb,
  .pf-dg-layout-hero_classic .pf-dg__strip-item,
  .pf-dg__grid .pf-dg__item,
  .pf-dg__slider .pf-dg__item,
  .pf-dg__film-item,
  .pf-dg__film-item:first-child {
    height: var(--pf-dg-thumb-h);
  }
  .pf-dg__masonry {
    column-count: var(--pf-dg-cols-mobile);
  }
  .pf-dg__slider .pf-dg__item {
    flex-basis: calc((100% - (var(--pf-dg-gap) * (var(--pf-dg-cols-mobile) - 1))) / var(--pf-dg-cols-mobile));
  }
  .pf-dg__mosaic {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(120px, var(--pf-dg-thumb-h));
  }
  .pf-dg__mosaic-item-1,
  .pf-dg__mosaic-item-6,
  .pf-dg__mosaic-item-2,
  .pf-dg__mosaic-item-3,
  .pf-dg__mosaic-item-4,
  .pf-dg__mosaic-item-5,
  .pf-dg__mosaic-item-7,
  .pf-dg__mosaic-item-8 {
    grid-column: span 1;
    grid-row: span 1;
  }
  .pf-dg__collage,
  .pf-dg__filmstrip {
    grid-template-columns: 1fr;
  }
  .pf-dg__list-item {
    grid-template-columns: 1fr;
    height: var(--pf-dg-thumb-h);
  }
}

.pf-dg-lock {
  overflow: hidden;
}
.pf-dg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(2, 6, 23, .88);
}
.pf-dg-lightbox.is-open {
  display: flex;
}
.pf-dg-lightbox figure {
  position: relative;
  max-width: min(1120px, 94vw);
  max-height: 88vh;
  margin: 0;
}
.pf-dg-lightbox img {
  display: block;
  max-width: 100%;
  max-height: 84vh;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}
.pf-dg-lightbox figcaption {
  margin-top: 10px;
  color: #fff;
  text-align: center;
  font-size: 14px;
}
.pf-dg-lightbox button {
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  cursor: pointer;
}
.pf-dg-lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 34px;
  line-height: 1;
}
.pf-dg-lightbox__prev,
.pf-dg-lightbox__next {
  position: absolute;
  top: 50%;
  width: 50px;
  height: 70px;
  transform: translateY(-50%);
  border-radius: 12px;
  font-size: 52px;
  line-height: 1;
}
.pf-dg-lightbox__prev {
  left: 18px;
}
.pf-dg-lightbox__next {
  right: 18px;
}
@media (max-width: 767px) {
  .pf-dg__product-main,
  .pf-dg__product-product_top .pf-dg__product-main,
  .pf-dg__product-thumb_carousel .pf-dg__product-main { height: var(--pf-dg-mobile-hero-h); }
  .pf-dg__product-nav { top: calc(var(--pf-dg-mobile-hero-h) / 2); }
  .pf-dg__split-side { grid-template-columns: repeat(var(--pf-dg-cols-mobile), minmax(0, 1fr)); }
  .pf-dg-lightbox {
    padding: 16px;
  }
  .pf-dg-lightbox__prev,
  .pf-dg-lightbox__next {
    width: 42px;
    height: 54px;
    font-size: 40px;
  }
}

/* v6.0.0 — tương tác ổn định hơn cho product album/lightbox */
.pf-dg__product-main img.is-changing {
  opacity: .72;
}
.pf-dg__product-main img {
  transition: opacity .16s ease, transform .35s ease, filter .35s ease;
}
.pf-dg__product-thumb {
  position: relative;
  z-index: 3;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.pf-dg__product-thumb img {
  pointer-events: none;
}
.pf-dg__product-nav,
.pf-dg__count {
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.pf-dg-lightbox {
  z-index: 2147483000;
}
.pf-dg-lock,
.pf-dg-lock body {
  overflow: hidden !important;
}

/* v5.2 — ẩn scrollbar thumbnail nhưng vẫn cho kéo ngang nội bộ */
.pf-dynamic-gallery .pf-dg__product-thumbs,
.pf-dynamic-gallery .pf-dg__slider,
.pf-dynamic-gallery .pf-dg__thumbs,
.pf-dynamic-gallery .pf-dg__strip,
.pf-dynamic-gallery .pf-dg__filmstrip,
.pf-dynamic-gallery .pf-dg__thumb-row {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.pf-dynamic-gallery .pf-dg__product-thumbs::-webkit-scrollbar,
.pf-dynamic-gallery .pf-dg__slider::-webkit-scrollbar,
.pf-dynamic-gallery .pf-dg__thumbs::-webkit-scrollbar,
.pf-dynamic-gallery .pf-dg__strip::-webkit-scrollbar,
.pf-dynamic-gallery .pf-dg__filmstrip::-webkit-scrollbar,
.pf-dynamic-gallery .pf-dg__thumb-row::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* v6.3 — Responsive image ratio controls */
.pf-dynamic-gallery {
  --pf-dg-main-ratio: 16 / 9;
  --pf-dg-thumb-ratio: 1 / 1;
  --pf-dg-image-fit: cover;
  --pf-dg-image-position: center;
}

.pf-dg__main img,
.pf-dg__thumb img,
.pf-dg__item img,
.pf-dg__strip-item img,
.pf-dg__film-item img,
.pf-dg__list-item img,
.pf-dg__product-main img,
.pf-dg__product-thumb img {
  object-fit: var(--pf-dg-image-fit, cover);
  object-position: var(--pf-dg-image-position, center);
}

/* Chế độ tỷ lệ: bỏ chiều cao cứng và để aspect-ratio điều khiển */
.pf-dg-size-ratio.pf-dg-layout-hero_bds .pf-dg__hero-bds {
  min-height: 0;
  align-items: stretch;
}
.pf-dg-size-ratio.pf-dg-layout-hotel_showcase .pf-dg__hotel-showcase {
  height: auto;
}
.pf-dg-size-ratio.pf-dg-layout-hotel_showcase .pf-dg__hotel-showcase > .pf-dg__hotel-main {
  height: auto;
  aspect-ratio: var(--pf-dg-main-ratio, 16 / 9);
}
.pf-dg-size-ratio.pf-dg-layout-hotel_showcase .pf-dg__hotel-showcase > .pf-dg__hotel-side {
  height: 100%;
  align-self: stretch;
}
.pf-dg-size-ratio.pf-dg-layout-hero_bds .pf-dg__main,
.pf-dg-size-ratio.pf-dg-layout-hero_classic .pf-dg__main,
.pf-dg-size-ratio .pf-dg__product-main,
.pf-dg-size-ratio .pf-dg__split .pf-dg__main {
  height: auto;
  aspect-ratio: var(--pf-dg-main-ratio, 16 / 9);
}
.pf-dg-size-ratio.pf-dg-layout-hero_bds .pf-dg__side {
  height: auto;
}
.pf-dg-size-ratio.pf-dg-layout-hero_bds .pf-dg__thumb,
.pf-dg-size-ratio.pf-dg-layout-hero_classic .pf-dg__strip-item,
.pf-dg-size-ratio .pf-dg__split-side .pf-dg__thumb,
.pf-dg-size-ratio .pf-dg__grid .pf-dg__item,
.pf-dg-size-ratio .pf-dg__slider .pf-dg__item,
.pf-dg-size-ratio .pf-dg__film-item,
.pf-dg-size-ratio .pf-dg__list-item {
  height: auto;
  aspect-ratio: var(--pf-dg-thumb-ratio, 1 / 1);
}
.pf-dg-size-ratio .pf-dg__product-thumb {
  height: auto;
  aspect-ratio: var(--pf-dg-thumb-ratio, 1 / 1);
}
.pf-dg-size-ratio .pf-dg__product-product_left .pf-dg__product-thumb,
.pf-dg-size-ratio .pf-dg__product-product_right .pf-dg__product-thumb {
  height: auto;
}

/* Masonry giữ chiều cao tự nhiên; chỉ áp dụng fit/position */
.pf-dg-size-ratio .pf-dg__masonry .pf-dg__item {
  aspect-ratio: auto;
}
.pf-dg-size-ratio .pf-dg__masonry .pf-dg__item img {
  height: auto;
  object-fit: contain;
}

@media (max-width: 767px) {
  .pf-dg-size-ratio.pf-dg-layout-hotel_showcase .pf-dg__hotel-showcase > .pf-dg__hotel-main {
    height: auto;
    aspect-ratio: var(--pf-dg-main-ratio, 16 / 9);
  }
  .pf-dg-size-ratio.pf-dg-layout-hotel_showcase .pf-dg__hotel-side .pf-dg__thumb {
    height: auto;
    aspect-ratio: var(--pf-dg-thumb-ratio, 4 / 3);
  }
  .pf-dg-size-ratio.pf-dg-layout-hero_bds .pf-dg__main,
  .pf-dg-size-ratio.pf-dg-layout-hero_classic .pf-dg__main,
  .pf-dg-size-ratio .pf-dg__product-main,
  .pf-dg-size-ratio .pf-dg__split .pf-dg__main {
    height: auto;
    aspect-ratio: var(--pf-dg-main-ratio, 16 / 9);
  }
  .pf-dg-size-ratio.pf-dg-layout-hero_bds .pf-dg__thumb,
  .pf-dg-size-ratio.pf-dg-layout-hero_classic .pf-dg__strip-item,
  .pf-dg-size-ratio .pf-dg__split-side .pf-dg__thumb {
    height: auto;
    aspect-ratio: var(--pf-dg-thumb-ratio, 1 / 1);
  }
}

/* v6.5.1 — Hotel Showcase co theo chiều rộng thật của cột Builder. */
@container pf-dg (max-width: 560px) {
  .pf-dg-layout-hotel_showcase .pf-dg__hotel-showcase {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main" "side";
    height: auto;
    overflow: visible;
  }
  .pf-dg-layout-hotel_showcase .pf-dg__hotel-showcase > .pf-dg__hotel-main {
    grid-column: 1;
    grid-row: 1;
    height: var(--pf-dg-mobile-hero-h);
  }
  .pf-dg-size-ratio.pf-dg-layout-hotel_showcase .pf-dg__hotel-showcase > .pf-dg__hotel-main {
    height: auto;
    aspect-ratio: var(--pf-dg-main-ratio, 16 / 9);
  }
  .pf-dg-layout-hotel_showcase .pf-dg__hotel-showcase > .pf-dg__hotel-side {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .pf-dg-layout-hotel_showcase .pf-dg__hotel-showcase > .pf-dg__hotel-side::-webkit-scrollbar {
    display: none;
  }
  .pf-dg-layout-hotel_showcase .pf-dg__hotel-side .pf-dg__thumb {
    flex: 0 0 var(--pf-dg-hotel-mobile-thumb-w);
    width: var(--pf-dg-hotel-mobile-thumb-w);
    height: auto;
    aspect-ratio: var(--pf-dg-thumb-ratio, 4 / 3);
    scroll-snap-align: start;
  }
}

/* v6.6.0 — Lightbox viewer với dải thumbnail lấy toàn bộ Gallery payload. */
.pf-dg-lightbox {
  --pf-dg-lb-thumb-w: 76px;
  --pf-dg-lb-thumb-h: 56px;
  --pf-dg-lb-thumb-gap: 8px;
  --pf-dg-lb-thumb-radius: 8px;
  --pf-dg-lb-thumb-fit: cover;
  --pf-dg-lb-thumb-opacity: .68;
  --pf-dg-lb-thumb-border: rgba(255, 255, 255, .24);
  --pf-dg-lb-thumb-active: #fff;
  --pf-dg-lb-bg: rgba(2, 6, 23, .94);
  --pf-dg-lb-counter-color: #fff;
  background: var(--pf-dg-lb-bg);
  overscroll-behavior: contain;
}
.pf-dg-lightbox__viewer {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  width: min(1120px, calc(100vw - 152px));
  height: min(920px, calc(100dvh - 56px));
  min-width: 0;
  min-height: 0;
}
.pf-dg-lightbox__close {
  z-index: 5;
}
.pf-dg-lightbox__prev,
.pf-dg-lightbox__next {
  z-index: 4;
}
.pf-dg-lightbox__viewer figure {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  min-width: 0;
  min-height: 0;
}
.pf-dg-lightbox__stage {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.pf-dg-lightbox__stage > img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.pf-dg-lightbox__footer {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.pf-dg-lightbox:not(.has-thumbs):not(.has-counter) .pf-dg-lightbox__footer {
  display: none;
}
.pf-dg-lightbox__counter {
  color: var(--pf-dg-lb-counter-color);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.pf-dg-lightbox__thumbs {
  display: flex;
  gap: var(--pf-dg-lb-thumb-gap);
  width: 100%;
  min-width: 0;
  padding: 3px 2px 5px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(255, 255, 255, .34) transparent;
  scrollbar-width: thin;
}
.pf-dg-lightbox__thumb {
  position: relative;
  flex: 0 0 var(--pf-dg-lb-thumb-w);
  width: var(--pf-dg-lb-thumb-w);
  height: var(--pf-dg-lb-thumb-h);
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--pf-dg-lb-thumb-border) !important;
  border-radius: var(--pf-dg-lb-thumb-radius);
  background: rgba(255, 255, 255, .08);
  opacity: var(--pf-dg-lb-thumb-opacity);
  scroll-snap-align: center;
  transition: opacity .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.pf-dg-lightbox__thumb:hover,
.pf-dg-lightbox__thumb:focus-visible {
  opacity: 1;
}
.pf-dg-lightbox__thumb:focus-visible {
  outline: 2px solid var(--pf-dg-lb-thumb-active);
  outline-offset: 2px;
}
.pf-dg-lightbox__thumb.is-active {
  border-color: var(--pf-dg-lb-thumb-active) !important;
  box-shadow: 0 0 0 1px var(--pf-dg-lb-thumb-active), 0 6px 18px rgba(0, 0, 0, .32);
  opacity: 1;
  transform: translateY(-1px);
}
.pf-dg-lightbox__thumb > img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: calc(var(--pf-dg-lb-thumb-radius) - 2px);
  object-fit: var(--pf-dg-lb-thumb-fit);
  box-shadow: none;
  pointer-events: none;
}

@media (max-width: 767px) {
  .pf-dg-lightbox__viewer {
    width: calc(100vw - 32px);
    height: calc(100dvh - 32px);
    gap: 9px;
  }
  .pf-dg-lightbox.has-thumbs .pf-dg-lightbox__viewer {
    padding-top: 38px;
  }
  .pf-dg-lightbox__close {
    top: 10px;
    right: 10px;
  }
  .pf-dg-lightbox__prev {
    left: 6px;
  }
  .pf-dg-lightbox__next {
    right: 6px;
  }
  .pf-dg-lightbox__thumbs {
    margin-inline: -2px;
    width: calc(100% + 4px);
  }
  .pf-dg-lightbox__thumb {
    flex-basis: min(var(--pf-dg-lb-thumb-w), 68px);
    width: min(var(--pf-dg-lb-thumb-w), 68px);
    height: min(var(--pf-dg-lb-thumb-h), 52px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pf-dg-lightbox__thumbs {
    scroll-behavior: auto;
  }
  .pf-dg-lightbox__thumb {
    transition: none;
  }
}
