/* ========================================
   MASONRY GRID GALLERY - BlackLimousines
   Paris Sprinter VIP Premium Gallery
   ======================================== */

.bl-vehicle-gallery-section {
  padding: 80px 0;
  background-color: #efefef;
  color: #333;
  position: relative;
  overflow: hidden;
}

/* Container */
.bl-vehicle-gallery-section .bl-container {
  max-width: 100%; /* Full width для горизонтального скролла */
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* Decorative element */
.bl-vehicle-gallery-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(154, 138, 120, 0.05), transparent 60%);
  pointer-events: none;
}

/* ========================================
   SECTION HEADER
   ======================================== */

.bl-vehicle-gallery-section .bl-section-header {
  text-align: center;
  margin-bottom: 50px;
}

.bl-vehicle-gallery-section .bl-section-subtitle {
  color: #9A8A78;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 14px;
  font-weight: 600;
  display: block;
  margin-bottom: 15px;
  font-family: 'Alexandria', sans-serif;
}

.bl-vehicle-gallery-section .section-title {
  color: #1A1A1A;
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
  text-transform: uppercase;
  font-family: 'Alexandria', sans-serif;
}

.bl-vehicle-gallery-section .section-title span {
  color: #9A8A78;
  font-weight: 400;
}

.bl-vehicle-gallery-section .bl-divider {
  width: 80px;
  height: 2px;
  background: #9A8A78;
  margin: 0 auto 20px;
}

.bl-gallery-subtitle {
  font-size: 1.125rem;
  color: #555;
  font-style: italic;
  margin: 0;
}

/* ========================================
   MASONRY GRID LAYOUT - HORIZONTAL SCROLL
   ======================================== */

.bl-masonry-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr); /* 12 колонок для лучшего распределения */
  grid-template-rows: repeat(6, 200px); /* 6 рядов по 200px */
  gap: 12px;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Кастомный скроллбар */
.bl-masonry-grid::-webkit-scrollbar {
  height: 8px;
}

.bl-masonry-grid::-webkit-scrollbar-track {
  background: rgba(154, 138, 120, 0.1);
  border-radius: 10px;
}

.bl-masonry-grid::-webkit-scrollbar-thumb {
  background: #9A8A78;
  border-radius: 10px;
}

.bl-masonry-grid::-webkit-scrollbar-thumb:hover {
  background: #826f5f;
}

/* Базовый стиль для всех элементов */
.bl-masonry-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  background: #000;
  width: 100%;
  height: 100%;
}

/* Gradient overlay on hover */
.bl-masonry-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(154, 138, 120, 0) 0%, rgba(154, 138, 120, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
  pointer-events: none;
}

.bl-masonry-item:hover::before {
  opacity: 1;
}

.bl-masonry-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Изображения */
.bl-masonry-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bl-masonry-item:hover img {
  transform: scale(1.08);
}

/* Большие элементы (2×2) */
.bl-masonry-item.bl-large {
  grid-column: span 2;
  grid-row: span 2;
}

/* Overlay с иконкой zoom */
.bl-masonry-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  width: 60px;
  height: 60px;
  background: rgba(154, 138, 120, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  pointer-events: none;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 30px rgba(154, 138, 120, 0.4);
}

