/* =========================================================
   COMPARISON SECTION
   Heading + Tech Stack Carousel
   ========================================================= */

/* ---------------------------------------------------------
   Section Container
   --------------------------------------------------------- */
.comparison-section {
  width: 100%;
  max-width: 100vw;
  padding: clamp(0px, 10vh, 0px) 24px clamp(40px, 8vh, 80px);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(40px, 6vh, 90px);
  overflow-x: hidden;
  box-sizing: border-box;
}
.br-mobile {
  display: none;
}
/* ---------------------------------------------------------
   Heading Content
   --------------------------------------------------------- */
.comparison-header {
  width: 100%;
  max-width: min(900px, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 26px;
  box-sizing: border-box;
}

.comparison-title {
  font-size: clamp(46px, 6vw, 92px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: #0b0b0c;
  margin: 0;
}

.brand-highlight {
  color: #a0e92a;
  font-weight: 600;
}

.comparison-subtitle {
  font-size: clamp(16px, 2vw, 17.5px);
  font-weight: 400;
  line-height: 1.5;
  color: #3e3e3e;
  margin: 0;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------------------------------------------------------
   Comparison Table
   --------------------------------------------------------- */
.comparison-table {
  width: 100%;
  max-width: min(1400px, 100%);
  background: #eeeded00;
  overflow: visible;
  padding-top: 80px;
  position: relative;
  border-radius: 50px;
  box-sizing: border-box;
}

.table-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  position: relative;
  z-index: 1;
}

.table-row:not(.table-header) .table-cell:not(.highlight-cell) {
  background: #f6f6f6;
}

/* ============================================
   SECOND ROW - Edit second row styling here (Lines 79-86)
   ============================================ */
.table-row:nth-child(2) .table-cell {
  padding-top: clamp(26px, 3vw, 32px);
}

.table-row:nth-child(2) .table-cell:first-child {
  border-radius: 50px 0 0 0;
}

.table-row:nth-child(2) .table-cell:last-child:not(.highlight-cell) {
  border-radius: 0 50px 0 0;
}

.table-row:last-child .table-cell {
  padding-bottom: clamp(26px, 3vw, 32px);
}

/* Add horizontal padding to cells at the edges */
.table-row:not(.table-header) .table-cell:first-child {
  padding-left: clamp(28px, 3.5vw, 40px);
}

.table-row:not(.table-header) .table-cell:last-child:not(.highlight-cell) {
  padding-right: clamp(28px, 3.5vw, 40px);
}

/* Bottom rounded corners */
.table-row:last-child .table-cell:first-child {
  border-radius: 0 0 0 50px;
}

.table-row:last-child .table-cell:last-child:not(.highlight-cell) {
  border-radius: 0 0 50px 0;
}

.table-row:not(.table-header):not(:last-child)
  .table-cell:not(.highlight-cell)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
}

.table-row:not(.table-header):not(:last-child) .highlight-cell::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.table-header {
  background: #eeeeee00;
  font-weight: 600;
  margin-bottom: 0;
  font-size: clamp(18px, 2.5vw, 34px);
}

.table-cell {
  padding: clamp(18px, 3vw, 28px) clamp(24px, 3vw, 36px);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  font-size: clamp(14px, 1.5vw, 16px);
  line-height: 1.4;
  color: #0b0b0c;
  transition: background 0.2s ease;
  background: #eeeded00;
  position: relative;
}

/* ============================================
   HEADER ROW - Edit header styling here (Lines 147-157)
   ============================================ */
.table-header .table-cell {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 400;
  background: #ffffff;
  padding-bottom: clamp(20px, 2.5vw, 24px);
}

.table-header .table-cell:not(.highlight-cell):not(.label-cell) {
  background: #ffffff;
  padding-top: clamp(26px, 3vw, 32px);
}

.label-cell {
  justify-content: flex-start;
  text-align: left;
  font-weight: 400;
  color: #333;
  background: transparent;
  border-right: none;
}

.table-header .label-cell {
  padding-left: clamp(28px, 3.5vw, 40px);
  padding-top: clamp(26px, 3vw, 32px);
  border-radius: 50px 0 0 0;
  background: #ffffff;
}

.table-header .table-cell:last-child:not(.highlight-cell) {
  border-radius: 0 50px 0 0;
  background: #ffffff;
  padding-top: clamp(26px, 3vw, 32px);
  padding-right: clamp(28px, 3.5vw, 40px);
}

.highlight-cell {
  background: #121212;
  color: #ffffff;
  font-weight: 500;
  position: relative;
  padding: clamp(26px, 3vw, 36px) clamp(20px, 3vw, 32px) !important;
  z-index: 2;
  border-bottom: none;
}

/* First highlight cell (header) - rounded top */
.table-header .highlight-cell {
  background: #121212;
  color: #a0e92a;
  font-size: clamp(22px, 2.8vw, 30px);
  font-weight: 400;
  border-radius: 24px 24px 0 0;
  margin-top: -36px;
  padding-top: clamp(48px, 5vw, 60px) !important;
  box-shadow:
    0 -6px 20px rgba(0, 0, 0, 0.1),
    6px 0 20px rgba(0, 0, 0, 0.1),
    -6px 0 20px rgba(0, 0, 0, 0.1);
}

/* Middle highlight cells - side shadows only */
.table-row:not(.table-header):not(:last-child) .highlight-cell {
  box-shadow:
    6px 0 20px rgba(0, 0, 0, 0.1),
    -6px 0 20px rgba(0, 0, 0, 0.1);
}

/* Last highlight cell - rounded bottom */
.table-row:last-child .highlight-cell {
  border-radius: 0 0 24px 24px;
  margin-bottom: -36px;
  padding-bottom: clamp(48px, 5vw, 60px) !important;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.1),
    6px 0 20px rgba(0, 0, 0, 0.1),
    -6px 0 20px rgba(0, 0, 0, 0.1);
}

