/* ============================================================================
   BulletBro Wishlist — стили
   Использует currentColor для иконок: меняй цвет через CSS color.
   ============================================================================ */

/* ── 1. БАЗОВАЯ КНОПКА (shared) ───────────────────────────────────────────── */

.bb-wl-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 1;
}

.bb-wl-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 50%;
}

/* ── 2. ИКОНКА СЕРДЦА (shared) ────────────────────────────────────────────── */

.bb-wl-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.bb-wl-icon-outline,
.bb-wl-icon-filled {
    display: block;
    flex-shrink: 0;
    pointer-events: none;
}

/* По умолчанию: outline видно, filled скрыто */
.bb-wl-icon-filled {
    display: none;
}

/* Активное состояние: swap иконок */
.bb-wl-btn.is-active .bb-wl-icon-outline {
    display: none;
}

.bb-wl-btn.is-active .bb-wl-icon-filled {
    display: block;
}

/* ── 3. КНОПКА НА КАРТОЧКЕ КАТАЛОГА (круглая, поверх изображения) ─────────── */

/* Контекст позиционирования */
.product-image {
    position: relative;
}

.bb-wl-catalog-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    color: #888;
    transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.bb-wl-catalog-btn:hover {
    color: #111;
    background: #fff;
    transform: scale(1.08);
}

.bb-wl-catalog-btn.is-active {
    color: #111;
    background: #fff;
}

.bb-wl-catalog-btn .bb-wl-icon {
    width: 16px;
    height: 16px;
}

.bb-wl-catalog-btn .bb-wl-icon-outline,
.bb-wl-catalog-btn .bb-wl-icon-filled {
    width: 16px;
    height: 16px;
}

/* ── 4. КНОПКА НА СТРАНИЦЕ ТОВАРА ────────────────────────────────────────── */

.bb-wl-single-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: 100%;
    padding: 11px 20px;
    margin-top: 12px;
    box-sizing: border-box;

    background: #fff;
    border: 2px solid #000;
    border-radius: 6px;
    cursor: pointer;

    color: #111;
    font-family: 'als-hauss', sans-serif;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;

    transition: color 0.15s ease, background 0.15s ease;
}

.bb-wl-single-btn:hover:not(.is-disabled):not([disabled]) {
    background: #000;
    color: #fff;
}

.bb-wl-single-btn.is-active {
    background: #000;
    color: #fff;
}

.bb-wl-single-btn.is-disabled,
.bb-wl-single-btn[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.bb-wl-single-btn .bb-wl-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.bb-wl-single-btn .bb-wl-icon-outline,
.bb-wl-single-btn .bb-wl-icon-filled {
    width: 16px;
    height: 16px;
}

.bb-wl-single-label {
    pointer-events: none;
}

/* ── 5. ИКОНКА В ШАПКЕ ───────────────────────────────────────────────────── */

/* .custom-html в header-right должен вести себя как Porto-элементы (cart, compare) */
.header-right .custom-html {
    display: inline-flex !important;
    align-items: center;
    vertical-align: middle;
}

.bb-wl-header-wrap {
    display: inline-flex;
    align-items: center;
    vertical-align: middle; /* Как #mini-cart и .yith-woocompare-open в Porto */
    position: relative;     /* Нужно для absolute-бейджа */
    /* margin даёт место для бейджа, который торчит за пределы иконки */
    margin: 0 6px 0 0;
}

.bb-wl-header-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: currentColor;
    position: relative;
    line-height: 1;
    /* Без padding — иначе добавляется лишняя высота смещающая иконку */
}

.bb-wl-header-svg {
    width: 22px;
    height: 22px;
    display: block;
    flex-shrink: 0;
}

/* Бейдж-счётчик: позиционирован absolute как у корзины Porto */
.bb-wl-count {
    position: absolute;
    top: -4px;
    right: -4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 3px;
    background: #000;
    color: #fff;
    border-radius: 2em;
    font-size: 10px;
    line-height: 1;
    font-family: 'gotham-medium', sans-serif;
    pointer-events: none;
    z-index: 1;
}

.bb-wl-count.is-empty {
    display: none;
}

/* ── 6. TOAST-УВЕДОМЛЕНИЕ (тёмный стиль) ─────────────────────────────────── */

.bb-wl-toast {
    position: fixed;
    z-index: 99999;

    /* Desktop: правый верхний угол под хедером */
    top: 80px;
    right: 24px;
    left: auto;

    display: flex;
    align-items: center;
    gap: 14px;

    width: 360px;
    padding: 16px 40px 16px 16px;

    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);

    visibility: hidden;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;
    pointer-events: none;
}

.bb-wl-toast.is-visible {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0s;
    pointer-events: auto;
}

.bb-wl-toast.is-leaving {
    visibility: visible;
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}

/* Миниатюра товара */
.bb-wl-toast-img {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    background: #222;
}

.bb-wl-toast-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Текстовый блок */
.bb-wl-toast-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bb-wl-toast-msg {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.2;
}

.bb-wl-toast-name {
    font-size: 15px;
    color: #fff;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bb-wl-toast-link {
    font-size: 12px;
    color: #aaa;
    text-decoration: underline;
    line-height: 1.2;
    margin-top: 4px;
}

