/**
 * Wishlist Styles
 */

/* Кнопка "В список желаний" */
.wishlist-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.wishlist-btn:hover {
    border-color: #c62828;
    color: #c62828;
}

.wishlist-btn:hover .wishlist-btn__icon svg {
    fill: #c62828;
}

.wishlist-btn--active {
    border-color: #c62828;
    background: #fff5f5;
    color: #c62828;
}

.wishlist-btn--active .wishlist-btn__icon svg {
    fill: #c62828;
}

.wishlist-btn--loading {
    opacity: 0.7;
    pointer-events: none;
}

.wishlist-btn--loading .wishlist-btn__icon {
    animation: wishlist-pulse 1s infinite;
}

@keyframes wishlist-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.wishlist-btn__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.wishlist-btn__icon svg {
    width: 100%;
    height: 100%;
    fill: #999;
    transition: fill 0.2s ease;
}

.wishlist-btn__text {
    white-space: nowrap;
}

/* Компактная кнопка (только иконка) */
.wishlist-btn--compact {
    padding: 8px;
    border: none;
    background: transparent;
}

.wishlist-btn--compact .wishlist-btn__text {
    display: none;
}

.wishlist-btn--compact .wishlist-btn__icon {
    width: 24px;
    height: 24px;
}

/* Кнопка в карточке товара */
.product-item .wishlist-btn,
.catalog-element .wishlist-btn,
.catalog-element-purchase-order-buttons .wishlist-btn {
    margin-top: 12px;
    width: 100%;
}

/* Иконка в шапке */
.wishlist-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: inherit;
    text-decoration: none;
}

.wishlist-header__icon {
    width: 24px;
    height: 24px;
}

.wishlist-header__icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.wishlist-header__count {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #c62828;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
}

/* Уведомления */
.wishlist-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 10000;
    padding: 12px 24px;
    border-radius: 8px;
    background: #333;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s ease;
}

.wishlist-notification--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.wishlist-notification--success {
    background: #2e7d32;
}

.wishlist-notification--error {
    background: #c62828;
}

/* Страница вишлиста */
.wishlist-page {
    padding: 20px 0;
}

.wishlist-page__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.wishlist-page__title {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.wishlist-page__share {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wishlist-page__share-input {
    width: 300px;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    background: #f5f5f5;
}

.wishlist-page__share-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background: #1976d2;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wishlist-page__share-btn:hover {
    background: #1565c0;
}

.wishlist-page__comment {
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.wishlist-page__comment-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.wishlist-page__comment-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.wishlist-page__comment-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
}

.wishlist-page__comment-save {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background: #4caf50;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.wishlist-page__comment-save:hover {
    background: #43a047;
}

.wishlist-page__comment-save:disabled {
    background: #9e9e9e;
    cursor: not-allowed;
}

/* Заголовок списка с чекбоксом */
.wishlist-items__header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #f5f5f5;
    border-radius: 8px;
}

.wishlist-items__select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.wishlist-items__select-all input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Список товаров */
.wishlist-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wishlist-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.2s ease, opacity 0.3s ease;
}

.wishlist-item__checkbox {
    display: flex;
    align-items: center;
    padding-top: 40px;
}

.wishlist-item__checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.wishlist-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wishlist-item--paid {
    background: #e8f5e9;
    border-color: #a5d6a7;
}

.wishlist-item--gifted {
    background: #fff3e0;
    border-color: #ffcc80;
}

.wishlist-item__image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}

.wishlist-item__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wishlist-item__info {
    flex: 1;
    min-width: 0;
}

.wishlist-item__name {
    display: block;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    line-height: 1.3;
}

.wishlist-item__name:hover {
    color: #1976d2;
}

