/* ==========================================================================
   OMEGA SCIENTIFIC - PRODUCTS & SYSTEMS (assets/css/products.css)
   Dual-Mode Interactive Catalog:
   1. Default: 3-Column Equal-Height Blue Gradient Cards Grid
   2. Theater Mode: YouTube-Style Left Enlarged Stage + Right Single Column Feed
   ========================================================================== */

.products-section {
  position: relative;
  width: 100%;
  padding-top: calc(var(--header-height) + 2.5rem);
  padding-bottom: 90px;
  background-color: #f1f5f9;
  min-height: 100vh;
}

/* Header & Controls */
.products-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 36px;
  gap: 24px;
  flex-wrap: wrap;
}

.products-header-title-block {
  flex-grow: 1;
  min-width: 280px;
}

.products-page-title {
  font-family: var(--font-heading, 'Anek Devanagari', sans-serif);
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 6px 0;
}

.products-page-subtitle {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  color: #64748b;
  margin: 0;
}

/* Header Actions (Right Side Search Bar + Back Button) */
.products-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.header-search-bar {
  position: relative;
  width: 320px;
  max-width: 100%;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #0077b6;
  font-size: 0.95rem;
  pointer-events: none;
}

.header-search-input {
  width: 100%;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  padding: 12px 40px 12px 44px;
  border-radius: 14px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #0f172a;
  outline: none;
  box-shadow: 0 4px 14px -3px rgba(15, 23, 42, 0.05);
  transition: all 0.22s ease;
}

.header-search-input:focus {
  border-color: #0096c7;
  box-shadow: 0 0 0 3.5px rgba(0, 150, 199, 0.18), 0 6px 20px -3px rgba(0, 119, 182, 0.15);
}

.header-search-input::placeholder {
  color: #94a3b8;
}

.search-clear-btn {
  display: none;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  border: none;
  color: #475569;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-clear-btn.visible {
  display: flex;
}

.search-clear-btn:hover {
  background: #cbd5e1;
  color: #0f172a;
}

/* Return to 3-Grid View Button (Shows in Theater Mode) */
.btn-back-grid {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border-radius: 14px;
  background: #ffffff;
  border: 1.5px solid #0077b6;
  color: #0077b6;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px -3px rgba(0, 119, 182, 0.25);
  white-space: nowrap;
}

.btn-back-grid:hover {
  background: #0077b6;
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-back-grid.visible {
  display: inline-flex;
}

/* ==========================================================================
   MODE 1: 3-COLUMN OVERVIEW GRID (DEFAULT)
   ========================================================================== */
.products-container.mode-grid .enlarged-theater-stage {
  display: none;
}

.products-container.mode-grid .products-grid-feed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: stretch;
}

/* ==========================================================================
   BLUE GRADIENT PRODUCT CARDS (EQUAL HEIGHT & FULL IMAGE COVER)
   ========================================================================== */
.product-blue-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(145deg, #0b2545 0%, #133a6b 45%, #004b87 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px -5px rgba(11, 37, 69, 0.35);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease, border-color 0.28s ease;
  position: relative;
  cursor: pointer;
}

.product-blue-card:hover {
  transform: translateY(-6px);
  border-color: #0096c7;
  box-shadow: 0 18px 40px -8px rgba(0, 119, 182, 0.45);
}

/* Image Wrapper: Fully Cover Container */
.card-img-wrap {
  position: relative;
  width: 100%;
  height: 240px;
  background: #06152b;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.product-blue-card:hover .card-img {
  transform: scale(1.06);
}

.card-index-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(11, 37, 69, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', monospace, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 20px;
  z-index: 2;
}

/* Card Body: Paragraph Starts Right Below Title */
.card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 22px 22px 20px 22px;
}

