/* ==========================================================================
   1. ОСНОВНОЙ КОНТЕЙНЕР И ЗАГОЛОВОК
   ========================================================================== */
.wf-container-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
}

.wishlist-title-container {
    margin-bottom: 30px;
}

.wishlist-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

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

/* Кнопка редактирования названия */
.show-title-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.show-title-form:hover {
    color: #000;
}

.yith-wcwl-icon-svg {
    width: 18px;
    height: 18px;
}

/* Форма редактирования (скрытая по умолчанию) */
.hidden-title-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.hidden-title-form input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    width: 100%;
    max-width: 300px;
}

.edit-title-buttons {
    display: flex;
    gap: 5px;
}

.edit-title-buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
    transition: background 0.2s;
}

.edit-title-buttons .save-title-form:hover {
    background: #e6f4ea;
    color: #137333;
}

.edit-title-buttons .hide-title-form:hover {
    background: #fce8e6;
    color: #c5221f;
}

/* ==========================================================================
   2. ДЕСКТОПНАЯ ВЕРСИЯ ТАБЛИЦЫ (от 769px и выше)
   ========================================================================== */
.wishlist_table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    text-align: left;
}

.wishlist_table th {
    background-color: #f9f9f9;
    padding: 14px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    color: #555;
    border-bottom: 2px solid #eee;
}

.wishlist_table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

/* Изображение товара */
.product-thumbnail img {
    max-width: 80px;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* Название товара */
.product-name a {
    color: #222;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
}

.product-name a:hover {
    color: #b969dd; /* Брендовый цвет темы */
}

/* Цены */
.product-price del {
    color: #999;
    font-size: 14px;
    margin-right: 5px;
}

.product-price ins {
    text-decoration: none;
    font-weight: 600;
    color: #e14d43; /* Цвет акционной цены */
}

.product-price .amount {
    font-weight: 600;
}

/* Статус наличия */
.wishlist-in-stock {
    color: #2e7d32;
    font-weight: 500;
    font-size: 14px;
}

.wishlist-out-of-stock {
    color: #c62828;
    font-weight: 500;
    font-size: 14px;
}

/* Кнопка удаления (крестик) */
.wishlist_table .remove_from_wishlist {
    font-size: 22px;
    color: #bbb;
    text-decoration: none;
    transition: color 0.2s;
}

.wishlist_table .remove_from_wishlist:hover {
    color: #e14d43;
}

/* Кнопка "Додати в кошик" */
.wishlist_table .add_to_cart_button {
    display: inline-block;
    background-color: #222;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    text-align: center;
    white-space: nowrap;
    transition: background-color 0.2s, transform 0.1s;
}

.wishlist_table .add_to_cart_button:hover {
    background-color: #444;
}

.wishlist_table .add_to_cart_button:active {
    transform: scale(0.98);
}


/* ==========================================================================
   3. АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ (до 768px)
   ========================================================================== */
@media screen and (max-width: 768px) {
    
    /* Скрываем заголовки таблицы */
    .wishlist_table theorems, 
    .wishlist_table thead {
        display: none;
    }
    
    /* Превращаем таблицу и строки в блочные элементы (карточки) */
    .wishlist_table, 
    .wishlist_table tbody, 
    .wishlist_table tr {
        display: block;
        width: 100%;
    }
    
    /* Стилизация отдельной карточки товара */
    .wishlist_table tr {
        position: relative;
        padding: 20px 15px 15px 15px;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 20px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
        
        /* Создаем сетку для выстраивания элементов внутри карточки */
        display: grid;
        grid-template-columns: 90px 1fr;
        gap: 10px 15px;
        align-items: center;
    }
    
    /* Кнопка удаления (абсолютное позиционирование в верхний правый угол карточки) */
    .wishlist_table td.product-remove {
        position: absolute;
        top: 5px;
        right: 10px;
        padding: 0;
        border: none;
        z-index: 10;
    }
    
    /* Картинка занимает первую колонку grid и растягивается на 3 строки */
    .wishlist_table td.product-thumbnail {
        grid-column: 1;
        grid-row: 1 / span 3;
        padding: 0;
        border: none;
    }
    
    .product-thumbnail img {
        max-width: 100%;
        width: 90px;
        height: auto;
    }
    
    /* Название, цена и статус занимают вторую колонку */
    .wishlist_table td.product-name,
    .wishlist_table td.product-price,
    .wishlist_table td.product-stock-status {
        grid-column: 2;
        padding: 0;
        border: none;
        display: block;
    }
    
    .wishlist_table td.product-name {
        padding-right: 20px; /* Чтобы название не наезжало на крестик удаления */
    }
    
    /* Кнопка добавления в корзину занимает всю ширину внизу карточки */
    .wishlist_table td.product-add-to-cart {
        grid-column: 1 / span 2;
        padding: 10px 0 0 0;
        border-top: 1px solid #f0f0f0;
        margin-top: 5px;
    }
    
    .wishlist_table .add_to_cart_button {
        display: block;
        width: 100%;
        box-sizing: border-box;
        padding: 12px;
    }
}

/* ==========================================================================
   4. SVG ОГРАНИЧЕНИЯ ДЛЯ ПРЕДОТВРАЩЕНИЯ ГИГАНТСКИХ ИКОНОК
   ========================================================================== */
.yith-wcwl-form svg,
.wishlist_table svg,
.yith-wcwl-icon svg,
.woocommerce-wishlist svg,
.woocommerce-message svg,
.woocommerce-error svg,
.woocommerce-info svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: inline-block !important;
    vertical-align: middle;
}

table.wishlist_table td.product-remove a.remove svg,
table.wishlist_table td.product-remove a.remove_from_wishlist svg {
    width: 12px !important;
    height: 12px !important;
    margin: 0 auto;
}

table.wishlist_table td.product-stock-status svg {
    width: 14px !important;
    height: 14px !important;
    margin-right: 6px;
}

table.wishlist_table td.product-add-to-cart a.button svg,
table.wishlist_table td.product-add-to-cart .add_to_cart_button svg {
    width: 14px !important;
    height: 14px !important;
    margin-right: 6px;
    fill: #fff !important;
}
