/* ======================================================
   ЦВЕТА ПРОЕКТА (единый источник)
====================================================== */
:root { 
    --wl-white:  #ffffff;
    --wl-foncart: #FAF8FF; /* фон карточки*/
    --wl-lilac:  #E6D9FF; /* вторичный фон */
    --wl-purple: #7A5AF8; /* основной акцент */
    --wl-purple2: #3D1570; /* шрифт для подписи товара*/
    --wl-blue:   #3429D5; /* ссылки / переходы */
    --wl-sky:    #7DD3FC; /* альтернативные действия */
    --wl-maroon: #970000; /* бордовый цвет */
}

/* ======================================================
   Активные заказы: текст визуально друг под другом
====================================================== */
.tariff-scope {
    display: inline-block;
    min-width: 90px; /* ← регулируй */
}

/* ======================================================
   Сетка карточек: 4 в ряд на десктопе
====================================================== */
.wl-cards-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.wl-cards-grid-4 .wl-card {
    width: 100%; /* карточка занимает всю ширину своей колонки */
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .wl-cards-grid-4 {
        grid-template-columns: 1fr; /* 1 колонка для супер-мобилок */
    }
}
/* ======================================================
  Чек-бокс крупнее
====================================================== */
.big-checkbox {
    transform: scale(1.5);
    cursor: pointer;
    margin-right: 10px;
    accent-color: #7A5AF8; /* сиреневый */
}
/* ======================================================
  Шрифт жирный фиолетовый
====================================================== */
.wl-scope {
    font-weight: 700;
    color: var(--wl-purple2);
}

/* ======================================================
   КНОПКИ ТОВАРА — выравнивание по низу карточки
   (ТОЛЬКО для кабинета продавца)
====================================================== */
/* карточка становится flex-контейнером */
.wl-card2 {
    display: flex;
    flex-direction: column;
    height: 100%;
}
/* основной контент не влияет на положение кнопок */
.wl-card2 .wl-gift-main {
    flex-grow: 1;
}
/* блок действий всегда внизу */
.wl-actions-bottom {
    margin-top: auto;
}
/* ======================================================
   СЕТКА КНОПОК ПРОДАВЦА - продолжение
====================================================== */
.wl-card-actions--vendor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
/* кнопка "Опубликовать" — на всю ширину */
.wl-card-actions--vendor .wl-btn-publish {
    grid-column: 1 / -1;
}
/* все кнопки одинаковой высоты */
.wl-card-actions--vendor .wl-btn-small {
    width: 100%;
}
/* мобильная версия */
@media (max-width: 360px) {
    .wl-card-actions--vendor {
        grid-template-columns: 1fr;
    }
}
/* цвет ссылок */
.wl-link {
    color: blue;
}
/* ======================================================
 Навигация «Идеи подарков»
====================================================== */
/* На страницах каталога используем одну собственную строку навигации,
   поэтому стандартную хлебную крошку темы скрываем только здесь. */
.market-ideas-page #breadcrumbs.breadcrumb {
    display: none;
}
.market-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 7px;
    margin: 17px 0 3px;
    padding: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #70677c;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}
.market-breadcrumbs::-webkit-scrollbar {
    display: none;
}
.market-breadcrumbs a {
    color: #6f55d9;
    text-decoration: none;
    font-weight: 600;
}
.market-breadcrumbs a:hover {
    text-decoration: underline;
}
.market-breadcrumbs__separator {
    color: #92899e;
}
.market-breadcrumbs__current {
    color: #4f4658;
    font-weight: 600;
}
.market-breadcrumbs + h1 {
    margin-top: 10px;
}

