/* =============================================================
   992 MODEL GALLERY CAROUSEL
   Uses the supplied front/rear model graphics in the existing gallery.
============================================================= */
.gallery-grid {
  align-items: stretch;
  gap: clamp(16px, 2vw, 24px) !important;
}

.model-gallery-carousel {
  position: relative;
  min-width: 0;
  border-radius: 22px !important;
  isolation: isolate;
}

.model-gallery-viewport {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08), transparent 48%),
    #07090c;
  touch-action: pan-y;
  cursor: pointer;
}

.model-gallery-viewport button {
  cursor: pointer;
}

.model-gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  transform: translate3d(0, 0, 0);
  transition: transform 620ms cubic-bezier(.22, .78, .22, 1);
  will-change: transform;
}

.model-gallery-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  margin: 0;
  display: grid;
  place-items: center;
  background: #080a0d;
}

.model-gallery-carousel .model-gallery-slide img {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  display: block;
  background: #080a0d !important;
  padding: 0 !important;
}

.model-gallery-status {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.model-gallery-view,
.model-gallery-count {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(5, 7, 10, 0.72);
  color: #f7f4ed;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.035em;
}

.model-gallery-view {
  color: var(--fc-gold-light, #f0cf91);
  text-transform: uppercase;
}

.model-gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 42px;
  height: 42px;
  min-height: 0;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(5, 7, 10, 0.76);
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0.88;
  transition: opacity 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.model-gallery-arrow span {
  display: block;
  line-height: 1;
  font-size: 30px;
  transform: translateY(-1px);
}

.model-gallery-prev { left: 14px; }
.model-gallery-next { right: 14px; }

.model-gallery-carousel:hover .model-gallery-arrow,
.model-gallery-carousel:focus-within .model-gallery-arrow {
  opacity: 1;
}

.model-gallery-arrow:hover,
.model-gallery-arrow:focus-visible {
  border-color: rgba(240, 207, 145, 0.8);
  background: rgba(24, 20, 14, 0.92);
  outline: none;
}

.model-gallery-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(5, 7, 10, 0.72);
  transform: translateX(-50%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.model-gallery-dot {
  width: 8px;
  height: 8px;
  min-height: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
  transition: width 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.model-gallery-dot.is-active {
  width: 26px;
  height: 8px;
  background: var(--fc-gold-light, #f0cf91);
  box-shadow: 0 0 10px rgba(240, 207, 145, 0.56);
}

.model-gallery-dot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.model-gallery-caption {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 18px;
}

.model-gallery-caption h3 {
  margin: 0;
  padding: 0 !important;
  font-size: clamp(18px, 2vw, 23px);
}

.model-gallery-caption p {
  margin: 0;
  color: var(--fc-muted, #b8b8b5);
  font-size: 12px;
  white-space: nowrap;
}

@media (hover: none), (max-width: 720px) {
  .model-gallery-arrow {
    width: 38px;
    height: 38px;
    opacity: 1;
  }
  .model-gallery-prev { left: 10px; }
  .model-gallery-next { right: 10px; }
  .model-gallery-status { top: 10px; left: 10px; right: 10px; }
  .model-gallery-dots { bottom: 10px; }
  .model-gallery-caption {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .model-gallery-track { transition: none; }
}

/* =============================================================
   IMAGE ENLARGE BUTTON + FULL-SCREEN LIGHTBOX
============================================================= */
.model-gallery-expand {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 6;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(5, 7, 10, 0.8);
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.36);
  cursor: pointer;
  opacity: 0.94;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, opacity 180ms ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.model-gallery-expand svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: currentColor;
}

.model-gallery-expand::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 9px);
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(5, 7, 10, 0.94);
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.model-gallery-expand:hover,
.model-gallery-expand:focus-visible {
  border-color: rgba(240, 207, 145, 0.82);
  background: rgba(24, 20, 14, 0.94);
  opacity: 1;
  transform: scale(1.05);
  outline: none;
}

.model-gallery-expand:hover::after,
.model-gallery-expand:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

body.model-gallery-lightbox-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.model-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.model-gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.model-gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.model-gallery-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100vw - 48px));
  height: min(86dvh, 860px);
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background: #07090c;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.68);
  transform: scale(0.975) translateY(8px);
  transition: transform 260ms cubic-bezier(.22, .78, .22, 1);
}

.model-gallery-lightbox.is-open .model-gallery-lightbox-panel {
  transform: scale(1) translateY(0);
}

.model-gallery-lightbox-image-wrap {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.07), transparent 55%),
    #07090c;
}

.model-gallery-lightbox-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  opacity: 1;
  transition: opacity 140ms ease;
}

.model-gallery-lightbox-panel.is-loading .model-gallery-lightbox-image {
  opacity: 0.35;
}

.model-gallery-lightbox-close,
.model-gallery-lightbox-arrow {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(5, 7, 10, 0.82);
  color: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.model-gallery-lightbox-close:hover,
.model-gallery-lightbox-close:focus-visible,
.model-gallery-lightbox-arrow:hover,
.model-gallery-lightbox-arrow:focus-visible {
  border-color: rgba(240, 207, 145, 0.84);
  background: rgba(24, 20, 14, 0.94);
  outline: none;
}

.model-gallery-lightbox-close {
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.model-gallery-lightbox-close:hover,
.model-gallery-lightbox-close:focus-visible {
  transform: rotate(3deg) scale(1.04);
}

.model-gallery-lightbox-close svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.model-gallery-lightbox-arrow {
  top: 50%;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  transform: translateY(-50%);
}

.model-gallery-lightbox-arrow:hover,
.model-gallery-lightbox-arrow:focus-visible {
  transform: translateY(-50%) scale(1.05);
}

.model-gallery-lightbox-arrow span {
  display: block;
  font-size: 38px;
  line-height: 1;
  transform: translateY(-2px);
}

.model-gallery-lightbox-prev { left: 18px; }
.model-gallery-lightbox-next { right: 18px; }

.model-gallery-lightbox-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  min-height: 112px;
  padding: 36px 26px 20px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(to top, rgba(2, 3, 5, 0.95), rgba(2, 3, 5, 0));
  pointer-events: none;
}

.model-gallery-lightbox-view {
  display: block;
  margin-bottom: 5px;
  color: var(--fc-gold-light, #f0cf91);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.model-gallery-lightbox-meta h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(20px, 3vw, 34px);
  line-height: 1.05;
}

.model-gallery-lightbox-count {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(5, 7, 10, 0.74);
  color: #f7f4ed;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 720px), (hover: none) {
  .model-gallery-expand {
    right: 10px;
    bottom: 10px;
    width: 38px;
    height: 38px;
  }

  .model-gallery-expand::after {
    display: none;
  }

  .model-gallery-lightbox {
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .model-gallery-lightbox-panel {
    width: calc(100vw - 16px);
    height: min(88dvh, 760px);
    min-height: 300px;
    border-radius: 18px;
  }

  .model-gallery-lightbox-close {
    top: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
  }

  .model-gallery-lightbox-arrow {
    width: 44px;
    height: 44px;
  }

  .model-gallery-lightbox-prev { left: 10px; }
  .model-gallery-lightbox-next { right: 10px; }

  .model-gallery-lightbox-meta {
    min-height: 96px;
    padding: 30px 16px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .model-gallery-expand,
  .model-gallery-lightbox,
  .model-gallery-lightbox-panel,
  .model-gallery-lightbox-image,
  .model-gallery-lightbox-close,
  .model-gallery-lightbox-arrow {
    transition: none;
  }
}
