/* ===== PRODUCT COMPARISON PAGE ===== */

.comparison-section {
  padding: 60px 0 80px;
}

.comparison-intro {
  text-align: center;
  max-width: 1000px;
  margin: 0 auto 40px;
}

/* Scroll hint for mobile */
.scroll-hint {
  display: none;
  text-align: center;
  color: var(--color-text-light);
  font-size: 1.3rem;
  margin-bottom: 16px;
  padding: 8px;
  background: #f5f5f5;
  border-radius: 8px;
}

.scroll-hint svg {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  animation: swipeHint 1.5s ease-in-out infinite;
}

@keyframes swipeHint {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}

/* ===== HEADER / PRODUCT SELECTORS ===== */
.compare-header-row {
  display: grid;
  grid-template-columns: 30% repeat(3, 1fr);
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 24px;
  margin-bottom: 0;
}

.compare-label-col {
  display: flex;
  align-items: flex-end;
  background: var(--color-white);
  position: sticky;
  left: 0;
  z-index: 10;
}

.compare-col {
  text-align: center;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.compare-col-cat {
  color: var(--color-text-light);
  margin-top: 2px;
}

.compare-col-select {
  position: relative;
  width: 100%;
  max-width: 280px;
}

/* ===== CUSTOM DROPDOWN STYLES ===== */
.custom-dropdown {
  position: relative;
  width: 100%;
  max-width: 280px;
}

.custom-dropdown-selected {
  width: 100%;
  padding: 5px 35px 5px 5px;
  border: none;
  border-radius: 24px;
  font-family: var(--font-family);
  font-size: 2.5rem !important;
  font-weight: 700;
  line-height: 1 !important;
  color: var(--color-dark);
  background: var(--color-white);
  cursor: pointer;
  transition: border-color 0.3s ease;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  user-select: none;
}

.custom-dropdown-selected:hover {
  background: #f8f8f8;
}

.custom-dropdown-selected .selected-text {
  flex: 1;
  text-align: center;
}

.custom-dropdown-selected .select-arrow {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-light);
}

.custom-dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--color-white);
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  width: 350px;
}

.custom-dropdown-group-label {
  padding: 8px 12px;
  font-weight: 700;
  font-size: 1.5rem;
  color: #000;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  cursor: default;
  text-align: left;
}

.custom-dropdown-group-label:first-child {
  border-top: none;
}

.custom-dropdown-option {
  padding: 1px 12px 1px 32px;
  font-size: 1.5rem;
  font-weight: 400;
  color: #333;
  cursor: pointer;
  transition: background-color 0.1s ease;
  text-align: left;
}

.custom-dropdown-option:hover {
  background: #f5f5f5;
}

.custom-dropdown-option.selected {
  background: #0066cc;
  color: #fff;
}

.custom-dropdown-option:first-child {
  padding-left: 12px;
  font-weight: 400;
  color: #666;
  text-align: center;
}

/* Scrollbar styling for dropdown */
.custom-dropdown-options::-webkit-scrollbar {
  width: 12px;
}

.custom-dropdown-options::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 0 4px 4px 0;
}

.custom-dropdown-options::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 6px;
}

.custom-dropdown-options::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Old select dropdown styles (keeping for reference) */
.compare-dropdown {
  width: 100%;
  padding: 5px 35px 5px 5px;
  border: none;
  border-radius: 24px;
  font-family: var(--font-family);
  font-size: 2.5rem !important;
  font-weight: 700;
  line-height: 1 !important;
  color: var(--color-dark);
  background: var(--color-white);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.3s ease;
  text-align: left;
  text-align-last: center;
  margin-left: 10px;
}

.compare-dropdown:focus {
  outline: none;
}

.compare-dropdown option,
.compare-dropdown optgroup {
  text-align: left;
  font-size: 1.5rem;
  font-weight: 400;
}

.compare-dropdown optgroup {
  font-weight: 700;
}

.select-arrow {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--color-text-light);
}

/* ===== COMPARISON TABLE ===== */

.compare-prop-cell {
  padding: 16px 12px;
  width: 30%;
  min-width: 30%;
  vertical-align: middle;
  background: var(--color-white);
  position: sticky;
  left: 0;
  z-index: 5;
}

.prop-cell-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prop-cell-inner .prop-name {
  flex: 1;
}

.prop-cell-inner .prop-tooltip {
  flex-shrink: 0;
}

.compare-row td {
  display: table-cell;
  padding: 16px 12px;
  vertical-align: middle;
  text-align: center;
  color: var(--color-dark);
}

.compare-row td:first-child {
  text-align: left;
}

.prop-name {
  font-weight: 600;
  color: var(--color-dark);
  line-height: 1.3;
}

