/* Keep Kenwood's form geometry; only the palette follows Cooking. */
.gift-attachment-page .text-page {
    padding: 0;
} 
.gift-attachment-page .text-page .content {
    max-width: 880px;
    margin: 0 auto;
    padding: 30px 24px;
}
.gift-attachment-page .gift-attachment__title {
    font-size: 16px;
    line-height: 30px;
    font-weight: 600;
}
.gift-attachment-page .gift-attachment__desc {
    font-size: 12px;
    line-height: 160%;
    padding-bottom: 14px;
}
.gift-attachment__label_descr {
    display: inline;
    margin-left: auto;
}
@media (min-width: 768px) {
    .gift-attachment-page .text-page .content {
        padding: 40px;
    }
    .gift-attachment-page .gift-attachment__title {
        font-size: 24px;
    }
    .gift-attachment-page .gift-attachment__desc {
        font-size: 14px;
        line-height: 24px;
        padding-bottom: 26px;
    }
}
@media (min-width: 1280px) {
    .gift-attachment-page .text-page .content {
        padding: 60px 0;
    }
}

/* gift-attachment */
.gift-attachment {
    display: flex;
    flex-direction: column;
    grid-gap: 25px;
    max-width: 500px;
    margin: 0 auto;
}

.gift-attachment .gift-attachment__title {
    color: var(--white, #fff) !important;
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
}

.gift-attachment .gift-attachment__desc {
    font-weight: 600 !important;
    color: var(--white, #fff) !important;
    text-align: center;
    margin-bottom: 0;
}

.gift-attachment .gift-attachment__label {
    font-size: 16px;
    font-weight: 600;
    color: var(--white, #fff);
    padding-left: 20px;
    margin-bottom: 10px;
}

.gift-attachment input,
.gift-attachment select {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: -0.3px;
    color: var(--white, #fff);
    width: 100%;
    background-color: var(--gray-1, #202020);
    padding: 16px 20px;
    border: none;
    border-radius: 40px;
}

.gift-attachment .gift-attachment__input-select {
    position: relative;
}

.gift-attachment .gift-attachment__input-select select {
    appearance: none;
    -webkit-appearance: none;
}

.gift-attachment .gift-attachment__input-select-arrow {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--orange-1, #ff8c00);
    border-bottom: 2px solid var(--orange-1, #ff8c00);
    transform: translateY(-50%) rotate(45deg);
    pointer-events: none;
    transition: transform 0.2s;
}

.gift-attachment .gift-attachment__input-select select:open + .gift-attachment__input-select-arrow {
    transform: translateY(-50%) rotate(-135deg);
}

.gift-attachment input[readonly] {
    background-color: var(--gray-2, #313131);
    color: var(--white-70, #ffffffb2);
    cursor: not-allowed;
}

.gift-attachment .gift-attachment__agreement {
    display: grid;
    align-items: flex-start;
    grid-template-columns: auto 1fr;
    grid-gap: 10px;
}

.gift-attachment .gift-attachment__agreement span {
    font-weight: 400;
    color: var(--white, #fff);
}

.gift-attachment .gift-attachment__button {
    font-size: 20px;
    line-height: 27px;
    font-weight: 700;
    color: var(--white, #fff);
    background-color: var(--orange-1, #ff8c00);
    border: none;
    border-radius: 50px;
    padding: 10px 0;
}

/* gift-attachment-popup */
.gift-attachment-popup {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
}

.gift-attachment-popup.gift-attachment-popup--open {
    display: block;
}

.gift-attachment-popup .gift-attachment-popup__backdrop {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 12px;
}

.gift-attachment-popup .gift-attachment-popup__inner {
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    background-color: var(--gray-1, #202020);
    border-radius: 6px;
    padding: 12px;
    overflow: auto;
}

.gift-attachment-popup .gift-attachment-popup__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.gift-attachment-popup .gift-attachment-popup__close {
    display: flex;
}

.gift-attachment-popup .gift-attachment-popup__content {
    font-weight: 600;
    color: var(--white, #fff);
    margin-bottom: 15px;
}

.gift-attachment-popup .gift-attachment-popup__content p + p {
    margin-top: 10px;
}

.gift-attachment-popup .gift-attachment-popup__bottom {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 10px;
}

.gift-attachment-popup .gift-attachment-popup__button {
    font-weight: 700;
    border-radius: 4px;
    padding: 15px 20px;
}

.gift-attachment-popup .gift-attachment-popup__button.gift-attachment-popup__button--agree {
    color: var(--white, #fff);
    background-color: var(--orange-1, #ff8c00);
    border: none;
}

.gift-attachment-popup .gift-attachment-popup__button.gift-attachment-popup__button--disagree {
    color: var(--white, #fff);
    background-color: var(--gray-1, #202020);
    border: 1px solid var(--white, #fff);
}

/* --- Кастомный выпадающий селект для продуктов --- */
.gift-attachment__select {
    position: relative;
    width: 100%;
    user-select: none;
}

.gift-attachment__select__selected {
    background: var(--gray-1, #202020);
    border: 2px solid var(--white-20, #ffffff4c);
    border-radius: 40px;
    padding: 16px 48px 16px 20px;
    font-size: 14px;
    color: var(--white, #fff);
    cursor: pointer;
    position: relative;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.gift-attachment__select__selected::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--orange-1, #ff8c00);
    border-bottom: 2px solid var(--orange-1, #ff8c00);
    transform: translateY(-50%) rotate(45deg);
    pointer-events: none;
    transition: transform 0.2s;
}

.gift-attachment__select.open .gift-attachment__select__selected::after {
    transform: translateY(-50%) rotate(-135deg);
}

.gift-attachment__select__dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 4px);
    width: 100%;
    background: var(--gray-1, #202020);
    border: 2px solid var(--white-20, #ffffff4c);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    z-index: 10;
    max-height: 260px;
    overflow-y: auto;
    animation: giftAttachmentFadeIn 0.2s;
}

.gift-attachment__select.open .gift-attachment__select__dropdown {
    display: block;
}

@keyframes giftAttachmentFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.orange-text {
    color: var(--orange-1, #ff8c00)!important;
}

.gift-attachment__input__product__item {
    display: grid;
    /* grid-template-columns: 40px minmax(0, 1fr) 70px 80px; */
    grid-template-columns: 40px minmax(0, 1fr) 70px;
    min-width: unset;
    width: 100%;
    margin: 0;
    background: var(--gray-2, #313131);
    padding: 10px 20px;
    gap: 10px;
    align-items: center;
    transition: border-color 0.2s, background 0.2s;
}

.gift-attachment__input__product__item__price {
    min-width: 0;
}

.gift-attachment__input__product__item img {
    width: 40px!important;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
    margin-bottom: 0;
    margin-right: 8px;
    display: block;
}

.gift-attachment__input__product__item span {
    margin-bottom: 0;
    font-size: 14px;
    color: var(--white, #fff);
    text-align: left;
    margin-right: 8px;
}

.gift-attachment__input__product__item.selected {
    border-color: var(--orange-1, #ff8c00);
    background: var(--orange-12, #ff8c001e);
}

.gift-attachment__input__product__item:hover {
    border-color: var(--orange-2, #d97700);
    background: var(--orange-12, #ff8c001e);
}

/* --- Всплывающее окно для сообщений --- */
.gift-attachment-message-popup {
    display: none;
    position: fixed;
    z-index: 1001;
    inset: 0;
    align-items: center;
    justify-content: center;
}

.gift-attachment-message-popup.open {
    display: flex;
}

.gift-attachment-message-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
}

.gift-attachment-message-popup__content {
    position: relative;
    background: var(--gray-1, #202020);
    border-radius: 16px;
    padding: 32px 24px 24px 24px;
    min-width: 280px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: giftAttachmentFadeIn 0.2s;
}

.gift-attachment-message-popup__content span {
    font-size: 18px;
    color: var(--white, #fff);
    margin-bottom: 18px;
    text-align: center;
    white-space: pre-line;
}

.gift-attachment-message-popup__close {
    background: var(--orange-1, #ff8c00);
    color: var(--white, #fff);
    border: none;
    border-radius: 8px;
    padding: 8px 24px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.gift-attachment-message-popup__close:hover {
    background: var(--orange-2, #d97700);
}

.gift-attachment__select__result .remove-product {
    border-radius: 4px;
    padding: 5px 10px;
    height: 30px;
    width: 30px;
    margin: 0 0 0 auto;
    background: var(--orange-1, #ff8c00);
    border: 1px solid var(--white-20, #ffffff4c);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white, #fff);
    cursor: pointer;
}
.gift-attachment__select__result .gift-attachment__input__product__item{
    background: var(--gray-1, #202020);
    border-radius: 40px;
    margin-bottom: 10px;
}

.gift-attachment-auth .title-grey {
    color: var(--white-70, #ffffffb2)!important;
    margin-bottom: 25px;
    text-align: center;
}
.gift-attachment__input__product__item .attachment__input__product__item__available {
    font-size: 12px;
    color: var(--green, #2c9e56);
}

.gift-attachment__input__product__item .attachment__input__product__item__not_available {
    font-size: 12px;
    color: var(--orange-1, #ff8c00);
}

.gift-attachment-page {
    color-scheme: dark;
}
.gift-attachment .gift-attachment__agreement input {
    width: auto;
    padding: 0;
    accent-color: var(--orange-1, #ff8c00);
}
.gift-attachment__agreement span,
.gift-attachment__button,
.gift-attachment-popup__close,
.gift-attachment-popup__button,
.gift-attachment__input__product__item {
    cursor: pointer;
}
.gift-attachment__button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.gift-attachment :focus-visible,
.gift-attachment-popup :focus-visible,
.gift-attachment-message-popup :focus-visible {
    outline: 2px solid var(--orange-1, #ff8c00);
    outline-offset: 3px;
}
body.gift-attachment-modal-open {
    overflow: hidden;
}
@media (max-width: 479px) {
    .gift-attachment__input__product__item {
        grid-template-columns: 40px minmax(0, 1fr) 70px;
        padding: 10px 14px;
    }
    .gift-attachment__input__product__item > span:last-child:not(.gift-attachment__input__product__item__price) {
        grid-column: 2 / -1;
    }
    .gift-attachment__select__result .gift-attachment__input__product__item {
        grid-template-columns: 40px minmax(0, 1fr) 30px;
    }
    .gift-attachment__select__result .gift-attachment__input__product__item__price {
        grid-column: 2;
    }
    .gift-attachment__input__product__item__button_wrapper {
        grid-column: 3;
        grid-row: 1 / 3;
    }
}