.market-category-nav {
    margin: 18px 0 22px;
    padding: 14px 16px 15px;
    border: 1px solid #e8e0fb;
    border-radius: 14px;
    background: linear-gradient(135deg, #fbf9ff 0%, #f7f4ff 58%, #f3f8ff 100%);
}
.market-category-nav__title {
    margin: 0 0 9px;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 700;
    color: #4c4357;
}
.market-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
}
.market-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 5px 13px;
    margin: 0;
    background: #fff;
    border: 1px solid #cdbcf6;
    border-radius: 9px;
    text-decoration: none;
    font-weight: 500;
    color: #5e536b;
    line-height: 1.25;
    transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.market-category:hover {
    background: #f0eaff;
    border-color: #9b7cf0;
    color: #423755;
}
/* «Все подарки» — постоянная визуальная точка возврата в общий каталог. */
.market-category--all {
    background: linear-gradient(135deg, #eee8ff 0%, #e9f2ff 100%);
    border-color: #9d83ee;
    color: #4c3b83;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(122, 90, 248, .08);
}
.market-category--all:hover {
    background: linear-gradient(135deg, #e7deff 0%, #e0edff 100%);
    border-color: #8062e8;
    color: #3f2e77;
}
.market-category--active,
.market-category--active:hover {
    background: linear-gradient(135deg, #8062e8 0%, #7559df 58%, #6c83e7 100%);
    border-color: #7559df;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 11px rgba(117, 89, 223, .18);
}
@media (max-width: 600px) {
    .market-category-nav {
        padding: 12px;
        margin-top: 15px;
    }
    .market-categories {
        gap: 7px;
    }
    .market-category {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* ======================================================
  /* ===== single-offer.php only ===== 
====================================================== */

.wl-single-product {
    max-width: 900px;
    margin: 50px auto;
    padding: 20px;
}

.wl-single-product-label {
    background: #E6D9FF;
    color: #000;
    padding: 6px 12px;
    border-radius: 10px;
    border: 2px solid #7A5AF8;
    font-weight: bold;
}
.wl-single-product-label--image {
    position: absolute;
    top: 0px;
    left: 0px;
    z-index: 2;
    font-size: 13px;
    padding: 5px 10px;
}

.wl-single-product-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    align-items: flex-start;
}

.wl-single-product-image {
    position: relative;
    flex: 1 1 300px;
    max-width: 300px;
    text-align: center;
}
.wl-single-product-image img {
    width: 100%;
    border-radius: 10px;
    display: block;
    margin: 0 auto;
}

.wl-single-product-info {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wl-single-product-price {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.wl-single-product-actions {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .wl-single-product-flex {
        flex-direction: column;
        align-items: center;
    }

    .wl-single-product-image,
    .wl-single-product-info {
        max-width: 100%;
        text-align: center;
    }
}

/* ======================================================
 модальное окно - невозможно опубликовать
====================================================== */
.modal-text-left {
    text-align: left;
    margin: 6px 0 4px;
}
.compact-list {
    margin: 0 0 12px;
    padding-left: 16px;
    list-style-position: outside;
    text-align: left;
}
.compact-list li {
    margin: 2px 0;
    line-height: 1.3;
}

/* ======================================================
 Фильтр категорий
====================================================== */
.wl-filter-category-select {
    padding: 8px 10px;
    height: 38px; /* КЛЮЧ: одинаковая высота с кнопками */
    border-radius: 8px;
    border: 2px solid var(--wl-purple);
    min-width: 220px;
    cursor: pointer;
}

/* ======================================================
   ВОССТАНОВЛЕННЫЕ ОБЩИЕ СТИЛИ WL ДЛЯ MARKET
   Эти стили делают market независимым от wishlist-плагина
====================================================== */

.wl-card {
    background: var(--wl-foncart);
    border: 1px solid var(--wl-purple);
    border-radius: 12px;
    padding: 16px;
    box-sizing: border-box;
}
.wl-card h3,
.wl-card h4 {
    margin: 0 0 6px;
}

.wl-gift-card {
    position: relative;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 14px;
    width: 100%;
}
.wl-gift-card-left img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}
.wl-gift-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wl-gift-extra {
    grid-column: 1 / -1;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wl-card:not(.wl-gift-card) {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.wl-card:not(.wl-gift-card) .wl-card-actions,
.wl-gift-extra .wl-card-actions,
.wl-actions-bottom {
    margin-top: auto;
}

.wl-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.wl-card-actions .wl-btn,
.wl-card-actions .wl-btn-small {
    flex: 1;
}
@media (max-width: 360px) {
    .wl-card-actions {
        flex-direction: column;
    }
    .wl-card-actions .wl-btn,
    .wl-card-actions .wl-btn-small {
        width: 100%;
    }
}

.wl-btn,
.wl-btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.2;
    transition: all .2s ease;
    box-sizing: border-box;
}
.wl-btn {
    padding: 6px 14px;
    font-size: 14px;
}
.wl-btn-small {
    padding: 4px 6px;
    font-size: 13px;
}
.wl-btn-primary {
    background: var(--wl-purple);
    color: var(--wl-white);
}
.wl-btn-secondary {
    background: var(--wl-lilac);
    color: var(--wl-purple);
    border-color: var(--wl-purple);
}
.wl-btn-link {
    background: var(--wl-white);
    color: var(--wl-blue);
    border-color: var(--wl-blue);
}
.wl-btn-shop {
    background: var(--wl-lilac);
    color: var(--wl-blue);
    border-color: var(--wl-blue);
}
.wl-btn-danger,
.wl-btn-delete {
    background: var(--wl-white);
    color: var(--wl-maroon);
    border-color: var(--wl-maroon);
}
.wl-btn-publish {
    background: var(--wl-lilac);
    color: var(--wl-purple);
    border-color: var(--wl-purple);
}
.wl-btn:hover,
.wl-btn-small:hover,
.wl-link:hover {
    opacity: .88;
}
.wl-btn.wl-disabled,
.wl-btn-small.wl-disabled,
.wl-btn:disabled,
.wl-btn-small:disabled {
    opacity: .5;
    cursor: not-allowed;
}
.wl-go-btn {
    text-align: center;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="url"],
textarea,
select,
.wl-select {
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--wl-lilac);
    font-size: 16px;
    font-family: inherit;
    background: var(--wl-white);
}
input:focus,
textarea:focus,
select:focus,
.wl-select:focus {
    outline: none;
    border-color: var(--wl-purple);
}
textarea {
    min-height: 100px;
    resize: vertical;
}
.wl-input-full {
    width: 100%;
    margin-top: 0;
}
.wl-form-label {
    display: block;
    font-weight: bold;
    margin-top: 16px;
    margin-bottom: 2px;
}
.wl-form-label-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}
.wl-form-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}
.wl-form-inline input,
.wl-form-inline textarea,
.wl-form-inline select {
    width: auto;
}

.wl-image-url-wrap,
.wl-link-url-wrap {
    position: relative;
}
.wl-image-url-clear,
.wl-link-url-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 16px;
    color: #bbb;
    background: var(--wl-lilac);
    padding: 2px 8px;
    border-radius: 50%;
    display: none;
}
.wl-image-url-wrap input:not(:placeholder-shown) + .wl-image-url-clear,
.wl-link-url-wrap input:not(:placeholder-shown) + .wl-link-url-clear {
    display: block;
}
.wl-image-url-clear:hover,
.wl-link-url-clear:hover {
    color: #000;
}

.wl-copy-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.wl-copy-actions {
    display: flex;
    gap: 8px;
}
.wl-copy-wrapper .wl-copy-input {
    width: 100%;
    padding: 4px 8px;
    font-size: 14px;
    border: 1px solid var(--wl-purple);
    border-radius: 6px;
}

.wl-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.wl-modal-content {
    background: var(--wl-white);
    padding: 24px;
    max-width: 400px;
    width: 100%;
    border-radius: 12px;
    text-align: center;
    position: relative;
    box-sizing: border-box;
}
.wl-modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.wl-image-preview-wrapper {
    margin-top: 10px;
}
.wl-gift-image-preview {
    max-width: 180px;
    height: auto;
    border-radius: 8px;
    display: block;
}
.wl-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--wl-lilac);
    color: var(--wl-purple2);
    font-size: 12px;
    font-weight: 700;
}
.wl-empty-text {
    color: #777;
    margin: 12px 0;
}
.wl-default-emoji {
    font-size: 42px;
    line-height: 1;
    text-align: center;
}

