/*
 * Cómo se cobra un precio extra (Layout::parts.extra-unidad).
 *
 * Pastilla con icono bajo el nombre del extra —«Por persona», «Por día»…— y
 * un pop que lo explica. Sin JS: se abre con :hover en PC y con :focus al
 * tocarla en el teléfono (lleva tabindex). El pop se ancla a la izquierda
 * porque la pastilla siempre va pegada al borde izquierdo del formulario:
 * centrado se saldría de la pantalla en el móvil.
 */
.rc-unidad {
    position: relative;
    display: flex;
    width: max-content;
    max-width: calc(100% - 24px);
    align-items: center;
    gap: 5px;
    margin: 6px 0 0 24px;
    padding: 3px 8px 3px 7px;
    border-radius: var(--rc-r-pill, 999px);
    background: rgb(var(--rc-primary, 81 145 250) / .09);
    color: rgb(var(--rc-primary, 81 145 250));
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .01em;
    white-space: nowrap;
    cursor: help;
    outline: none;
    transition: background var(--rc-t-fast, .15s) ease;
    -webkit-tap-highlight-color: transparent;
}
.rc-unidad:hover,
.rc-unidad:focus-visible,
.rc-unidad:focus {
    background: rgb(var(--rc-primary, 81 145 250) / .16);
}
.rc-unidad:focus-visible {
    box-shadow: 0 0 0 2px rgb(var(--rc-primary, 81 145 250) / .45);
}
.rc-unidad svg {
    width: 13px;
    height: 13px;
    flex: none;
    fill: currentColor;
}
.rc-unidad .rc-unidad__i {
    width: 12px;
    height: 12px;
    opacity: .55;
}

.rc-unidad__pop {
    position: absolute;
    left: -4px;
    bottom: calc(100% + 9px);
    z-index: 30;
    width: max-content;
    max-width: min(240px, 72vw);
    padding: 8px 11px;
    border-radius: 10px;
    background: #1f2430;
    color: #fff;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0;
    white-space: normal;
    text-align: left;
    box-shadow: 0 8px 24px rgb(15 20 30 / .22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
    pointer-events: none;
}
.rc-unidad__pop::after {
    content: "";
    position: absolute;
    left: 16px;
    top: 100%;
    border: 6px solid transparent;
    border-top-color: #1f2430;
}
.rc-unidad:hover .rc-unidad__pop,
.rc-unidad:focus .rc-unidad__pop {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .15s ease, transform .15s ease, visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
    .rc-unidad__pop { transition: none; transform: none; }
}
