/* EV charger package comparison table on /ev-charger-installation-cost.
   Desktop: a wrapping data table. Narrow screens: each package becomes a
   stacked card with labelled values, so no column hides behind a swipe. */

.ev-packages__table-wrapper {
  margin: var(--spacing-lg) 0 var(--spacing-xl);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  overflow-x: auto;
}

.ev-packages__table-wrapper:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.ev-packages__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.ev-packages__caption {
  padding: var(--spacing-md);
  text-align: left;
  font-weight: 600;
  color: var(--color-text);
}

.ev-packages__table thead th {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-secondary);
  color: var(--color-text-white);
  text-align: left;
  font-weight: 600;
  vertical-align: bottom;
}

.ev-packages__row {
  border-top: 1px solid var(--color-border);
}

.ev-packages__row:nth-child(even) {
  background: var(--color-background-light);
}

.ev-packages__cell {
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--color-text-light);
  text-align: left;
  vertical-align: top;
}

.ev-packages__cell--package {
  font-weight: 600;
  color: var(--color-text);
}

.ev-packages__cell--price {
  font-weight: 600;
  color: var(--color-text);
}

.ev-packages__seller,
.ev-packages__source {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

@media (max-width: 768px) {
  .ev-packages__table-wrapper {
    overflow-x: visible;
    border: 0;
    background: transparent;
  }

  .ev-packages__table,
  .ev-packages__table tbody,
  .ev-packages__row,
  .ev-packages__cell,
  .ev-packages__caption {
    display: block;
    width: 100%;
  }

  .ev-packages__caption {
    padding: 0 0 var(--spacing-sm);
  }

  .ev-packages__table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .ev-packages__row {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
  }

  .ev-packages__row:nth-child(even) {
    background: var(--color-surface);
  }

  .ev-packages__cell {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
  }

  .ev-packages__cell::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text);
  }
}

/* Inline links in the EV handoff asides (directory, profile, tariff results)
   must not rely on colour alone (WCAG 1.4.1). */
.ev-charging-links__link,
.ev-package-journey__link {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
