/**
 * Rolax Before/After Public Stylesheet
 * 100% Matched to User Design Reference
 */

.rba-comparison-block {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  font-family: "SN Pro", "Roboto", sans-serif;
  box-sizing: border-box;
}

.rba-comparison-block * {
  box-sizing: border-box;
}

/* ── MAIN 2-COLUMN GRID (8 cols : 4 cols ratio with ZERO gap) ─────────────── */
.rba-main-grid {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 0;
  border-radius: 16px;
  overflow: hidden;
  align-items: stretch;
  height: 520px;
  order: 1; /* Desktop: Main grid is on TOP */
}

@media (max-width: 860px) {
  .rba-main-grid {
    grid-template-columns: 1fr;
    height: auto;
    order: 2; /* Mobile: Main grid is at the BOTTOM */
  }
}

/* ── LEFT: BEFORE / AFTER INTERACTIVE SLIDER ───────────────────────────────── */
.rba-slider-container {
  position: relative;
  border-radius: 16px 0 0 16px;
  overflow: hidden;
  height: 100%;
  background: #0f172a;
  user-select: none;
  touch-action: pan-y;
}

@media (max-width: 860px) {
  .rba-slider-container {
    border-radius: 16px 16px 0 0;
    min-height: 320px;
    height: auto;
  }
}

.rba-image-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.rba-image-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* After layer clipped on top using polygon clip-path */
.rba-image-after {
  width: 100%;
  height: 100%;
  z-index: 2;
  clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}

.rba-image-after img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Badges */
.rba-badge {
  position: absolute;
  top: 18px;
  padding: 8px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffffff;
  z-index: 10;
  pointer-events: none;
}

.rba-badge--before {
  left: 18px;
  background: #233547;
}

.rba-badge--after {
  right: 18px;
  background: #d4a000;
}

/* Draggable Handle */
.rba-slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 44px;
  margin-left: -22px;
  z-index: 20;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rba-handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: #ffffff;
}

.rba-handle-circle {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.rba-slider-handle:hover .rba-handle-circle,
.rba-slider-handle:active .rba-handle-circle {
  transform: scale(1.08);
}

/* ── RIGHT: PROJECT DETAILS PANEL ──────────────────────────────────────────── */
.rba-details-panel {
  background: #f7f7f9;
  border-radius: 0 16px 16px 0;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
}

@media (max-width: 860px) {
  .rba-details-panel {
    border-radius: 0 0 16px 16px;
    padding: 24px 28px;
    height: auto;
  }
}

.rba-project-cat {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #1a2744;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.rba-project-title {
  font-size: 24px;
  font-weight: 800;
  color: #1a2744;
  text-transform: uppercase;
  margin: 0 0 6px 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.rba-project-location {
  font-size: 16px;
  font-weight: 500;
  color: #39505e;
  margin: 0 0 20px 0;
}

.rba-details-divider {
  border-bottom: 1px solid #975c0066;
  margin-bottom: 24px;
}

.rba-detail-section {
  margin-bottom: 18px;
}

.rba-section-title {
  font-family: "SN Pro", sans-serif;
  font-size: 16px;
  color: #1e293b;
  margin: 0 0 4px 0;
}

.rba-section-text {
  line-height: 1.6;
  margin: 0;
  font-weight: 400;
}

.rba-specs-list {
  margin-top: 20px;
}

.rba-spec-row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.rba-spec-label {
  font-weight: 700;
  color: #1e293b;
  min-width: 80px;
}

.rba-spec-value {
  color: #64748b;
  font-weight: 400;
}

/* ── GALLERY THUMBNAIL SLIDER (Desktop: Bottom / Mobile: Top) ─────────────── */
.rba-gallery-row {
  display: flex !important;
  flex-direction: row !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 16px;
  margin-top: 24px;
  margin-bottom: 0;
  padding-bottom: 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  order: 2; /* Desktop: Thumbnails at the BOTTOM */
}

.rba-gallery-row::-webkit-scrollbar {
  display: none;
}

.rba-thumb-card {
  flex: 0 0 calc(25% - 12px) !important;
  min-width: 220px;
  border-radius: 14px;
  border: 3px solid transparent;
  overflow: hidden;
  height: 135px;
  cursor: pointer;
  transition: border-color 0.25s ease;
  background: transparent;
  scroll-snap-align: center;
}

.rba-thumb-card:hover {
  transform: none;
}

.rba-thumb-card:not(.rba-thumb-card--active) {
  border-color: transparent !important;
}

.rba-thumb-card--active {
  border-color: #1a2744 !important;
}

.rba-thumb-img {
  width: 100%;
  height: 100%;
  border-radius: 11px;
  overflow: hidden;
}

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

@media (max-width: 860px) {
  .rba-gallery-row {
    order: 1;
    margin-top: 0;
    margin-bottom: 10px;
    gap: 8px;
  }

  .rba-thumb-card {
    flex: 0 0 calc((100% - 24px) / 4) !important;
    min-width: 0 !important;
    height: 75px;
    border-radius: 8px;
  }

  .rba-thumb-img {
    border-radius: 6px;
  }
}

@media (max-width: 480px) {
  .rba-thumb-card {
    height: 65px;
  }
}