.bl-masonry-item:hover .bl-masonry-overlay {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.bl-masonry-overlay svg {
  width: 28px;
  height: 28px;
  color: #ffffff;
}

/* ========================================
   КРАСИВЫЙ MASONRY GRID: 15 фоток
   12 колонок × 6 рядов

   Паттерн: 3 БОЛЬШИЕ (3×3) + 12 маленьких (2×2)
   Симметричное и профессиональное распределение
   ======================================== */

/* БОЛЬШАЯ #1 - левый верх (0) - 3×3 */
.bl-masonry-item[data-index="0"] {
  grid-column: 1 / 4;
  grid-row: 1 / 4;
}

/* Верхний ряд - маленькие справа */
.bl-masonry-item[data-index="1"] {
  grid-column: 4 / 6;
  grid-row: 1 / 3;
}

.bl-masonry-item[data-index="2"] {
  grid-column: 6 / 8;
  grid-row: 1 / 3;
}

.bl-masonry-item[data-index="3"] {
  grid-column: 8 / 10;
  grid-row: 1 / 3;
}

/* Второй ряд справа */
.bl-masonry-item[data-index="4"] {
  grid-column: 10 / 13;
  grid-row: 1 / 3;
}

.bl-masonry-item[data-index="5"] {
  grid-column: 4 / 6;
  grid-row: 3 / 3;
}

/* БОЛЬШАЯ #2 - правый центр (6) - 3×3 */
.bl-masonry-item[data-index="6"] {
  grid-column: 6 / 9;
  grid-row: 3 / 6;
}

.bl-masonry-item[data-index="7"] {
  grid-column: 9 / 11;
  grid-row: 3 / 5;
}

.bl-masonry-item[data-index="8"] {
  grid-column: 11 / 13;
  grid-row: 3 / 5;
}

/* Нижний ряд слева */
.bl-masonry-item[data-index="9"] {
  grid-column: 1 / 3;
  grid-row: 4 / 6;
}

/* БОЛЬШАЯ #3 - левый низ (10) - 3×3 */
.bl-masonry-item[data-index="10"] {
  grid-column: 3 / 6;
  grid-row: 4 / 7;
}

.bl-masonry-item[data-index="11"] {
  grid-column: 9 / 11;
  grid-row: 5 / 7;
}

.bl-masonry-item[data-index="12"] {
  grid-column: 11 / 13;
  grid-row: 5 / 7;
}

/* Последние фотки - нижний ряд (только 1 ряд в высоту!) */
.bl-masonry-item[data-index="13"] {
  grid-column: 1 / 3;
  grid-row: 6;
  height: 200px; /* Фиксированная высота */
}

.bl-masonry-item[data-index="14"] {
  grid-column: 6 / 9;
  grid-row: 6;
  height: 200px; /* Фиксированная высота */
}

/* ========================================
   LIGHTBOX
   ======================================== */

.bl-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  backdrop-filter: blur(20px);
}

.bl-lightbox.active {
  opacity: 1;
  visibility: visible;
}

/* Lightbox Content */
.bl-lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  animation: lightboxZoomIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes lightboxZoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.bl-lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 25px 100px rgba(0, 0, 0, 0.8);
}

/* Close Button */
.bl-lightbox-close {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  color: #ffffff;
  font-size: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10001;
  backdrop-filter: blur(10px);
  line-height: 1;
  padding: 0;
}

.bl-lightbox-close:hover {
  background: rgba(154, 138, 120, 0.8);
  border-color: #9A8A78;
  transform: rotate(90deg) scale(1.1);
}

/* Navigation Buttons */
.bl-lightbox-prev,
.bl-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10001;
  backdrop-filter: blur(10px);
  padding: 0;
}

.bl-lightbox-prev {
  left: 30px;
}

.bl-lightbox-next {
  right: 30px;
}

.bl-lightbox-prev:hover,
.bl-lightbox-next:hover {
  background: rgba(154, 138, 120, 0.8);
  border-color: #9A8A78;
  transform: translateY(-50%) scale(1.15);
}

.bl-lightbox-prev svg,
.bl-lightbox-next svg {
  width: 24px;
  height: 24px;
}

/* Image Counter */
.bl-lightbox-counter {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  background: rgba(154, 138, 120, 0.3);
  padding: 10px 25px;
  border-radius: 50px;
  border: 1px solid rgba(154, 138, 120, 0.5);
  backdrop-filter: blur(10px);
  letter-spacing: 1px;
  white-space: nowrap;
  font-family: 'Alexandria', sans-serif;
}

/* ========================================
   CTA SECTION
   ======================================== */

.bl-gallery-cta {
  text-align: center;
  margin-top: 60px;
  padding-top: 60px;
  border-top: 1px solid rgba(154, 138, 120, 0.2);
}

.bl-gallery-cta p {
  font-size: 1.125rem;
  color: #333;
  margin-bottom: 25px;
  font-weight: 500;
  font-family: 'Alexandria', sans-serif;
}

/* Button uses default page styles */

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Large Desktop */
@media (min-width: 1400px) {
  .bl-masonry-grid {
    gap: 20px;
  }
}

/* Tablet Landscape */
@media (max-width: 1024px) {
  .bl-vehicle-gallery-section {
    padding: 60px 0;
  }

  .bl-vehicle-gallery-section .section-title {
    font-size: 36px;
  }

  .bl-masonry-grid {
    gap: 12px;
  }

  .bl-masonry-overlay {
    width: 55px;
    height: 55px;
  }

  .bl-masonry-overlay svg {
    width: 24px;
    height: 24px;
  }

  .bl-lightbox-prev,
  .bl-lightbox-next {
    width: 50px;
    height: 50px;
  }

  .bl-lightbox-prev {
    left: 20px;
  }

  .bl-lightbox-next {
    right: 20px;
  }

  .bl-lightbox-close {
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 26px;
  }
}



/* Large Desktop */
@media (min-width: 1400px) {
  .bl-masonry-grid {
    gap: 20px;
  }
}