.wishlist-item__props {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wishlist-item__prop {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 14px;
}

.wishlist-item__prop-name {
    color: #888;
    min-width: 70px;
}

.wishlist-item__prop-value {
    color: #333;
    font-weight: 500;
}

.wishlist-item__price-block {
    flex-shrink: 0;
    text-align: right;
    min-width: 140px;
}

.wishlist-item__price-label {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}

.wishlist-item__price {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.wishlist-item__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.wishlist-item__status--paid {
    background: #c8e6c9;
    color: #2e7d32;
}

.wishlist-item__status--gifted {
    background: #ffe0b2;
    color: #e65100;
}

.wishlist-item__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
    flex-shrink: 0;
    min-width: 100px;
}

.wishlist-item__quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wishlist-item__quantity-label {
    font-size: 13px;
    color: #666;
}

.wishlist-item__quantity-input {
    width: 60px;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.wishlist-item__remove {
    padding: 10px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wishlist-item__remove:hover {
    border-color: #c62828;
    color: #c62828;
    background: #ffebee;
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .wishlist-item {
        flex-wrap: wrap;
        padding: 16px;
    }
    
    .wishlist-item__checkbox {
        padding-top: 0;
    }
    
    .wishlist-item__image {
        width: 80px;
        height: 80px;
    }
    
    .wishlist-item__info {
        flex-basis: calc(100% - 120px);
    }
    
    .wishlist-item__price-block {
        flex-basis: 100%;
        text-align: left;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #eee;
    }
    
    .wishlist-item__actions {
        flex-basis: 100%;
        flex-direction: row;
        justify-content: space-between;
        margin-top: 12px;
    }
}

/* Пустой вишлист */
.wishlist-empty {
    padding: 60px 20px;
    text-align: center;
}

.wishlist-empty__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    opacity: 0.3;
}

.wishlist-empty__icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.wishlist-empty__title {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 500;
    color: #333;
}

.wishlist-empty__text {
    margin: 0 0 24px;
    font-size: 14px;
    color: #666;
}

.wishlist-empty__link {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    background: #1976d2;
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.wishlist-empty__link:hover {
    background: #1565c0;
}

/* Страница списка желаний (общие стили) */
.wishlist-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Публичная страница */
.wishlist-public {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.wishlist-public .wishlist-items {
    max-width: 100%;
}

.wishlist-public .wishlist-item {
    padding: 20px 30px;
}

.wishlist-public__owner {
    margin-bottom: 16px;
    font-size: 16px;
    color: #666;
}

.wishlist-public__comment {
    margin-bottom: 24px;
    padding: 16px;
    border-left: 4px solid #1976d2;
    background: #e3f2fd;
    font-size: 15px;
    font-style: italic;
}

/* Кнопки действий на странице вишлиста */
.wishlist-page__actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

.wishlist-page__add-selected {
    padding: 14px 28px;
    border: none;
    border-radius: 4px;
    background: #c62828;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wishlist-page__add-selected:hover:not(:disabled) {
    background: #b71c1c;
}

.wishlist-page__add-selected:disabled {
    background: #9e9e9e;
    cursor: not-allowed;
}

.wishlist-public__actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

.wishlist-public__checkout {
    padding: 14px 28px;
    border: none;
    border-radius: 4px;
    background: #c62828;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wishlist-public__checkout:hover {
    background: #b71c1c;
}

.wishlist-public__checkout:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
}

/* Чекбокс для выбора товара */
.wishlist-item__select {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wishlist-item__checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Адаптивность */
@media (max-width: 768px) {
    .wishlist-page__header {
        flex-direction: column;
    }

    .wishlist-page__share {
        width: 100%;
        flex-direction: column;
    }

    .wishlist-page__share-input {
        width: 100%;
    }

    .wishlist-item {
        flex-wrap: wrap;
    }

    .wishlist-item__image {
        width: 80px;
        height: 80px;
    }

    .wishlist-item__actions {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #e0e0e0;
    }

    /* Мобильные стили для кнопки "Подарить выбранное" */
    .wishlist-public__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px;
        margin: 16px 0;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    .wishlist-public__checkout {
        padding: 14px 20px;
        border-radius: 8px;
        font-size: 15px;
        background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    }

    .wishlist-public__summary {
        text-align: center;
        font-size: 14px;
        color: #666;
    }

    .wishlist-public {
        padding: 0 16px;
    }
}
