/* Gift coupon (pcm_gift_coupon) - the choice on the page of a gift coupon product.
 * Sizes in rem of the theme (html { font-size: 10px }); works in RTL as is. */

.pcm-gc {
    margin: 0 0 3rem;
}

.sku__settings > .pcm-gc:last-child {
    margin-bottom: 0;
}

.pcm-gc__modes {
    display: flex;
    gap: 0.8rem;
    margin: 0 0 2rem;
}

.pcm-gc__mode {
    flex: 1 1 0;
    min-height: 4.4rem;
    padding: 0.8rem 1.6rem;
    border: 1px solid #e4ebf1;
    border-radius: 4px;
    background: #fff;
    color: #222;
    font: inherit;
    font-size: 1.5rem;
    line-height: 2rem;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.pcm-gc__mode:hover {
    border-color: var(--theme-primary-color, #7266F3);
}

.pcm-gc__mode.is-active {
    border-color: var(--theme-primary-color, #7266F3);
    background: var(--theme-primary-color, #7266F3);
    color: #fff;
}

.pcm-gc__mode:focus-visible {
    outline: 2px solid var(--theme-primary-color, #7266F3);
    outline-offset: 2px;
}

.pcm-gc__panel[hidden] {
    display: none !important;
}

.pcm-gc .ui-group {
    margin: 0;
}

/* The theme's error under a field (it pulls itself up with a negative margin
   and cuts long text) */
.pcm-gc .ui-error {
    margin: 0.6rem 0 0;
    white-space: normal;
}

.pcm-gc__search {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.pcm-gc__search > .ui-field {
    flex: 1 1 auto;
    min-width: 0;
}

.pcm-gc__find.ui-btn {
    flex: 0 0 auto;
    width: auto;
    padding-inline: 2rem;
}

.pcm-gc__help {
    margin: 0.6rem 0 0;
    font-size: 1.3rem;
    line-height: 1.8rem;
    color: #6c757d;
}

.pcm-gc__help.is-error,
.pcm-gc__error {
    color: #E92C2C;
}

.pcm-gc__result {
    margin-top: 1.2rem;
    transition: opacity 0.2s;
}

.pcm-gc__result:empty,
.pcm-gc__notice:empty {
    display: none;
}

.pcm-gc__result.is-stale {
    opacity: 0.45;
}

.pcm-gc__status,
.pcm-gc__error {
    margin: 0.6rem 0 0;
    font-size: 1.3rem;
    line-height: 1.8rem;
}

.pcm-gc__status {
    color: #6c757d;
}

.pcm-gc__card {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 1.2rem;
    border: 1px solid #e4ebf1;
    border-radius: 4px;
    background: #fff;
    color: #222;
    text-decoration: none;
    transition: border-color 0.2s;
}

.pcm-gc__card:hover,
.pcm-gc__card:focus {
    border-color: var(--theme-primary-color, #7266F3);
    color: #222;
    text-decoration: none;
}

.pcm-gc__thumb {
    flex: 0 0 6rem;
    width: 6rem;
    height: 6rem;
    object-fit: contain;
}

.pcm-gc__info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.pcm-gc__name {
    font-size: 1.4rem;
    line-height: 2rem;
    overflow-wrap: anywhere;
}

.pcm-gc__code {
    font-size: 1.2rem;
    line-height: 1.6rem;
    color: #6c757d;
}

.pcm-gc__price {
    flex: 0 0 auto;
    font-size: 1.6rem;
    line-height: 2rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Sent by e-mail: the switch and the recipient's fields */
.pcm-gc__send {
    margin-top: 2rem;
    padding-top: 1.8rem;
    border-top: 1px solid #e4ebf1;
}

.pcm-gc__switch {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 500;
    color: #222;
    cursor: pointer;
}

.pcm-gc__toggle {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    margin: 0;
    accent-color: var(--theme-primary-color, #7266F3);
    cursor: pointer;
}

.pcm-gc__recipient {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    margin-top: 1.4rem;
}

.pcm-gc__recipient[hidden] {
    display: none !important;
}

.pcm-gc__recipient > .pcm-gc__help {
    margin: 0 0 0.4rem;
}

.pcm-gc__recipient .ui-textarea {
    min-height: 9rem;
    resize: vertical;
}

.pcm-gc__counter {
    margin: -0.8rem 0 0;
    font-size: 1.2rem;
    line-height: 1.6rem;
    color: #6c757d;
    text-align: end;
}

.pcm-gc__counter.is-full {
    color: #E92C2C;
}

@media (min-width: 1200px) {
    /* One width for the switch, the fields and the product card (the theme
       caps option fields at 34.7rem). */
    .pcm-gc {
        max-width: 46rem;
    }

    .sku__settings .pcm-gc .ui-input,
    .sku__settings .pcm-gc .ui-textarea {
        max-width: none;
    }
}

@media (max-width: 575px) {
    .pcm-gc__card {
        flex-wrap: wrap;
    }

    .pcm-gc__price {
        flex-basis: 100%;
        text-align: end;
    }
}