/* Tablet Landscape */
@media (max-width: 1024px) {
  .bl-vehicle-gallery-section {
    padding: 60px 0;
  }

  .bl-vehicle-gallery-section .section-title {
    font-size: 36px;
  }

  .bl-masonry-grid {
    gap: 12px;
  }

  .bl-masonry-overlay {
    width: 55px;
    height: 55px;
  }

  .bl-masonry-overlay svg {
    width: 24px;
    height: 24px;
  }

  .bl-lightbox-prev,
  .bl-lightbox-next {
    width: 50px;
    height: 50px;
  }

  .bl-lightbox-prev {
    left: 20px;
  }

  .bl-lightbox-next {
    right: 20px;
  }

  .bl-lightbox-close {
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 26px;
  }
}

/* Tablet Portrait & Mobile Landscape */
@media (max-width: 768px) {
  .bl-vehicle-gallery-section {
    padding: 40px 0;
  }

  .bl-vehicle-gallery-section .section-title {
    font-size: 28px;
  }

  .bl-gallery-subtitle {
    font-size: 14px;
  }

  /* MASONRY GRID - та же композиция, меньшие размеры */
  .bl-masonry-grid {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(6, 120px); /* Уменьшенная высота */
    gap: 8px;
    padding: 0 10px;
  }

  /* Сохраняем все позиции как на desktop */
  .bl-masonry-item[data-index="13"],
  .bl-masonry-item[data-index="14"] {
    height: 120px;
  }

  .bl-masonry-overlay {
    width: 50px;
    height: 50px;
  }

  .bl-masonry-overlay svg {
    width: 22px;
    height: 22px;
  }

  .bl-lightbox-prev,
  .bl-lightbox-next {
    width: 45px;
    height: 45px;
  }

  .bl-lightbox-prev {
    left: 10px;
  }

  .bl-lightbox-next {
    right: 10px;
  }

  .bl-lightbox-prev svg,
  .bl-lightbox-next svg {
    width: 20px;
    height: 20px;
  }

  .bl-lightbox-close {
    width: 45px;
    height: 45px;
    top: 15px;
    right: 15px;
    font-size: 24px;
  }

  .bl-lightbox-counter {
    font-size: 14px;
    padding: 8px 20px;
    bottom: -40px;
  }

  .bl-gallery-cta {
    margin-top: 40px;
    padding-top: 40px;
  }

  .bl-gallery-cta p {
    font-size: 16px;
  }

  .bl-gallery-cta .bl-btn-primary {
    padding: 15px 30px;
    font-size: 14px;
  }
}

/* Mobile Portrait */
@media (max-width: 480px) {
  .bl-vehicle-gallery-section {
    padding: 30px 0;
  }

  .bl-vehicle-gallery-section .bl-container {
    padding: 0 10px;
  }

  .bl-vehicle-gallery-section .section-title {
    font-size: 24px;
  }

  .bl-gallery-subtitle {
    font-size: 13px;
    line-height: 1.4;
  }

  /* MASONRY GRID - та же композиция, ещё меньше */
  .bl-masonry-grid {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(6, 80px); /* Ещё меньшая высота для мобильных */
    gap: 6px;
    padding: 0 8px;
  }

  /* Сохраняем все позиции как на desktop */
  .bl-masonry-item {
    border-radius: 6px;
  }

  .bl-masonry-item[data-index="13"],
  .bl-masonry-item[data-index="14"] {
    height: 80px;
  }

  .bl-masonry-overlay {
    width: 45px;
    height: 45px;
  }

  .bl-masonry-overlay svg {
    width: 20px;
    height: 20px;
  }

  .bl-lightbox-prev,
  .bl-lightbox-next {
    width: 40px;
    height: 40px;
  }

  .bl-lightbox-prev svg,
  .bl-lightbox-next svg {
    width: 18px;
    height: 18px;
  }

  .bl-lightbox-close {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .bl-lightbox-counter {
    font-size: 12px;
    padding: 6px 16px;
    bottom: -50px;
  }

  .bl-gallery-cta p {
    font-size: 15px;
  }

  .bl-gallery-cta .bl-btn-primary {
    padding: 14px 28px;
    font-size: 13px;
    gap: 8px;
  }
}

/* Very Small Mobile */
@media (max-width: 360px) {
  .bl-vehicle-gallery-section .section-title {
    font-size: 22px;
  }

  .bl-masonry-grid {
    gap: 2px;
  }

  .bl-lightbox-prev,
  .bl-lightbox-next {
    width: 36px;
    height: 36px;
  }
}