@media (max-width: 480px) {
    .wl-gift-card {
        grid-template-columns: 90px 1fr;
        gap: 10px;
    }
    .wl-modal-content {
        width: calc(100% - 24px);
    }
}


/* ======================================================
   КАБИНЕТ ПРОДАВЦА — восстановление кнопок
====================================================== */
.wl-wishlist-edit .wl-btn,
.wl-wishlist-edit .wl-btn-small,
.wl-wishlist-edit button.wl-btn,
.wl-wishlist-edit button.wl-btn-small,
.wl-wishlist-edit a.wl-btn,
.wl-wishlist-edit a.wl-btn-small {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    border-radius: 8px !important;
    border: 2px solid transparent !important;
    cursor: pointer;
    text-decoration: none !important;
    font-weight: 700;
    line-height: 1.2;
    box-sizing: border-box;
    white-space: normal;
    text-align: center;
    font-family: inherit;
    box-shadow: none;
}
.wl-wishlist-edit .wl-btn {
    padding: 7px 14px !important;
    font-size: 14px;
}
.wl-wishlist-edit .wl-btn-small {
    padding: 6px 8px !important;
    font-size: 13px;
    min-height: 32px;
}
.wl-wishlist-edit .wl-btn-link {
    background: var(--wl-white) !important;
    color: var(--wl-blue) !important;
    border-color: var(--wl-blue) !important;
}
.wl-wishlist-edit .wl-btn-shop {
    background: var(--wl-lilac) !important;
    color: var(--wl-blue) !important;
    border-color: var(--wl-blue) !important;
}
.wl-wishlist-edit .wl-btn-publish {
    background: var(--wl-lilac) !important;
    color: var(--wl-purple) !important;
    border-color: var(--wl-purple) !important;
}
.wl-wishlist-edit .wl-btn-danger,
.wl-wishlist-edit .wl-btn-delete {
    background: var(--wl-white) !important;
    color: var(--wl-maroon) !important;
    border-color: var(--wl-maroon) !important;
}
.wl-wishlist-edit .wl-btn:hover,
.wl-wishlist-edit .wl-btn-small:hover,
.wl-wishlist-edit .wl-filter-btn:hover {
    opacity: .88;
    transform: translateY(-1px);
}
.wl-wishlist-edit .wl-card-actions--vendor {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}
.wl-wishlist-edit .wl-card-actions--vendor .wl-btn-publish {
    grid-column: 1 / -1;
}
.wl-wishlist-edit .wl-card-actions--vendor .wl-btn-small,
.wl-wishlist-edit .wl-card-actions--vendor a.wl-btn-small,
.wl-wishlist-edit .wl-card-actions--vendor button.wl-btn-small {
    width: 100% !important;
}
.wl-wishlist-edit .wl-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.wl-wishlist-edit .wl-filter-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 14px;
    border-radius: 8px;
    border: 2px solid var(--wl-purple);
    background: var(--wl-white);
    color: var(--wl-purple);
    cursor: pointer;
    font-weight: 700;
    line-height: 1.2;
    font-family: inherit;
}
.wl-wishlist-edit .wl-filter-btn.active {
    background: var(--wl-lilac);
    color: var(--wl-purple2);
}
.wl-wishlist-edit .wl-copy-actions,
.wl-wishlist-edit .wl-modal-actions,
.wl-wishlist-edit form > p:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.wl-wishlist-edit .wl-add-product {
    width: auto;
    max-width: 100%;
}
@media (max-width: 480px) {
    .wl-wishlist-edit .wl-card-actions--vendor {
        grid-template-columns: 1fr;
    }
    .wl-wishlist-edit .wl-copy-actions .wl-btn,
    .wl-wishlist-edit form > p:last-child .wl-btn,
    .wl-wishlist-edit .wl-add-product {
        width: 100%;
    }
}