/* Icons - Circular background style */
.icon-check,
.icon-cross {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(22px, 2.5vw, 28px);
  height: clamp(22px, 2.5vw, 28px);
  border-radius: 50%;
  padding: 5px;
  box-sizing: border-box;
}

.icon-check {
  background: #6ede45;
  color: #727272;
}

.icon-cross {
  background: #fd6262;
  color: #4a4a4a;
}

.highlight-cell .icon-check {
  background: #a0e92a;
  color: #4a4a4a;
}

.highlight-cell .icon-cross {
  background: hsl(0, 98%, 66%);
  color: #4a4a4a;
  /* opacity: 0.8; */
}

/* ---------------------------------------------------------
   Tech Carousel Container
   --------------------------------------------------------- */
.tech-carousel {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* ---------------------------------------------------------
   Track Wrapper (overflow hidden)
   --------------------------------------------------------- */
.carousel-track-wrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;

  /* Fade edges for polished look */
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
}

/* ---------------------------------------------------------
   Scrolling Track
   --------------------------------------------------------- */
.carousel-track {
  display: flex;
  gap: clamp(40px, 6vw, 80px);
  width: max-content;

  /* Infinite scroll animation */
  animation: scroll 30s linear infinite;
  will-change: transform;
}

/* ---------------------------------------------------------
   Individual Logo Container
   --------------------------------------------------------- */
.tech-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;

  width: clamp(120px, 15vw, 180px);
  height: clamp(60px, 8vw, 90px);

  padding: 12px;
  background: transparent;
}

/* ---------------------------------------------------------
   Logo Images
   --------------------------------------------------------- */
.tech-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;

  /* Black and white (grayscale) */
  filter: grayscale(1) opacity(0.7);
}

/* ---------------------------------------------------------
   Infinite Scroll Animation
   --------------------------------------------------------- */
@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    /* Move exactly half the track width (since we duplicate logos) */
    transform: translateX(-50%);
  }
}

/* ---------------------------------------------------------
   Responsive Adjustments
   --------------------------------------------------------- */
