/* ==========================================================================
   SREE KRISHNA ENTERPRIZES - SPARES CATALOGUE STYLES
   White / Light Professional Theme matching SKE Design System
   ========================================================================== */

.spares-section {
  padding: 5rem 0;
  background-color: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  position: relative;
}

.spares-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Intro */
.spares-header {
  text-align: center;
  max-width: 840px;
  margin: 0 auto 3rem auto;
}

.spares-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 9999px;
  margin-bottom: 1rem;
}

.spares-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.spares-title span {
  color: #dc2626;
}

.spares-subtitle {
  font-size: 1.0625rem;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

/* Search and Filter bar */
.spares-search-wrapper {
  max-width: 580px;
  margin: 0 auto;
  position: relative;
}

.spares-search-input {
  width: 100%;
  padding: 0.875rem 1.25rem 0.875rem 3rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
  outline: none;
}

.spares-search-input:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.spares-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

/* ==========================================================================
   VIEW 1: VERTICAL BRAND FLOW LIST
   ========================================================================== */
.spares-brand-list-view {
  display: block;
  transition: opacity 0.3s ease;
}

.spares-brand-list-view.hidden {
  display: none;
}

.spares-flow-container {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  position: relative;
}

/* Vertical Guide Line */
.spares-flow-container::before {
  content: '';
  position: absolute;
  top: 2rem;
  bottom: 2rem;
  left: 2.25rem;
  width: 2px;
  background: linear-gradient(to bottom, #dc2626, #cbd5e1, #dc2626);
  z-index: 1;
  opacity: 0.35;
}

/* Brand Card / Button Item */
.spares-brand-card {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.125rem 1.5rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.spares-brand-card:hover,
.spares-brand-card:focus-visible {
  border-color: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
}

.spares-brand-card:active {
  transform: translateY(0);
}

/* Brand Number / Icon Bubble */
.spares-brand-num {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 10px;
  background: #f1f5f9;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 800;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.spares-brand-card:hover .spares-brand-num {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

/* Brand Details */
.spares-brand-info {
  flex-grow: 1;
  min-width: 0;
}

.spares-brand-header-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.spares-brand-name {
  font-size: 1.1875rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  transition: color 0.2s ease;
}

.spares-brand-card:hover .spares-brand-name {
  color: #dc2626;
}

.spares-brand-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0f172a;
  background: #e2e8f0;
  padding: 0.125rem 0.625rem;
  border-radius: 6px;
}

.spares-brand-card:hover .spares-brand-badge {
  background: #fee2e2;
  color: #dc2626;
}

.spares-brand-desc {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Action Arrow */
.spares-brand-action {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.spares-brand-card:hover .spares-brand-action {
  color: #dc2626;
  transform: translateX(4px);
}

/* ==========================================================================
   VIEW 2: BRAND-SPECIFIC PAGE VIEWER
   ========================================================================== */
.spares-viewer-view {
  display: block;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
  animation: sparesFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.spares-viewer-view.hidden {
  display: none;
}

@keyframes sparesFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Viewer Top Control Bar */
.spares-viewer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #ffffff;
  border-bottom: 1.5px solid #e2e8f0;
  gap: 1rem;
  flex-wrap: wrap;
}

.spares-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 0.625rem 1.125rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.spares-back-btn:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.spares-viewer-title-block {
  text-align: center;
  flex-grow: 1;
}

.spares-viewer-brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.125rem 0;
}

.spares-viewer-category-tag {
  font-size: 0.8125rem;
  color: #64748b;
  font-weight: 500;
}

/* Viewer Toolbar Controls (Zoom & Actions) */
.spares-viewer-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.spares-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.spares-tool-btn:hover {
  background: #ffffff;
  color: #dc2626;
  border-color: #dc2626;
}

.spares-zoom-level {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #475569;
  min-width: 3.5rem;
  text-align: center;
  user-select: none;
}

/* Sub-Model Navigation Tabs / Pills (for Multi-Page Brands) */
.spares-submodel-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.spares-submodel-nav::-webkit-scrollbar {
  height: 4px;
}

.spares-submodel-nav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.spares-submodel-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.875rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.spares-submodel-pill:hover {
  border-color: #dc2626;
  color: #dc2626;
}

.spares-submodel-pill.active {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.spares-pill-num {
  font-size: 0.6875rem;
  opacity: 0.85;
}

/* Main Image Viewer Stage */
.spares-viewer-stage {
  position: relative;
  min-height: 480px;
  max-height: 78vh;
  background: #f1f5f9;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  user-select: none;
  cursor: grab;
}

.spares-viewer-stage.grabbing {
  cursor: grabbing;
}

.spares-page-image-wrap {
  position: relative;
  transition: transform 0.15s ease-out;
  transform-origin: center center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.spares-page-image {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}

/* Floating Stage Nav (Prev / Next overlays) */
.spares-stage-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.spares-stage-nav-btn:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  transform: translateY(-50%) scale(1.08);
}

.spares-stage-nav-btn.prev {
  left: 1rem;
}

.spares-stage-nav-btn.next {
  right: 1rem;
}

.spares-stage-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Bottom Caption and Enquiry Bar */
.spares-viewer-footer {
  padding: 1.25rem 1.5rem;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.spares-caption-info {
  flex-grow: 1;
}

.spares-page-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.25rem 0;
}

.spares-page-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

.spares-pagination-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #334155;
}

.spares-enquiry-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.spares-whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #25d366;
  color: #ffffff;
  padding: 0.625rem 1.125rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.2);
}

.spares-whatsapp-btn:hover {
  background: #1eb956;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
  transform: translateY(-1px);
}

.spares-quote-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.625rem 1.125rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.spares-quote-btn:hover {
  background: #dc2626;
}

/* Fullscreen Mode */
.spares-viewer-view.fullscreen-mode {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  border-radius: 0;
  border: none;
  display: flex;
  flex-direction: column;
}

.spares-viewer-view.fullscreen-mode .spares-viewer-stage {
  flex-grow: 1;
  max-height: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .spares-flow-container::before {
    left: 1.75rem;
  }
  
  .spares-brand-card {
    padding: 1rem;
    gap: 0.875rem;
  }
  
  .spares-brand-num {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.75rem;
  }
  
  .spares-brand-name {
    font-size: 1rem;
  }
  
  .spares-brand-desc {
    font-size: 0.8125rem;
  }
  
  .spares-viewer-topbar,
  .spares-viewer-footer {
    padding: 0.875rem 1rem;
  }
  
  .spares-viewer-stage {
    min-height: 360px;
    padding: 0.75rem;
  }
  
  .spares-stage-nav-btn {
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .spares-stage-nav-btn.prev {
    left: 0.5rem;
  }
  
  .spares-stage-nav-btn.next {
    right: 0.5rem;
  }
  
  .spares-enquiry-actions {
    width: 100%;
    justify-content: stretch;
  }
  
  .spares-whatsapp-btn,
  .spares-quote-btn {
    flex: 1;
    justify-content: center;
  }
}