/* Исправляет предпросмотр изображения на странице редактирования товара продавца */
.market-product-image-block {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

/* Контейнер изображения товара всегда квадратный и не зависит от стилей вишлиста */
.market-product-image-preview-wrapper {
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
    height: 300px !important;
    cursor: pointer;
    position: relative;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    box-sizing: border-box;
    background: #fff;
}

/* Картинка товара заполняет весь квадрат без обрезания половины */
.market-product-image-preview-wrapper .market-product-image-preview {
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    display: block !important;
    object-fit: cover !important;
    border-radius: 0 !important;
}

@media (max-width: 640px) {
    /* На телефоне блок изображения становится адаптивным */
    .market-product-image-block {
        display: block;
    }

    /* На телефоне изображение занимает доступную ширину */
    .market-product-image-preview-wrapper {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 300px !important;
        aspect-ratio: 1 / 1;
        height: auto !important;
    }
}


/* ======================================================
   Модальное окно добавления в вишлист на страницах маркета
====================================================== */
.wl-modal-content {
    position: relative;
}
.wl-modal-content--with-close {
    position: relative;
    padding-top: 42px;
}
.wl-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #333;
    font-size: 26px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
}
.wl-modal-close:hover,
.wl-modal-close:focus {
    background: #F2ECFF;
    color: var(--wl-purple2);
    outline: none;
}
.wl-modal-content .wl-modal-actions,
.wl-modal-content .wishlist-modal-actions,
.wl-modal-content .wishlist-actions,
.wl-modal-content .modal-actions,
.wl-modal-content--with-close .wl-modal-actions,
.wl-modal-content--with-close .wishlist-modal-actions,
.wl-modal-content--with-close .wishlist-actions,
.wl-modal-content--with-close .modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.wl-modal-content .wl-btn,
.wl-modal-content .wl-btn-small,
.wl-modal-content button:not(.wl-modal-close),
.wl-modal-content a[class*="btn"],
.wl-modal-content--with-close .wl-btn,
.wl-modal-content--with-close .wl-btn-small,
.wl-modal-content--with-close button:not(.wl-modal-close),
.wl-modal-content--with-close a[class*="btn"] {
    margin: 4px;
}