@media (max-width: 860px) {
  .comparison-section {
    padding: clamp(50px, 8vh, 70px) 20px clamp(30px, 5vh, 50px);
    gap: clamp(70px, 10vh, 90px);
    max-width: 100vw;
    overflow-x: hidden;
  }
  .br-mobile {
    display: inline;
  }

  .comparison-title {
    font-size: clamp(42px, 9vw, 58px);
    line-height: 7.15;
    font-weight: 500;
  }

  .comparison-subtitle {
    font-size: clamp(15px, 4vw, 18px);
  }

  /* Table scrollable on tablet */
  .comparison-table {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;

    touch-action: pan-x; /* ✅ horizontal table scroll only, vertical gestures pass to page */
    overscroll-behavior-x: contain; /* ✅ prevent horizontal scroll from escaping table */
    overscroll-behavior-y: auto; /* ✅ allow vertical page scroll */

    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .comparison-table::-webkit-scrollbar {
    display: none;
  }
  .comparison-table::-webkit-scrollbar {
    display: none;
  }
  .comparison-table::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }

  .table-row {
    min-width: 900px;
  }

  .table-cell {
    padding: 16px 20px;
    font-size: 14px;
  }

  .table-header .table-cell {
    font-size: 24px;
    padding-bottom: 16px;
  }

  .table-header .table-cell:not(.highlight-cell):not(.label-cell) {
    background: #ffffff;
    padding-top: 20px;
  }

  .table-header .label-cell {
    padding-left: 24px;
    padding-top: 20px;
    border-radius: 40px 0 0 0;
    background: #ffffff;
  }

  .table-header .table-cell:last-child:not(.highlight-cell) {
    border-radius: 0 40px 0 0;
    background: #ffffff;
    padding-top: 20px;
    padding-right: 24px;
  }

  .table-row:nth-child(2) .table-cell:first-child {
    border-radius: 40px 0 0 0;
  }

  .table-row:nth-child(2) .table-cell:last-child:not(.highlight-cell) {
    border-radius: 0 40px 0 0;
  }

  .table-header .highlight-cell {
    font-size: 22px;
    margin-top: -24px;
    padding-top: 40px !important;
    border-radius: 20px 20px 0 0;
  }

  .table-row:last-child .highlight-cell {
    margin-bottom: -24px;
    padding-bottom: 40px !important;
    border-radius: 0 0 20px 20px;
  }

  .highlight-cell {
    padding: 22px 20px !important;
  }

  .table-row:nth-child(2) .table-cell {
    padding-top: 20px;
  }

  .table-row:last-child .table-cell {
    padding-bottom: 20px;
  }

  .table-row:not(.table-header) .table-cell:first-child {
    padding-left: 24px;
  }

  .table-row:not(.table-header) .table-cell:last-child:not(.highlight-cell) {
    padding-right: 24px;
  }

  .table-row:last-child .table-cell:first-child {
    border-radius: 0 0 0 40px;
  }

  .table-row:last-child .table-cell:last-child:not(.highlight-cell) {
    border-radius: 0 0 40px 0;
  }

  .table-row:not(.table-header):not(:last-child) .highlight-cell::after {
    left: 16px;
    right: 16px;
  }

  .table-row:not(.table-header):not(:last-child)
    .table-cell:not(.highlight-cell)::after {
    left: 16px;
    right: 16px;
  }

  .carousel-track {
    gap: clamp(30px, 5vw, 50px);
    animation-duration: 25s;
  }

  .tech-logo {
    width: clamp(140px, 22vw, 200px);
    height: clamp(70px, 11vw, 100px);
    padding: 16px;
  }

  .icon-check,
  .icon-cross {
    width: 26px;
    height: 26px;
    stroke-width: 1.2;
    padding: 5px;
  }
}

