/* =========================================
    ConnectHair Wishlist Plugin Styles
   ========================================= */

/* Прячем неправильно размещенные кнопки в каталоге */
.woocommerce ul.products li.product .body .ch-single-product-wishlist {
    display: none !important;
}

/* Кнопка избранного на товарах в каталоге - только иконка */
.ch-wishlist-btn-wrapper {
    position: absolute;
    top: 15px;
    left: 10px;
    z-index: 5;
}

/* Специально для темы ConnectHair - размещаем на thumbnail_box */
.woocommerce ul.products li.product .thumbnail_box {
    position: relative;
}

.woocommerce ul.products li.product .thumbnail_box .ch-wishlist-btn-wrapper {
    position: absolute;
    top: 22px;
    left: 10px;
    z-index: 5; /* Выше остальных элементов на картинке */
}

/* Принудительный сброс всех стилей для иконки */
.ch-wishlist-btn {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
    
    /* Делаем это inline-block элементом */
    display: inline-block !important;
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    margin: 0 !important;
    
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
    
    /* Сброс стилей для разных браузеров */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.ch-wishlist-btn:hover,
.ch-wishlist-btn:focus,
.ch-wishlist-btn:active {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    transform: scale(1.1);
}

.ch-wishlist-btn .wishlist-icon {
    width: 24px !important;
    height: 24px !important;
    filter: brightness(0) saturate(100%) invert(0%) drop-shadow(0 1px 2px rgba(255, 255, 255, 0.3)); /* Черная иконка с белой тенью */
    transition: filter 0.3s ease;
    display: block;
}

.ch-wishlist-btn.in-wishlist .wishlist-icon {
    filter: invert(27%) sepia(51%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)) !important; /* Pink color когда добавлено */
}

.ch-wishlist-btn:hover .wishlist-icon {
    filter: invert(27%) sepia(51%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6)) !important; /* Pink on hover */
}

/* Кнопка избранного на странице товара */
.ch-single-product-wishlist {
    margin: 15px 0;
}

.ch-wishlist-btn-single {
    background: transparent;
    border: 1px solid #AE8D8D;
    border-radius: 5px;
    padding: 10px 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #AE8D8D;
    font-size: 14px;
    font-family: inherit;
}

.ch-wishlist-btn-single:hover {
    border-color: #FF6B6B;
    color: #FF6B6B;
}

.ch-wishlist-btn-single.in-wishlist {
    background: #FF6B6B;
    border-color: #FF6B6B;
    color: white;
}

.ch-wishlist-btn-single.in-wishlist:hover {
    background: #FF5252;
    border-color: #FF5252;
}

.ch-wishlist-btn-single .wishlist-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) saturate(100%) invert(64%) sepia(6%) saturate(1230%) hue-rotate(325deg) brightness(93%) contrast(89%); /* AE8D8D color */
    transition: filter 0.3s ease;
}

.ch-wishlist-btn-single:hover .wishlist-icon {
    filter: invert(27%) sepia(51%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%); /* Pink color */
}

.ch-wishlist-btn-single.in-wishlist .wishlist-icon {
    filter: brightness(0) invert(1); /* White when active */
}

.ch-wishlist-btn-single.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Сердечко в шапке */
.ch-wishlist-header-link {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 10px;
}

.ch-wishlist-header-link a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #4F3636;
    position: relative;
}

.ch-wishlist-header-link .wishlist-header-icon {
    width: 21px;
    height: 21px;
    filter: brightness(0);
    transition: filter 0.3s ease;
}



.ch-wishlist-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #FF6B6B;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    line-height: 1;
}

.ch-wishlist-count:empty {
    display: none;
}

/* Страница избранного */
.ch-wishlist-page {
    margin: 20px 0;
}

.ch-wishlist-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    padding: 20px;
    background: #FEF2F3;
    border-radius: 10px;
}

.ch-wishlist-stats p {
    margin: 0;
    font-weight: 500;
    color: #653C3C;
}

.ch-clear-all-wishlist {
    background-color: #FEF2F3;
    border: 1px solid #A98686;
    color: #AE8D8D;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.ch-clear-all-wishlist:hover {
    background-color: #FFC0CB;
    color: #653C3C;
}

.ch-wishlist-footer {
    text-align: center;
    margin: 40px 0;
}

.ch-empty-wishlist {
    text-align: center;
    padding: 60px 20px;
    background: #FEF2F3;
    border-radius: 10px;
    margin: 40px 0;
}