.bb-wl-toast-link:hover {
    color: #fff;
}

/* Кнопка закрытия */
.bb-wl-toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    padding: 0;
    transition: color 0.15s;
}

.bb-wl-toast-close:hover {
    color: #ccc;
}

.bb-wl-toast-close svg {
    width: 13px;
    height: 13px;
    pointer-events: none;
    display: block;
}

/* Mobile: по центру сверху под хедером */
@media (max-width: 767px) {
    .bb-wl-toast {
        top: 68px;
        right: auto;
        left: 50%;
        width: calc(100vw - 32px);
        max-width: 360px;
        transform: translateX(-50%) translateY(-12px);
    }

    .bb-wl-toast.is-visible {
        transform: translateX(-50%) translateY(0);
    }

    .bb-wl-toast.is-leaving {
        transform: translateX(-50%) translateY(-12px);
    }
}

/* ── 7. СТРАНИЦА ИЗБРАННОГО ─────────────────────────────────────────────── */

.bb-wishlist-page {
    padding: 20px 0;
}

.bb-wl-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: #999;
    font-size: 14px;
}

.bb-wl-empty {
    text-align: center;
    padding: 60px 20px;
}

.bb-wl-empty p {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}

/* Сетка карточек */
.bb-wl-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 991px) {
    .bb-wl-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 479px) {
    .bb-wl-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ── 7а. КАРТОЧКА НА СТРАНИЦЕ ИЗБРАННОГО (стиль каталога) ──────────────── */

/* Анимация удаления */
.bb-wl-card.is-removing {
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

/* Изображение: та же пропорция 3:2 что в каталоге */
.bb-wl-card .product-image {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.bb-wl-card .product-image a {
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
}

.bb-wl-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.32s ease;
}

.bb-wl-card:hover .product-image img {
    transform: scale(1.04);
}

/* Кнопка × — поверх изображения */
.bb-wl-card .bb-wl-card-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #555;
    transition: background 0.15s ease, color 0.15s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.bb-wl-card .bb-wl-card-remove:hover {
    background: #fff;
    color: #111;
}

.bb-wl-card .bb-wl-card-remove svg {
    width: 13px;
    height: 13px;
    pointer-events: none;
    display: block;
}

/* Контент: такой же как .product-content в каталоге */
/* Переопределяем глобальный style.css (.product-content { flex-direction: row; text-align: center }) */
.bb-wl-card .product-content {
    padding: 10px 12px 14px;
    display: flex !important;
    flex-direction: column !important; /* title → vehicle → epo → price → actions */
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    text-align: left !important;
}

/* Заголовок товара: повторяем каталог (.bb-product-title) */
.bb-wl-card .bb-product-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 4px;
}

.bb-wl-card .bb-product-title a {
    color: #111;
    text-decoration: none;
}

.bb-wl-card .bb-product-title a:hover {
    color: #444;
}

/* Название дизайна */
.bb-wl-card .bb-pt-design {
    display: block;
    font-size: 13px;
}

/* Техника (vehicle) — мелко, как в каталоге */
.bb-wl-card .bb-pt-vehicle {
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

/* Цена: повторяем каталог */
.bb-wl-card .price {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #111;
    margin-bottom: 0;
    line-height: 1.3;
}

/* Кнопки: «В корзину» + «Опции» */
.bb-wl-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    margin-top: 8px;
}

/* «В корзину» — основная кнопка */
.bb-wl-card-atc {
    flex: 1;
    display: block;
    text-align: center;
    font-size: 11px;
    padding: 8px 10px;
    background: #111;
    color: #fff !important;
    border: 1px solid #111;
    border-radius: 4px;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.15s ease;
    line-height: 1.4;
    cursor: pointer;
}

.bb-wl-card-atc:hover {
    background: #333;
    color: #fff !important;
}

.bb-wl-card-atc.loading {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}

.bb-wl-card-atc.added {
    background: #2e7d32;
    border-color: #2e7d32;
    cursor: default;
    pointer-events: none;
}

/* «Опции» — вторичная кнопка (outline) */
.bb-wl-card-order {
    display: block;
    text-align: center;
    font-size: 11px;
    padding: 8px 10px;
    background: none;
    color: #000 !important;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: border-color 0.15s ease;
    line-height: 1.4;
    white-space: nowrap;
}

.bb-wl-card-order:hover {
    border-color: #555;
    color: #000 !important;
}

/* ── 7б. EPO ОПЦИИ В КАРТОЧКЕ WISHLIST ──────────────────────────────────── */

.bb-wl-epo-list {
    list-style: none;
    margin: 4px 0 6px;
    padding: 0;
    order: 3; /* между vehicle и price в flex-колонке */
}

.bb-wl-epo-list li {
    font-size: 11px;
    color: #555;
    line-height: 1.5;
    padding: 0;
    margin: 0;
}

.bb-wl-epo-list li .bb-wl-epo-lbl {
    color: #999;
}

/* Кнопки прижаты к низу карточки */
.bb-wl-card .bb-wl-card-actions { margin-top: auto; }