@media (max-width: 480px) {
  .comparison-section {
    padding: 40px 16px 30px;
    gap: 60px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .comparison-title {
    font-size: clamp(38px, 10vw, 54px);
    line-height: 1.05;
  }

  /* Table mobile styles */
  .comparison-table {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;

    touch-action: pan-x; /* ✅ horizontal table scroll only, vertical gestures pass to page */
    overscroll-behavior-x: contain; /* ✅ prevent horizontal scroll from escaping table */
    overscroll-behavior-y: auto; /* ✅ allow vertical page scroll */

    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .comparison-table::-webkit-scrollbar {
    display: none;
  }
  .comparison-table::-webkit-scrollbar {
    display: none;
  }

  .comparison-table::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }

  .table-row {
    min-width: 800px;
  }

  .table-cell {
    padding: 14px 16px;
    font-size: 13px;
  }

  .label-cell {
    font-size: 13px;
  }

  .table-header .label-cell {
    padding-left: 20px;
    padding-top: 18px;
    border-radius: 32px 0 0 0;
    background: #ffffff;
  }

  .table-header .table-cell {
    font-size: 22px;
    padding-bottom: 12px;
  }

  .table-header .table-cell:not(.highlight-cell):not(.label-cell) {
    background: #ffffff;
    padding-top: 18px;
  }

  .table-header .table-cell:last-child:not(.highlight-cell) {
    border-radius: 0 32px 0 0;
    background: #ffffff;
    padding-top: 18px;
    padding-right: 20px;
  }

  .table-row:nth-child(2) .table-cell:first-child {
    border-radius: 32px 0 0 0;
  }

  .table-row:nth-child(2) .table-cell:last-child:not(.highlight-cell) {
    border-radius: 0 32px 0 0;
  }

  .table-header .highlight-cell {
    font-size: 20px;
    margin-top: -18px;
    padding-top: 32px !important;
    border-radius: 18px 18px 0 0;
  }

  .table-row:last-child .highlight-cell {
    margin-bottom: -18px;
    padding-bottom: 32px !important;
    border-radius: 0 0 18px 18px;
  }

  .highlight-cell {
    padding: 18px 16px !important;
  }

  .table-row:nth-child(2) .table-cell {
    padding-top: 18px;
  }

  .table-row:last-child .table-cell {
    padding-bottom: 18px;
  }

  .table-row:not(.table-header) .table-cell:first-child {
    padding-left: 20px;
  }

  .table-row:not(.table-header) .table-cell:last-child:not(.highlight-cell) {
    padding-right: 20px;
  }

  .table-row:last-child .table-cell:first-child {
    border-radius: 0 0 0 32px;
  }

  .table-row:last-child .table-cell:last-child:not(.highlight-cell) {
    border-radius: 0 0 32px 0;
  }

  .table-row:not(.table-header):not(:last-child) .highlight-cell::after {
    left: 12px;
    right: 12px;
  }

  .table-row:not(.table-header):not(:last-child)
    .table-cell:not(.highlight-cell)::after {
    left: 12px;
    right: 12px;
  }

  .icon-check,
  .icon-cross {
    width: 24px;
    height: 24px;
    stroke-width: 1.2;
    padding: 5px;
  }

  .carousel-track {
    gap: 24px;
    animation-duration: 20s;
  }

  .tech-logo {
    width: 100px;
    height: 65px;
    padding: 10px;
  }
}

/* ==============================================
   MOBILE COMPARISON TABLE
   Real <table> with sticky first column —
   guarantees every row is the same height
   across the label column and data columns.
   ============================================== */
.mob-table-wrap {
  display: none;
}

@media (max-width: 860px) {
  /* Hide desktop table */
  .comparison-table {
    display: none !important;
  }

  /* Scroll container — horizontal scroll only */
  .mob-table-wrap {
    display: block;
    width: 100%;
  }

  .mob-table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .mob-table-scroll::-webkit-scrollbar {
    display: none;
  }

  /* The table */
  .mob-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
    table-layout: auto;
  }

  /* ---- Header row (Clockwrk / Freelancers / Agency) ---- */
  .mob-th-label {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #f6f6f6; /* grey extends into header row */
    width: 46vw;
    max-width: 210px;
    min-width: 150px;
    padding: 20px 18px 14px;
    /* rounded top corners of the grey rectangle */
    border-radius: 20px 20px 0 0;
  }

  .mob-th-data {
    background: transparent; /* white page background shows */
    color: #0b0b0c;
    font-size: clamp(24px, 6vw, 30px);
    font-weight: 600;
    padding: 16px 18px;
    text-align: left;
    vertical-align: bottom;
    line-height: 1.1;
    width: 160px;
    min-width: 160px;
    white-space: nowrap;
  }

  /* Clockwrk header in lime */
  .mob-th-cw {
    color: #a0e92a;
  }

  /* ---- Sticky label column (grey) ---- */
  .mob-td-label {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #f6f6f6;
    width: 46vw;
    max-width: 210px;
    min-width: 150px;
    padding: 16px 18px;
    font-size: 14px;
    font-weight: 400;
    color: #333;
    text-align: left;
    vertical-align: middle;
    line-height: 1.4;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
  }

  /* First body row (Onboarding time): no border-top, text at bottom */
  .mob-table tbody tr:first-child .mob-td-label {
    border-top: none;
    vertical-align: bottom;
  }

  /* Last body row: rounded bottom corners on the grey rectangle */
  .mob-table tbody tr:last-child .mob-td-label {
    border-radius: 0;
    padding-bottom: 20px;
  }

  /* ---- Data cells (black) ---- */
  .mob-td-data {
    background: #121212;
    color: #ffffff;
    font-size: 14px;
    font-weight: 400;
    padding: 16px 18px;
    text-align: left;
    vertical-align: middle;
    line-height: 1.4;
    width: 160px;
    min-width: 160px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
  }

  /* First data row: no top border */
  .mob-table tbody tr:first-child .mob-td-data {
    border-top: none;
    vertical-align: bottom;
  }

  /* Vertical dividers between data columns */
  .mob-td-data + .mob-td-data {
    border-left: 1px solid rgba(255, 255, 255, 0.07);
  }

  /* Round top-left corner of the first data column, first row */
  .mob-table tbody tr:first-child .mob-td-data:first-child {
    border-top-left-radius: 20px;
  }

  /* Round top-right corner of last column, first row */
  .mob-table tbody tr:first-child .mob-td-data:last-child {
    border-top-right-radius: 20px;
  }

  /* Round bottom corners of last row */
  .mob-table tbody tr:last-child .mob-td-data:first-child {
    border-bottom-left-radius: 20px;
  }

  .mob-table tbody tr:last-child .mob-td-data:last-child {
    border-bottom-right-radius: 20px;
  }

  /* ---- Icons ---- */
  .mob-icon-check,
  .mob-icon-cross {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    padding: 6px;
    box-sizing: border-box;
    color: #2a2a2a;
    stroke-width: 2.5;
  }

  .mob-icon-check {
    background: #6ede45;
  }

  .mob-icon-cross {
    background: #fd6262;
  }
}

/* ---------------------------------------------------------
   Accessibility: Respect reduced motion preference
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    animation: none;
  }

  .carousel-track-wrap {
    overflow-x: auto;
    mask-image: none;
    -webkit-mask-image: none;
  }
}