/* Уведомления */
.ch-wishlist-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ch-wishlist-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.ch-wishlist-notification.error {
    background: #f44336;
}

/* Стили кнопок в стиле темы ConnectHair */
.ch-wishlist-page .btn {
    padding: 7px 21px;
    display: inline-block;
    cursor: pointer;
    text-decoration: none;
    box-shadow: none;
    outline: none;
    transition: all .2s ease-in-out;
    font-weight: 500;
    font-family: inherit;
    color: #653C3C;
    background-color: #ffc0cb;
    border: 1px solid #FFC0CB;
    border-radius: 10px;
    text-align: center;
}

.ch-wishlist-page .btn:hover {
    color: #653C3C;
}

.ch-wishlist-page .btn.light {
    background-color: #FEF2F3;
    border-color: #FEF2F3;
}

/* Адаптивность */
@media screen and (max-width: 767px) {
    .ch-wishlist-btn-wrapper {
        top: 12px;
        left: 8px;
    }
    
    .woocommerce ul.products li.product .thumbnail_box .ch-wishlist-btn-wrapper {
        top: 20px;
        left: 8px;
    }
    
    .ch-wishlist-btn {
        width: 22px !important;
        height: 22px !important;
    }
    
    .ch-wishlist-btn .wishlist-icon {
        width: 22px !important;
        height: 22px !important;
    }
    
    .ch-wishlist-header-link .wishlist-header-icon {
        width: 28px;
        height: 28px;
    }
    
    .ch-wishlist-header-actions {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .ch-wishlist-notification {
        right: 10px;
        left: 10px;
        transform: translateY(-100%);
    }
    
    .ch-wishlist-notification.show {
        transform: translateY(0);
    }
}

/* Интеграция с темой ConnectHair */
@media screen and (max-width: 999px) {
    .ch-wishlist-header-link {
        margin: 0 5px;
    }
}

/* Дополнительные стили для интеграции с WooCommerce */
.woocommerce .ch-wishlist-page .products {
    margin: 20px 0 40px;
}

.woocommerce .ch-empty-wishlist .woocommerce-info {
    font-size: 1.2em;
    margin: 20px 0;
}

/* Фиксированные размеры товаров на странице избранного */
.ch-wishlist-page .woocommerce ul.products.columns-4 li.product {
    width: 22% !important;
    margin: 0 4% 2em 0 !important;
    float: left !important;
    display: inline-block !important;
}

.ch-wishlist-page .woocommerce ul.products.columns-4 li.product:nth-child(4n) {
    margin-right: 0 !important;
}

.ch-wishlist-page .woocommerce ul.products li.product .thumbnail_box {
    display: block !important;
    width: 100% !important;
    height: 250px !important;
    overflow: hidden !important;
    position: relative !important;
}

.ch-wishlist-page .woocommerce ul.products li.product .thumbnail_box img {
    max-width: 100% !important;
    width: 100% !important;
    height: 250px !important;
    object-fit: cover !important;
    object-position: center !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

/* Скрываем второе изображение, оставляем только первое */
.ch-wishlist-page .woocommerce ul.products li.product .thumbnail_box img:nth-child(2) {
    display: none !important;
}

/* Или наоборот - показываем только второе (размер thumbnail) */
.ch-wishlist-page .woocommerce ul.products li.product .thumbnail_box img:first-child {
    display: none !important;
}

.ch-wishlist-page .woocommerce ul.products li.product .thumbnail_box img:nth-child(2) {
    display: block !important;
}

.ch-wishlist-page .woocommerce ul.products li.product .body {
    padding: 15px 0 !important;
}

.ch-wishlist-page .woocommerce ul.products li.product .body h2 {
    font-size: 16px !important;
    line-height: 1.3 !important;
    margin: 0 0 10px 0 !important;
}

.ch-wishlist-page .woocommerce ul.products {
    clear: both !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
}

/* На планшетах - 3 колонки */
@media screen and (max-width: 1024px) {
    .ch-wishlist-page .woocommerce ul.products.columns-4 li.product {
        width: 30% !important;
        margin: 0 5% 2em 0 !important;
    }
    
    .ch-wishlist-page .woocommerce ul.products.columns-4 li.product:nth-child(3n) {
        margin-right: 0 !important;
    }
    
    .ch-wishlist-page .woocommerce ul.products.columns-4 li.product:nth-child(4n) {
        margin-right: 5% !important;
    }
}

/* На мобильных устройствах - 2 колонки */
@media screen and (max-width: 768px) {
    .ch-wishlist-page .woocommerce ul.products.columns-4 li.product {
        width: 47% !important;
        margin: 0 6% 2em 0 !important;
    }
    
    .ch-wishlist-page .woocommerce ul.products.columns-4 li.product:nth-child(2n) {
        margin-right: 0 !important;
    }
    
    .ch-wishlist-page .woocommerce ul.products.columns-4 li.product:nth-child(3n),
    .ch-wishlist-page .woocommerce ul.products.columns-4 li.product:nth-child(4n) {
        margin-right: 6% !important;
    }
    
    .ch-wishlist-page .woocommerce ul.products li.product .thumbnail_box {
        height: 200px !important;
    }
    
    .ch-wishlist-page .woocommerce ul.products li.product .thumbnail_box img {
        height: 200px !important;
    }
}

/* На очень маленьких экранах - 1 колонка */
@media screen and (max-width: 480px) {
    .ch-wishlist-page .woocommerce ul.products.columns-4 li.product {
        width: 100% !important;
        margin: 0 0 2em 0 !important;
    }
    
    .ch-wishlist-page .woocommerce ul.products.columns-4 li.product:nth-child(2n),
    .ch-wishlist-page .woocommerce ul.products.columns-4 li.product:nth-child(3n),
    .ch-wishlist-page .woocommerce ul.products.columns-4 li.product:nth-child(4n) {
        margin-right: 0 !important;
    }
}

/* Анимация загрузки */
@keyframes ch-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.ch-wishlist-btn.loading,
.ch-wishlist-btn-single.loading {
    animation: ch-pulse 1s infinite;
}
/* Информационные уведомления */
.ch-wishlist-notification.info {
    background: #2196F3;
    color: white;
}

/* Уведомление для гостей на обычных страницах */
.ch-guest-notice {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-left: 4px solid #2196F3;
    color: #1565C0;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.5;
}

.ch-guest-notice strong {
    color: #0D47A1;
}

.ch-guest-notice a {
    color: #1976D2;
    text-decoration: underline;
    font-weight: 600;
}

.ch-guest-notice a:hover {
    color: #0D47A1;
}

/* Баннер для гостей на странице избранного (уже есть в шаблоне, но добавляем для совместимости) */
.ch-guest-banner {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border: 1px solid #FFCC02;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.ch-guest-banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ch-guest-banner-icon svg {
    width: 24px;
    height: 24px;
}

.ch-guest-banner-text {
    color: #E65100;
    font-size: 15px;
    line-height: 1.5;
}

.ch-guest-banner-text .login-link {
    color: #FF6B6B;
    text-decoration: underline;
    font-weight: 600;
}

.ch-guest-banner-text .login-link:hover {
    color: #FF5252;
}

/* Стили для мигающего уведомления о первом добавлении */
.ch-first-add-notice {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
    z-index: 10001;
    max-width: 300px;
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ch-first-add-notice .notice-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.ch-first-add-notice .notice-text {
    font-size: 14px;
    line-height: 1.4;
}

/* Анимация для счетчика в шапке */
.ch-wishlist-count.updated {
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Стили для кнопки входа в пустом списке избранного для гостей */
.ch-empty-wishlist .guest-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #E0E0E0;
}

.ch-empty-wishlist .guest-notice {
    background: #E3F2FD;
    color: #1565C0;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* Адаптивность для уведомлений гостей */
@media screen and (max-width: 767px) {
    .ch-guest-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .ch-first-add-notice {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .ch-guest-notice {
        padding: 12px 15px;
        font-size: 13px;
    }
}

/* Стили для индикатора сессии */
.ch-session-indicator {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(33, 150, 243, 0.9);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 9999;
    display: none;
}

.ch-session-indicator.show {
    display: block;
    animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Улучшенные стили для уведомлений */
.ch-wishlist-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 320px;
    word-wrap: break-word;
}

.ch-wishlist-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.ch-wishlist-notification.error {
    background: linear-gradient(135deg, #f44336 0%, #e57373 100%);
    color: white;
}

.ch-wishlist-notification.success {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    color: white;
}

.ch-wishlist-notification.info {
    background: linear-gradient(135deg, #2196F3 0%, #42A5F5 100%);
    color: white;
}

/* Адаптивность уведомлений */
@media screen and (max-width: 767px) {
    .ch-wishlist-notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .ch-wishlist-notification.show {
        transform: translateY(0);
    }
}