/* Product pickers: the card grid on the comparison selection screen and the row
 * list on the coverage step of the subscribe flow.
 *
 * Both were built with literal Tailwind neutrals (bg-white / dark:bg-gray-800,
 * border-gray-200, text-gray-900, and a blue selected state). Those grays never
 * pick up the sponsor's hue, so the pickers read as foreign panels sitting on the
 * tinted surface every other screen uses — the same problem DESIGN.md's
 * Tinted-Neutral Rule describes, and the reason component.css was moved to tokens.
 *
 * Colours here come from the theme tokens, so one rule covers light and dark and
 * the selected state uses the sponsor's primary instead of a fixed blue.
 */

/* ---- Shared ----------------------------------------------------------- */

/* The native control picks up the sponsor colour instead of the browser blue. */
.product-choice-input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--color-primary);
    flex-shrink: 0;
}

.product-choice-link {
    color: color-mix(in srgb, var(--color-primary) 55%, var(--text));
    text-decoration: none;
}

/* Field label and the "Comparar Productos" link on one baseline. The link used to
   render above the label at the body size (16px) against a 12px label, so it read
   as the heading of the section instead of a secondary action. Both land at 13px:
   the label a shade larger than the app default, the link a good deal smaller. */
.product-choice-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.product-choice-header .auth-shell__label {
    margin-bottom: 0;
    font-size: 13px;
}

.product-choice-header__link {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.product-choice-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* ---- Card grid (comparison selection) --------------------------------- */

.product-choice-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 768px) {
    .product-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .product-choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.product-choice-card {
    position: relative;
    padding: 1.25rem;
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.product-choice-card:hover {
    background-color: var(--surface-strong);
    border-color: var(--line-strong);
}

.product-choice-card--selected {
    background-color: color-mix(in srgb, var(--color-primary) 12%, transparent);
    border-color: color-mix(in srgb, var(--color-primary) 55%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 45%, transparent);
}

.product-choice-card__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.product-choice-card__title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text);
}

.product-choice-card__price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    color: var(--text);
}

.product-choice-card__amount {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

.product-choice-card__interval {
    font-size: 1rem;
    color: var(--muted);
}

/* ---- Row list (coverage step) ----------------------------------------- */

.product-choice-list {
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    overflow: hidden;
}

.product-choice-list__item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--line);
    transition: background-color 0.15s, box-shadow 0.15s;
}

.product-choice-list__item:last-child {
    border-bottom: none;
}

.product-choice-list__item:hover {
    background-color: var(--surface);
}

/* An inset bar rather than a border, so the selected row does not shift by a
   pixel relative to its neighbours. */
.product-choice-list__item--selected {
    background-color: color-mix(in srgb, var(--color-primary) 12%, transparent);
    box-shadow: inset 3px 0 0 var(--color-primary);
}

.product-choice-list__item--selected:hover {
    background-color: color-mix(in srgb, var(--color-primary) 16%, transparent);
}

.product-choice-list__body {
    flex: 1 1 auto;
    min-width: 0;
}

.product-choice-list__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.product-choice-list__identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.product-choice-list__name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
}

.product-choice-list__pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    white-space: nowrap;
}

.product-choice-list__amount {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}

.product-choice-list__interval,
.product-choice-list__description {
    font-size: 0.875rem;
    color: var(--muted);
}

.product-choice-list__description:not(:empty) {
    margin-top: 0.25rem;
}

/* ---------------------------------------------------------------------------
   Optional coverage (addon) cards — the "Cubiertas Opcionales" step of the
   subscribe flow, rendered by form/select_addon.fields.html.twig.

   Same choice-card pattern as the product list above, and for the same reason:
   the template used to paint each card with bg-white / dark:bg-gray-800 and a
   blue selected state, which put a cold blue-grey box on a frame mixed from the
   sponsor's brand. Only visible once a product actually carries an addon.
   LAR-443.
   --------------------------------------------------------------------------- */
.addon-choice-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.addon-choice-card {
    display: block;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.addon-choice-card:hover {
    background: var(--surface-strong);
    border-color: var(--line-strong);
}

.addon-choice-card--selected {
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    border-color: color-mix(in srgb, var(--color-primary) 42%, transparent);
    box-shadow: inset 3px 0 0 var(--color-primary);
}

.addon-choice-card--selected:hover {
    background: color-mix(in srgb, var(--color-primary) 16%, transparent);
}

.addon-choice-card__name {
    font-weight: 600;
    color: var(--text);
}

.addon-choice-card__help,
.addon-choice-card__interval {
    color: var(--text-soft);
}

.addon-choice-card__price {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}