.card-title {
  font-family: var(--font-heading, 'Anek Devanagari', sans-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  margin: 0 0 8px 0; /* Title ends cleanly */
}

.card-desc {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin: 0 0 20px 0; /* Paragraph starts immediately below title */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Action Button Anchored to Bottom */
.card-footer-action {
  margin-top: auto; /* Pushes button to bottom evenly across all cards */
}

.btn-know-more {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0096c7 0%, #0077b6 50%, #004b87 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 0 1.2em -0.5em #003e7e, 0 4px 14px rgba(0, 119, 182, 0.3);
  transition: all 0.22s ease;
}

.btn-know-more:hover {
  background: linear-gradient(135deg, #00b4d8 0%, #0096c7 50%, #0077b6 100%);
  box-shadow: 0 6px 18px rgba(0, 180, 216, 0.45);
  transform: translateY(-2px);
}

.btn-know-more i {
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.btn-know-more:hover i {
  transform: translateX(4px);
}

/* ==========================================================================
   MODE 2: THEATER MODE (YOUTUBE-STYLE LEFT STAGE + RIGHT 1-COL FEED)
   ========================================================================== */
.products-container.mode-theater {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 32px;
  align-items: start;
}

/* Left Enlarged Theater Stage */
.products-container.mode-theater .enlarged-theater-stage {
  display: block;
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
}

.theater-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 12px 40px -10px rgba(15, 23, 42, 0.1);
  position: relative;
}

.theater-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.theater-close-btn:hover {
  background: #ef4444;
  transform: scale(1.1);
}

/* Theater Image: Fully Cover Container */
.theater-image-frame {
  position: relative;
  width: 100%;
  height: 400px;
  background: #0b1329;
  overflow: hidden;
}

.theater-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.theater-counter-pill {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', monospace, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 30px;
  z-index: 2;
}

/* Theater Body */
.theater-content {
  padding: 34px 38px;
}

.theater-title {
  font-family: var(--font-heading, 'Anek Devanagari', sans-serif);
  font-size: clamp(1.9rem, 2.7vw, 2.5rem);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.18;
  margin: 0 0 10px 0;
  letter-spacing: -0.01em;
}

.theater-desc {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  color: #475569;
  line-height: 1.65;
  margin: 0 0 24px 0;
}

/* Specifications Grid */
.theater-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 18px;
  padding: 20px 22px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  margin-bottom: 28px;
}

.theater-spec-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.spec-k {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0077b6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spec-v {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f172a;
}

/* Theater Actions */
.theater-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-theater-brochure {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 12px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #0f172a;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn-theater-brochure:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* ==========================================================================
   RIGHT 1-COLUMN FEED (EQUAL HEIGHT TO LEFT & HIGHLIGHTED SCROLLBAR)
   ========================================================================== */
.products-container.mode-theater .products-grid-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 10px;
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
  
  /* Highlighted modern scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #0096c7 #e2e8f0;
}

/* Chrome / Safari / Edge High-Visibility Highlighted Scrollbar */
.products-container.mode-theater .products-grid-feed::-webkit-scrollbar {
  width: 8px;
}

.products-container.mode-theater .products-grid-feed::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 10px;
}

.products-container.mode-theater .products-grid-feed::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0096c7 0%, #0077b6 100%);
  border-radius: 10px;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(0, 150, 199, 0.4);
}

.products-container.mode-theater .products-grid-feed::-webkit-scrollbar-thumb:hover {
  background: #004b87;
}

/* Compact Horizontal Cards in 1-Col Feed */
.products-container.mode-theater .product-blue-card {
  flex-direction: row;
  height: auto;
  min-height: 104px;
  border-radius: 16px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  align-items: center;
  flex-shrink: 0;
}

.products-container.mode-theater .card-img-wrap {
  width: 110px;
  height: 104px;
  flex-shrink: 0;
}

.products-container.mode-theater .card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.products-container.mode-theater .card-index-tag {
  display: none;
}

.products-container.mode-theater .card-body {
  padding: 12px 14px;
}

.products-container.mode-theater .card-title {
  font-size: 0.98rem;
  color: #0f172a;
  min-height: auto;
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.products-container.mode-theater .card-desc {
  display: none;
}

.products-container.mode-theater .card-footer-action {
  margin: 0;
}

.products-container.mode-theater .btn-know-more {
  padding: 4px 10px;
  font-size: 0.78rem;
  width: auto;
  display: inline-flex;
}

/* Active Highlight in Sidebar */
.products-container.mode-theater .product-blue-card.is-active {
  background: linear-gradient(135deg, #0096c7 0%, #0077b6 50%, #004b87 100%);
  border-color: transparent;
  box-shadow: 0 6px 20px -2px rgba(0, 119, 182, 0.45);
}

.products-container.mode-theater .product-blue-card.is-active .card-title {
  color: #ffffff;
}

.products-container.mode-theater .product-blue-card.is-active .btn-know-more {
  background: #ffffff;
  color: #0077b6;
  box-shadow: none;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) {
  .products-container.mode-grid .products-grid-feed {
    grid-template-columns: repeat(2, 1fr);
  }

  .products-container.mode-theater {
    grid-template-columns: 1fr 320px;
    gap: 20px;
  }

  .theater-image-frame {
    height: 320px;
  }

  .theater-content {
    padding: 24px;
  }
}

@media (max-width: 860px) {
  .products-container.mode-grid .products-grid-feed {
    grid-template-columns: 1fr;
  }

  .products-container.mode-theater {
    grid-template-columns: 1fr;
  }

  .products-container.mode-theater .enlarged-theater-stage {
    position: static;
  }

  .products-container.mode-theater .products-grid-feed {
    position: static;
    max-height: 400px;
  }

  .theater-specs-grid {
    grid-template-columns: 1fr;
  }

  .theater-actions .cssbuttons-io-button,
  .btn-theater-brochure {
    width: 100%;
    justify-content: center;
  }
}
