/* ====================================================================
 * Offrir à un collaborateur — style premium aligné .psp
 * ================================================================== */

/* Lien discret sous le panier */
.psp__gift-row {
    margin-top: 14px;
    padding-top: 2px;
}

.psp__gift-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--psp-muted, #6e7480);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(15, 15, 15, 0.18);
    transition: color 280ms cubic-bezier(0.22, 1, 0.36, 1),
                text-decoration-color 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.psp__gift-link:hover {
    color: var(--psp-fg, #0b0b0b);
    text-decoration-color: rgba(15, 15, 15, 0.45);
}

.psp__gift-link-icon {
    font-size: 14px;
    line-height: 1;
    opacity: 0.85;
}

/* ------------------------------------------------------------------
 * Modal
 * ---------------------------------------------------------------- */
.psp-gift-modal {
    --psp-fg: #0b0b0b;
    --psp-muted: #6e7480;
    --psp-line: rgba(15, 15, 15, 0.08);
    --psp-line-strong: rgba(15, 15, 15, 0.14);
    --psp-bg: #ffffff;
    --psp-radius: 16px;

    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.psp-gift-modal[hidden] {
    display: none !important;
}

body.psp-gift-modal-open {
    overflow: hidden;
}

.psp-gift-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.psp-gift-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: min(90vh, 680px);
    display: flex;
    flex-direction: column;
    background: var(--psp-bg);
    border-radius: var(--psp-radius);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--psp-line);
    overflow: hidden;
}

.psp-gift-modal__head {
    flex-shrink: 0;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--psp-line);
}

.psp-gift-modal__toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 12px;
}

.psp-gift-modal__toolbar .psp-gift-modal__back {
    margin-right: auto;
}

.psp-gift-modal__back,
.psp-gift-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--psp-muted);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 200ms, color 200ms;
}

.psp-gift-modal__back svg,
.psp-gift-modal__close svg {
    width: 18px;
    height: 18px;
}

.psp-gift-modal__back:hover,
.psp-gift-modal__close:hover {
    color: var(--psp-fg);
    background: rgba(15, 15, 15, 0.05);
}

.psp-gift-modal__step {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--psp-muted);
}

.psp-gift-modal__title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--psp-fg);
}

.psp-gift-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 24px;
}

.psp-gift-modal__panel[hidden] {
    display: none !important;
}

/* Champs */
.psp-gift-field {
    display: block;
    margin-bottom: 20px;
}

.psp-gift-field__label,
.psp-gift-field legend.psp-gift-field__label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--psp-fg);
}

.psp-gift-field__input,
.psp-gift-field__textarea {
    width: 100%;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    color: var(--psp-fg);
    background: #fafafa;
    border: 1px solid var(--psp-line-strong);
    border-radius: 10px;
    outline: none;
    transition: border-color 200ms, box-shadow 200ms, background 200ms;
    box-sizing: border-box;
}

.psp-gift-field__textarea {
    resize: vertical;
    min-height: 80px;
}

.psp-gift-field--occasion-detail {
    margin-top: -4px;
}

.psp-gift-field__input:focus,
.psp-gift-field__textarea:focus {
    background: #fff;
    border-color: rgba(15, 15, 15, 0.28);
    box-shadow: 0 0 0 3px rgba(15, 15, 15, 0.06);
}

.psp-gift-field__hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--psp-muted);
}

/* Résultats recherche */
.psp-gift-results {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    border: 1px solid var(--psp-line);
    border-radius: 12px;
    overflow: hidden;
}

.psp-gift-results[hidden] {
    display: none !important;
}

.psp-gift-result {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 12px 14px;
    text-align: left;
    font-family: inherit;
    background: #fff;
    border: none;
    border-bottom: 1px solid var(--psp-line);
    cursor: pointer;
    transition: background 180ms;
}

.psp-gift-result:last-child {
    border-bottom: none;
}

.psp-gift-result:hover,
.psp-gift-result.is-selected {
    background: rgba(15, 15, 15, 0.04);
}

.psp-gift-result.is-selected {
    box-shadow: inset 3px 0 0 var(--psp-fg);
}

.psp-gift-result__name {
    font-size: 14px;
    font-weight: 500;
    color: var(--psp-fg);
}

.psp-gift-result__meta {
    font-size: 12px;
    color: var(--psp-muted);
}

