/* ============================================================
   DECOM — страница избранного (YITH Wishlist)
   Работает в паре с переопределённым шаблоном
   astra-child/woocommerce/wishlist-view.php (сетка карточек).
   Стили уведомлений и состояния "В корзине" — глобальные,
   живут в style.css темы.
   ============================================================ */

/* ---- Скрываем заголовок плагина и мобильный дубль ---- */
.wishlist-title-container,
.yith-wcwl-wishlist-title,
.wishlist-title {
    display: none !important;
}
ul.wishlist_table.mobile {
    display: none !important;
}

/* ============================================================
   Сетка карточек
   ============================================================ */
.decom-wl-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    font-family: 'Manrope', sans-serif;
}

.decom-wl-card {
    background: #FFFFFF;
    border: 1px solid #E5FAF3;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: box-shadow .2s, transform .2s;
}
.decom-wl-card:hover {
    box-shadow: 0 8px 28px rgba(23, 142, 121, 0.12);
    transform: translateY(-2px);
}

/* ---- Фото ---- */
.decom-wl-img {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.decom-wl-img a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.decom-wl-img img {
    max-width: 86%;
    max-height: 86%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ---- Крестик удаления на фото ---- */
.decom-wl-remove,
.decom-wl-card a.remove_from_wishlist {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E5FAF3;
    color: #1A1A1A;
    font-size: 18px;
    line-height: 32px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(26, 26, 26, 0.12);
    transition: all .2s;
    z-index: 2;
}
.decom-wl-remove:hover,
.decom-wl-card a.remove_from_wishlist:hover {
    background: #178E79;
    color: #FFFFFF;
}

/* ---- Бейдж наличия на фото ---- */
.decom-wl-stock {
    position: absolute;
    left: 12px;
    bottom: 12px;
    background: #FFFFFF;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 50px;
    padding: 5px 12px;
    box-shadow: 0 2px 8px rgba(26, 26, 26, 0.08);
    z-index: 2;
}
.decom-wl-stock.wishlist-in-stock {
    color: #00B981;
}
.decom-wl-stock.wishlist-in-stock::before {
    content: "●";
    font-size: 8px;
    vertical-align: 2px;
    margin-right: 5px;
}
.decom-wl-stock.wishlist-out-of-stock {
    color: #1A1A1A;
    opacity: .55;
}

/* ---- Инфо-часть карточки ---- */
.decom-wl-info {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.decom-wl-cat {
    font-size: 11.5px;
    color: #5a6b64;
    margin-bottom: 5px;
}
.decom-wl-name {
    font-size: 15px;
    font-weight: 700;
    color: #1A1A1A;
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 10px;
    transition: color .2s;
}
.decom-wl-name:hover {
    color: #178E79;
}
.decom-wl-price,
.decom-wl-price .amount,
.decom-wl-price .woocommerce-Price-amount {
    color: #178E79 !important;
    font-size: 17px;
    font-weight: 800;
}
.decom-wl-price {
    margin-top: auto;
    margin-bottom: 12px;
}

/* ---- Кнопка "В корзину" (выводит WooCommerce) ---- */
.decom-wl-cart .button,
.decom-wl-cart a.add_to_cart_button {
    display: block !important;
    width: 100% !important;
    background: #00B981 !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 11px !important;
    font-family: 'Manrope', sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-align: center !important;
    text-transform: none !important;
    line-height: 1.4 !important;
    transition: background .2s !important;
}
.decom-wl-cart .button:hover,
.decom-wl-cart a.add_to_cart_button:hover {
    background: #178E79 !important;
    color: #FFFFFF !important;
}

/* ---- Состояние "уже в корзине": только цвета.
   Текст меняет сервер (PHP-фильтр) или JS после клика.
   Селекторы специфичнее обычной кнопки выше, поэтому побеждают. ---- */
.decom-wl-cart a.add_to_cart_button.decom-in-cart,
.decom-wl-cart a.add_to_cart_button.added {
    background: #E5FAF3 !important;
    border: 1px solid #00B981 !important;
    color: #178E79 !important;
}
.decom-wl-cart a.add_to_cart_button.decom-in-cart:hover,
.decom-wl-cart a.add_to_cart_button.added:hover {
    background: #d3f2e6 !important;
}

/* Ссылка "Просмотреть корзину", появляющаяся после AJAX-добавления */
.decom-wl-cart a.added_to_cart {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #178E79;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---- Пустое избранное ---- */
.decom-wl-empty {
    text-align: center;
    padding: 64px 20px;
    background: #FFFFFF;
    border: 1px solid #E5FAF3;
    border-radius: 18px;
    color: #178E79;
    font-family: 'Manrope', sans-serif;
}
.decom-wl-empty p {
    margin: 14px 0 20px;
    font-size: 15px;
    font-weight: 600;
    color: #1A1A1A;
}
.decom-wl-empty-btn {
    display: inline-block;
    background: #00B981;
    color: #FFFFFF;
    border-radius: 50px;
    padding: 12px 30px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s;
}
.decom-wl-empty-btn:hover {
    background: #178E79;
    color: #FFFFFF;
}

/* ---- Пагинация (если товаров больше, чем per-page) ---- */
.decom-wl-pagination {
    margin-top: 22px;
    text-align: center;
    font-family: 'Manrope', sans-serif;
}
.decom-wl-pagination a,
.decom-wl-pagination span {
    display: inline-block;
    min-width: 34px;
    padding: 7px 10px;
    margin: 0 3px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    color: #178E79;
    background: #E5FAF3;
    text-decoration: none;
    transition: all .2s;
}
.decom-wl-pagination a:hover,
.decom-wl-pagination span.current {
    background: #178E79;
    color: #FFFFFF;
}

/* ============================================================
   Блок "Поделиться в:"
   ============================================================ */
.yith-wcwl-share {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 26px !important;
    padding: 22px 24px !important;
    background: #E5FAF3 !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
    font-family: 'Manrope', sans-serif !important;
}
.yith-wcwl-share .yith-wcwl-share-title {
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #1A1A1A !important;
    margin: 0 0 12px 0 !important;
}
.yith-wcwl-share ul {
    display: none !important;
}
.yith-wcwl-share .yith-wcwl-after-share-section {
    display: block !important;
    position: relative !important;
    max-width: 520px !important;
}
.yith-wcwl-share input.copy-target {
    display: block !important;
    width: 100% !important;
    background: #FFFFFF !important;
    border: 1px solid #00B981 !important;
    border-radius: 50px !important;
    padding: 11px 140px 11px 20px !important;
    font-family: 'Manrope', sans-serif !important;
    font-size: 13px !important;
    color: #1A1A1A !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: border-color .2s, box-shadow .2s !important;
}
.yith-wcwl-share input.copy-target:focus {
    border-color: #178E79 !important;
    box-shadow: 0 0 0 3px rgba(0, 185, 129, 0.15) !important;
}
/* Родной текст подсказки прячем, кликабельное слово превращаем
   в кнопку "Скопируйте" внутри поля */
.yith-wcwl-share .yith-wcwl-after-share-section small {
    position: absolute !important;
    top: 50% !important;
    right: 5px !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
}
.yith-wcwl-share .copy-trigger {
    display: inline-block !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    font-family: 'Manrope', sans-serif !important;
    text-transform: capitalize !important;
    color: #FFFFFF !important;
    background: #178E79 !important;
    border-radius: 50px !important;
    padding: 8px 20px !important;
    line-height: 1.4 !important;
    cursor: pointer !important;
    transition: background .2s !important;
}
.yith-wcwl-share .copy-trigger:hover {
    background: #00B981 !important;
}

/* ============================================================
   Адаптивность сетки
   ============================================================ */
@media (max-width: 1000px) {
    .decom-wl-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
    .decom-wl-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .decom-wl-info { padding: 12px 14px 14px; }
}
@media (max-width: 400px) {
    .decom-wl-grid { grid-template-columns: 1fr; }
}