/* =========================================================================
 * CWF — Wishlist Cards (Grid Layout)
 * Красивый адаптивный вывод избранных товаров
 * ========================================================================= */

.cwf-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
}

/* === Карточка товара === */
.cwf-wishlist-card {
    position: relative;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    text-align: left;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    /* Используем Flexbox для внутреннего содержимого, чтобы footer был прижат книзу */
    display: flex;
    flex-direction: column;
}

.cwf-wishlist-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

/* === Кнопка удаления === */
.cwf-wishlist-card .cwf-remove-item {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    z-index: 5;
    transition: color 0.2s ease;
  border-radius: 30px;
  box-shadow: none;
}

.cwf-wishlist-card .cwf-remove-item:hover {
    color: #ff4757;
  border-radius: 30px;
  box-shadow: none;
}

/* === Картинка === */
.wishlist-thumb {
    display: block;
    margin-bottom: 10px;
}

.wishlist-thumb img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* === Название === */
.wishlist-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
    color: #333;
    text-decoration: none;
    min-height: 3em;
    flex-grow: 1; /* Позволяет названию занять доступное место */
}

.wishlist-title:hover {
    color: #00a63f;
}

/* =========================================================================
 * НОВЫЙ ФУТЕР: Располагает цену и кнопку горизонтально
 * ========================================================================= */
.cwf-card-footer {
    display: flex;
    justify-content: space-between; /* Раскидывает цену и кнопку по краям */
    align-items: center; /* Выравнивает по центру вертикально */
    margin-top: auto; /* Прижимает футер к нижней части карточки */
}

/* === Цена === */
.wishlist-price {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 0; /* Убираем нижний отступ, он больше не нужен */
    margin-right: 10px; /* Добавляем отступ от кнопки */
}

/* === Действия (контейнер кнопки) === */
.wishlist-actions {
    display: flex;
    justify-content: flex-end; /* Кнопка прижимается к правой стороне */
    align-items: center;
}

/* =========================================================================
 * Кнопка "В корзину" — идентична каталогу (FIXED)
 * ========================================================================= */

.cwf-wishlist-card .icon-cart-only {
    position: relative;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border-radius: 100px;
    background: #F2F3F5 !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background-color 0.2s ease;
    /* Скрытие текста */
    font-size: 0 !important;
    line-height: 0 !important;
    text-indent: -9999px !important;
    overflow: hidden !important;
}

/* Hover */
.cwf-wishlist-card .icon-cart-only:hover {
    background: #00CF4F !important;
}

/* Иконка корзины */
.cwf-wishlist-card .icon-cart-only::before {
    content: '';
    position: absolute;
    top: 48%;
    left: 48%;
    transform: translate(-50%, -50%);
    display: block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333333'>\
<path d='M12.7 5.2c-1.7 0-3.1 1.4-3.1 3.1v1.1H8.3c-1.1 0-1.8.7-1.9 1.8l-.6 8.3c-.1 1.2.7 2 2 2h9.8c1.3 0 2.1-.8 2-2l-.7-8.3c-.1-1.1-.8-1.8-1.9-1.8h-1.3V8.3c0-1.7-1.4-3.1-3.1-3.1zm0 1.3c1 0 1.8.8 1.8 1.8v1.1h-3.6V8.3c0-1 .8-1.8 1.8-1.8z'/>\
</svg>");
}

/* Hover — белая корзина */
.cwf-wishlist-card .icon-cart-only:hover::before {
    background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'>\
<path d='M12.7 5.2c-1.7 0-3.1 1.4-3.1 3.1v1.1H8.3c-1.1 0-1.8.7-1.9 1.8l-.6 8.3c-.1 1.2.7 2 2 2h9.8c1.3 0 2.1-.8 2-2l-.7-8.3c-.1-1.1-.8-1.8-1.9-1.8h-1.3V8.3c0-1.7-1.4-3.1-3.1-3.1zm0 1.3c1 0 1.8.8 1.8 1.8v1.1h-3.6V8.3c0-1 .8-1.8 1.8-1.8z'/>\
</svg>");
}

/* Добавлено в корзину */
.cwf-wishlist-card .icon-cart-only.added {
    background: #D6F3D2 !important;
}

/* Галочка */
.cwf-wishlist-card .icon-cart-only.added::before {
    background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2316B900' stroke-width='2.5'>\
<path stroke-linecap='round' stroke-linejoin='round' d='M5 13l4 4L19 7'/>\
</svg>");
}

/* Скрываем "Просмотр корзины" */
.cwf-wishlist-card .icon-cart-only + .added_to_cart {
    display: none !important;
}

/* =========================================================================
 * Адаптив
 * ========================================================================= */

@media (max-width: 1024px) {
    .cwf-wishlist-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .cwf-wishlist-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 340px) {
    .cwf-wishlist-grid {
        grid-template-columns: 1fr;
    }
}

/* Контейнер нижнего ряда на странице избранного */
.cwf-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 8px;
    gap: 10px;
}

/* Левая колонка: Цена + 1 клик */
.cwf-card-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.cwf-card-left .wishlist-price {
    font-size: 1rem;
    font-weight: 600;
  	margin-bottom: -12px;
}

.cwf-card-left .wishlist-one-click a {
    font-size: 13px;
    color: #333;
    border-bottom: 1px dashed #333;
    cursor: pointer;
}

.cwf-card-left .wishlist-one-click a:hover {
    color: #008c44;
    text-decoration: none;
}

/* Правая колонка: Корзина + Удалить */
.wishlist-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Скрываем надпись "Просмотреть корзину" рядом с кнопкой */
.wishlist-actions .added_to_cart {
    display: none !important;
}

@media (max-width: 768px) {
    .cwf-card-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}
}