/* ============================================================
   DP METAL CAST — Product Family Gallery Lightbox Modal
   2-Column Split Studio Layout (Matches Design Reference)
   ============================================================ */

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.gallery-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 34, 46, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.gallery-modal__dialog {
  position: relative;
  z-index: 2;
  width: min(980px, 95vw);
  height: min(620px, 88vh);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: row;
  overflow: hidden;
  transform: scale(0.98) translateY(8px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-modal.is-open .gallery-modal__dialog {
  transform: scale(1) translateY(0);
}

/* ============================================================
   LEFT COLUMN: Stage, Navigation, Counter, Thumbnails (~68%)
   ============================================================ */

.gallery-modal__stage-col {
  flex: 0 0 68%;
  width: 68%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #eaedf1;
  border-right: 1px solid #e2e8f0;
  position: relative;
}

.gallery-modal__stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 24px 44px;
  user-select: none;
}

.gallery-modal__viewport {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.gallery-modal__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition:
    opacity 0.2s ease,
    transform 0.25s ease;
  will-change: transform, opacity;
}

.gallery-modal__img.is-loading {
  opacity: 0.3;
  transform: scale(0.99);
}

.gallery-modal__error-msg {
  color: #b91c1c;
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
  padding: 16px;
}

/* Navigation Chevrons */
.gallery-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  color: #374151;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.18s ease;
}

.gallery-modal__nav:hover,
.gallery-modal__nav:focus-visible {
  background: #ffffff;
  color: #111827;
  border-color: #cbd5e1;
  transform: translateY(-50%) scale(1.06);
  outline: none;
}

.gallery-modal__nav--prev {
  left: 18px;
}

.gallery-modal__nav--next {
  right: 18px;
}

/* 1 of 3 Pill Counter at bottom-left of stage */
.gallery-modal__counter-pill {
  position: absolute;
  bottom: 14px;
  left: 18px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  padding: 3px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  z-index: 5;
}

/* Bottom Thumbnails Strip */
.gallery-modal__thumbs-strip {
  flex: 0 0 auto;
  padding: 12px 18px;
  background: #fafcfe;
  border-top: 1px solid #dbdfe4;
  overflow-x: auto;
  scrollbar-width: thin;
}

.gallery-modal__thumbs-strip::-webkit-scrollbar {
  height: 4px;
}

.gallery-modal__thumbs-strip::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

.gallery-modal__thumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min-content;
}

.gallery-modal__thumb {
  width: 68px;
  height: 50px;
  flex: 0 0 auto;
  padding: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.18s ease;
}

.gallery-modal__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-modal__thumb:hover {
  border-color: #94a3b8;
}

.gallery-modal__thumb.is-active {
  border: 2px solid #183356;
  box-shadow: 0 0 0 1px #183356;
}

/* ============================================================
   RIGHT COLUMN: Information, Specs & Actions (~32%)
   ============================================================ */

.gallery-modal__info-col {
  flex: 0 0 32%;
  width: 32%;
  display: flex;
  flex-direction: column;
  padding: 26px 24px 20px;
  background: #ffffff;
  overflow-y: auto;
}

.gallery-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.gallery-modal__title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.gallery-modal__close {
  background: transparent;
  border: none;
  color: #4b5563;
  cursor: pointer;
  padding: 4px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  transition:
    color 0.15s,
    background 0.15s;
  line-height: 1;
  margin-top: -2px;
  margin-right: -4px;
}

.gallery-modal__close:hover {
  color: #111827;
  background: #f3f4f6;
}

.gallery-modal__summary {
  margin: 10px 0 16px;
  font-size: 13px;
  line-height: 1.45;
  color: #4b5563;
}

.gallery-modal__divider {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 0 0 16px;
}

.gallery-modal__item-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
}

.gallery-modal__item-desc {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #4b5563;
}

.gallery-modal__actions {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-modal__btn-primary {
  width: 100%;
  padding: 12px 16px;
  background: #c4762a;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: background 0.18s ease;
}

.gallery-modal__btn-primary:hover {
  background: #10233d;
}

.gallery-modal__btn-secondary {
  width: 100%;
  padding: 11px 16px;
  background: #ffffff;
  color: #183356;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.18s ease;
}

.gallery-modal__btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* ============================================================
   Section 06 Product Cards (Refined & Tactile)
   ============================================================ */

.prod-strip {
  pointer-events: none;
}

.prod {
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative;
  transition:
    border-color 0.25s ease,
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.25s ease !important;
}

.prod:hover,
.prod:focus-visible {
  border-color: var(--navy) !important;
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(22, 32, 43, 0.08);
  outline: none;
}

.prod-media {
  position: relative;
  overflow: hidden;
}

.prod-gallery-hint {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(22, 32, 43, 0.85);
  color: #ffffff;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 2px;
  opacity: 0;
  transform: translateY(-3px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  pointer-events: none;
  z-index: 2;
}

.prod:hover .prod-gallery-hint,
.prod:focus-visible .prod-gallery-hint {
  opacity: 1;
  transform: translateY(0);
}

.prod-link {
  display: inline-block;
  margin-top: auto;
  padding-top: 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.02em;
  transition: color 0.18s ease;
}

.prod:hover .prod-link {
  color: var(--hot-deep);
}

/* Responsive adjustments */
@media (max-width: 820px) {
  .gallery-modal__dialog {
    flex-direction: column;
    width: 96vw;
    height: auto;
    max-height: 94vh;
    overflow-y: auto;
  }
  .gallery-modal__stage-col {
    flex: 0 0 auto;
    width: 100%;
    height: 38vh;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }
  .gallery-modal__info-col {
    flex: 1 1 auto;
    width: 100%;
    padding: 20px;
  }
}
