/**
 * ==========================================
 * PRODUCT GALLERY - TWO-COLUMN LAYOUT
 * ==========================================
 * Modern product gallery with interactive cards and video display
 * Left: 2x2 grid of product cards
 * Right: Dynamic video player
 */

/* ==========================================
 * Section Container
 * ========================================== */
.product-gallery {
  padding: 80px 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
  overflow: hidden;
}

/* Header */
.gallery-header {
  text-align: center;
  margin-bottom: 60px;
}

.gallery-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
}

.gallery-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #4a6cf7 0%, #6c8cff 100%);
  border-radius: 2px;
}

.gallery-subtitle {
  font-size: 1.1rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
}

/* ==========================================
 * Two-Column Gallery Layout
 * ========================================== */
.gallery-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

/* ==========================================
 * Product Cards Grid (Left Side)
 * ========================================== */
.product-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* Individual Product Card */
.product-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* Product Card Image */
.product-card-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f5f7fa;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-card-image img {
  transform: scale(1.08);
}

.product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
  opacity: 1;
}

/* Product Card Content */
.product-card-content {
  padding: 20px;
}

.product-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.product-card:hover .product-name {
  color: #4a6cf7;
}

.product-description {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================
 * Video Container (Right Side)
 * ========================================== */
.product-video-container {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.video-wrapper {
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  position: relative;
}

.product-video {
  width: 100%;
  height: auto;
  min-height: 400px;
  display: block;
  object-fit: cover;
}

/* Video Info Overlay */
.video-info {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
  padding: 20px 25px 30px;
  color: #fff;
  transform: translateY(0);
  transition: all 0.3s ease;
  pointer-events: none;
}

.video-wrapper:hover .video-info {
  padding-top: 25px;
}

.video-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #fff;
}

.video-description {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

/* ==========================================
 * Responsive Design
 * ========================================== */

/* Tablet (landscape and below) */
@media (max-width: 1024px) {
  .gallery-layout {
    gap: 30px;
  }

  .product-card-image {
    height: 180px;
  }

  .product-video {
    min-height: 350px;
  }

  .product-video-container {
    top: 80px;
  }
}

/* Tablet (portrait) */
@media (max-width: 768px) {
  .product-gallery {
    padding: 60px 0;
  }

  .gallery-header {
    margin-bottom: 40px;
  }

  .gallery-title {
    font-size: 2rem;
  }

  .gallery-subtitle {
    font-size: 1rem;
  }

  /* Stack columns on smaller screens */
  .gallery-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .product-cards-grid {
    gap: 16px;
  }

  .product-card-image {
    height: 160px;
  }

  .product-card-content {
    padding: 16px;
  }

  .product-name {
    font-size: 1.1rem;
  }

  .product-description {
    font-size: 0.85rem;
  }

  /* Make video container relative on mobile */
  .product-video-container {
    position: relative;
    top: 0;
  }

  .product-video {
    min-height: 300px;
  }

  .video-title {
    font-size: 1.3rem;
  }

  .video-description {
    font-size: 0.9rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .product-gallery {
    padding: 40px 0;
  }

  .gallery-title {
    font-size: 1.75rem;
  }

  /* Single column grid on very small screens */
  .product-cards-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .product-card-image {
    height: 200px;
  }

  .product-card-content {
    padding: 18px;
  }

  .product-name {
    font-size: 1.15rem;
  }

  .product-description {
    font-size: 0.9rem;
    -webkit-line-clamp: 3;
  }

  .product-video {
    min-height: 250px;
  }

  .video-info {
    padding: 20px 16px 16px;
  }

  .video-title {
    font-size: 1.2rem;
  }

  .video-description {
    font-size: 0.85rem;
  }
}

/* ==========================================
 * Animation Effects
 * ========================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  animation: fadeIn 0.5s ease forwards;
}

.product-card:nth-child(1) {
  animation-delay: 0.1s;
}

.product-card:nth-child(2) {
  animation-delay: 0.2s;
}

.product-card:nth-child(3) {
  animation-delay: 0.3s;
}

.product-card:nth-child(4) {
  animation-delay: 0.4s;
}

/* ==========================================
 * Accessibility
 * ========================================== */
.product-card:focus {
  outline: 3px solid #4a6cf7;
  outline-offset: 4px;
}

.product-video:focus {
  outline: 3px solid #4a6cf7;
  outline-offset: 4px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-card-image img,
  .product-overlay,
  .product-name,
  .video-info {
    transition: none;
    animation: none;
  }

  .product-card:hover {
    transform: none;
  }

  .product-card:hover .product-card-image img {
    transform: none;
  }
}