.psp-gift-empty {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--psp-muted);
    text-align: center;
    padding: 16px;
}

/* Insights IA */
.psp-gift-insights {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.psp-gift-insights[hidden] {
    display: none !important;
}

.psp-gift-insight {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--psp-line);
}

.psp-gift-insight--size {
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.04) 0%, rgba(99, 102, 241, 0.06) 100%);
    border-color: rgba(99, 102, 241, 0.15);
}

.psp-gift-insight--duplicate {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.2);
}

.psp-gift-insight--size.is-warning {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.22);
}

.psp-gift-insight--size.is-warning .psp-gift-insight__label {
    color: #b45309;
}

.psp-gift-insight__label {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--psp-muted);
}

.psp-gift-insight--size .psp-gift-insight__label {
    color: #4338ca;
}

.psp-gift-insight--duplicate .psp-gift-insight__label {
    color: #b45309;
}

.psp-gift-insight__value {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--psp-fg);
    line-height: 1.1;
}

.psp-gift-insight__note {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--psp-muted);
}

/* Loading */
.psp-gift-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--psp-muted);
}

.psp-gift-loading[hidden] {
    display: none !important;
}

.psp-gift-loading__spinner {
    width: 20px;
    height: 20px;
    animation: psp-gift-spin 0.8s linear infinite;
}

@keyframes psp-gift-spin {
    to { transform: rotate(360deg); }
}

/* Chips occasion / livraison */
.psp-gift-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.psp-gift-chip {
    position: relative;
    cursor: pointer;
}

.psp-gift-chip input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.psp-gift-chip span {
    display: inline-block;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--psp-fg);
    background: #fafafa;
    border: 1px solid var(--psp-line-strong);
    border-radius: 999px;
    transition: background 180ms, border-color 180ms, box-shadow 180ms;
}

.psp-gift-chip input:checked + span {
    background: var(--psp-fg);
    color: #fff;
    border-color: var(--psp-fg);
}

.psp-gift-chips--delivery .psp-gift-chip span {
    border-radius: 10px;
}

/* Récap destinataire étape 2 */
.psp-gift-recipient {
    margin-bottom: 20px;
    padding: 12px 14px;
    background: #fafafa;
    border-radius: 10px;
    border: 1px solid var(--psp-line);
}

.psp-gift-recipient__name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--psp-fg);
}

.psp-gift-recipient__team {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--psp-muted);
}

/* Boutons */
.psp-gift-modal__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--psp-fg);
    background: #fff;
    border: 1px solid var(--psp-line-strong);
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 200ms, background 200ms, transform 120ms;
}

.psp-gift-modal__submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.psp-gift-modal__submit:not(:disabled):hover {
    background: rgba(15, 15, 15, 0.03);
}

.psp-gift-modal__submit--primary {
    color: #fff;
    background: var(--psp-fg);
    border-color: var(--psp-fg);
}

.psp-gift-modal__submit--primary:not(:disabled):hover {
    opacity: 0.88;
    background: var(--psp-fg);
}

.psp-gift-modal__submit.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.psp-gift-modal__error {
    margin: 0 0 12px;
    padding: 10px 12px;
    font-size: 13px;
    color: #b91c1c;
    background: rgba(185, 28, 28, 0.06);
    border-radius: 8px;
}

.psp-gift-modal__error[hidden] {
    display: none !important;
}

/* Avertissement options produit */
.psp-gift-notice {
    text-align: center;
    padding: 8px 4px 4px;
}

.psp-gift-notice__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    font-size: 26px;
    line-height: 1;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(254, 243, 199, 0.45));
    border: 1px solid rgba(124, 58, 237, 0.14);
}

.psp-gift-notice__title {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--psp-fg);
    letter-spacing: -0.02em;
}

.psp-gift-notice__text {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--psp-fg);
}

.psp-gift-notice__hint {
    margin: 0 0 20px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--psp-muted);
}

.psp-gift-notice .psp-gift-modal__submit {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
}

.psp-gift-notice__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}

.psp-gift-notice__secondary {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 10px auto 0;
    padding: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--psp-muted);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.psp-gift-notice__secondary:hover {
    color: var(--psp-fg);
}

@media (max-width: 480px) {
    .psp-gift-modal {
        padding: 0;
        align-items: flex-end;
    }

    .psp-gift-modal__dialog {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
    }
}