/* ===== TOOLTIP ===== */
.prop-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-light);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.prop-tooltip-content {
  display: none;
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 8px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.6;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.prop-tooltip:hover .prop-tooltip-content,
.prop-tooltip:focus .prop-tooltip-content {
  display: block;
}

/* ===== TABLE LAYOUT ===== */
.compare-table {
  display: table;
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  background: var(--color-white);
}

.compare-table tbody {
  display: table-row-group;
}

.compare-row {
  display: table-row;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s ease;
}

.compare-row:nth-child(even) {
  background: #fafafa;
}

.compare-row:nth-child(even) .compare-prop-cell {
  background: #fafafa;
}

.compare-row:hover {
  background: #f5f5f5;
}

.compare-row:hover .compare-prop-cell {
  background: #f5f5f5;
}

.compare-val-cell {
  width: calc((100% - 200px) / 3);
  font-weight: 500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .compare-header-row {
    grid-template-columns: 30% repeat(3, 1fr);
  }

  .compare-prop-cell {
    width: 30%;
    min-width: 160px;
  }

  .compare-dropdown {
    font-size: 2.2rem !important;
  }

  .custom-dropdown-selected {
    font-size: 2.2rem !important;
  }

  .custom-dropdown-group-label {
    font-size: 1.4rem;
    padding: 7px 10px;
  }

  .custom-dropdown-option {
    font-size: 1.4rem;
    padding: 7px 10px 7px 28px;
  }

  .custom-dropdown-option:first-child {
    padding-left: 10px;
  }
}

@media (max-width: 768px) {
  .comparison-section {
    padding: 40px 0 60px;
  }

  /* Wrapper for horizontal scroll - header and table together */
  .comparison-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -20px;
    padding: 0;
  }

  /* Add padding to inner content instead */
  .compare-header-row,
  .compare-table {
    padding-left: 5px;
    padding-right: 20px;
  }

  .compare-header-row {
    grid-template-columns: 30% repeat(3, 1fr);
    min-width: 700px;
  }

  .compare-label-col {
    width: 30%;
    min-width: 140px;
    position: sticky;
    left: 0;
  }

  .compare-table {
    min-width: 700px;
  }

  .compare-prop-cell {
    width: 30%;
    min-width: 140px;
    padding: 12px 8px;
    position: sticky;
    left: 0;
  }

  .compare-dropdown {
    font-size: 1.8rem !important;
    padding: 4px 30px 4px 4px;
  }

  .custom-dropdown-selected {
    font-size: 1.8rem !important;
    padding: 4px 30px 4px 4px;
  }

  .custom-dropdown-option:first-child {
    padding-left: 10px;
  }

  .select-arrow {
    right: 4px;
  }

}

@media (max-width: 700px) {
/* Show scroll hint on mobile */
  .scroll-hint {
    display: block;
  }
}

@media (max-width: 480px) {
  .comparison-section {
    padding: 30px 0 50px;
  }

  /* Wrapper for horizontal scroll - header and table together */
  .comparison-table-wrapper {
    margin: 0 -20px;
    padding: 0;
  }

  /* Add padding to inner content instead */
  .compare-header-row,
  .compare-table {
    padding-left: 5px;
    padding-right: 20px;
  }

  .compare-header-row {
    grid-template-columns: 30% repeat(3, 1fr);
    min-width: 600px;
    padding-bottom: 16px;
  }

  .compare-label-col {
    width: 30%;
    min-width: 120px;
    position: sticky;
    left: 0;
  }

  .compare-table {
    min-width: 600px;
  }

  .compare-prop-cell {
    width: 30%;
    min-width: 120px;
    padding: 10px 6px;
    position: sticky;
    left: 0;
  }

  .compare-col {
    padding: 0 8px;
  }

  .compare-dropdown {
    font-size: 1.5rem !important;
    padding: 3px 25px 3px 3px;
  }

  .custom-dropdown-selected {
    font-size: 1.5rem !important;
    padding: 3px 25px 3px 3px;
  }

  .custom-dropdown-group-label {
    font-size: 1.4rem;
    padding: 5px 8px;
  }

  .custom-dropdown-option {
    font-size: 1.4rem;
    padding: 5px 8px 5px 20px;
  }

  .custom-dropdown-option:first-child {
    padding-left: 8px;
  }

  .select-arrow {
    width: 16px;
    height: 16px;
    right: 3px;
  }

  .prop-name {
    font-size: 1.4rem;
  }

  .compare-col-cat{
    font-size: 1.4rem;
  }

  .compare-row td {
    font-size: 1.4rem;
    padding: 10px 6px;
  }

  .prop-tooltip {
    width: 18px;
    height: 18px;
  }

  .prop-tooltip svg {
    width: 14px;
    height: 14px;
  }

  .prop-tooltip-content {
    font-size: 1.1rem;
    padding: 8px 10px;
    min-width: 180px;
    max-width: 260px;
  }
}