/* ======================================================
   Кабинет продавца: понятный вывод слотов
====================================================== */
.wl-tariff-row {
    margin: 8px 0;
    line-height: 1.45;
}
.wl-tariff-slot-line {
    font-size: 14px;
    color: #333;
}
.wl-tariff-total,
.wl-tariff-used,
.wl-tariff-available {
    font-weight: 700;
}

/* ======================================================
   Модальное окно добавления в вишлист — компактный верх
====================================================== */
#wl-select-wishlist-modal .wl-modal-content,
#wl-create-wishlist-modal .wl-modal-content,
.wl-create-wishlist-modal-content,
.wl-modal-content--with-close {
    padding-top: 18px;
}
#wl-select-wishlist-modal .wl-modal-title,
#wl-create-wishlist-modal .wl-modal-title,
.wl-modal-content > h3:first-child,
.wl-modal-content > .wl-modal-title:first-child {
    margin: 0 0 14px;
    line-height: 1.25;
}
#wl-create-wishlist-modal input[type="text"] {
    width: 100%;
    margin: 4px 0 12px;
}
.wl-modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #999;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
}
.wl-modal-close:hover {
    color: #000;
}

/* Pagination for the unified vendor + partner gift catalog. */
.market-pagination{display:flex;justify-content:center;gap:6px;flex-wrap:wrap;margin:28px 0 8px}.market-pagination .page-numbers{display:inline-flex;align-items:center;justify-content:center;min-width:36px;height:36px;padding:0 10px;border:1px solid #dcdcde;border-radius:6px;text-decoration:none;background:#fff}.market-pagination .page-numbers.current{font-weight:700;background:#f0f0f1}.market-pagination a.page-numbers:hover{border-color:#8c8f94}
