/*
|--------------------------------------------------------------------------
| Plugins page
|--------------------------------------------------------------------------
*/

/* Магазин: табы типов товаров */
.shop-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.shop-tab {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--wc-light, #e6e9f0);
    border-radius: 999px;
    background: #fff;
    color: var(--wc-text-muted, #6b7280);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.18s ease;
}

.shop-tab:hover {
    border-color: var(--wc-blue);
    color: var(--wc-blue);
}

.shop-tab.is-active {
    background: var(--wc-blue);
    border-color: var(--wc-blue);
    color: #fff;
}

/* Магазин: кнопка «В корзину» в overlay карточки (в одну строку с «Просмотр»). */
.plugin-card-overlay-content .shop-add-btn {
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: transparent;
    margin-left: 8px;
}

.plugin-card-overlay-content .shop-add-btn:hover {
    background: var(--wc-blue-dark);
    border-color: var(--wc-blue-dark);
}

.plugins-page {
    padding: 80px 0 100px;
    background: var(--wc-white);
}


/*
|--------------------------------------------------------------------------
| Header
|--------------------------------------------------------------------------
*/

.plugins-header {
    max-width: 760px;
    margin-bottom: 50px;
}

.plugins-title {
    margin: 0 0 14px;
    color: var(--wc-black);
    font-size: 42px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.plugins-subtitle {
    max-width: 650px;
    margin: 0 0 18px;
    color: var(--wc-muted);
    font-size: 18px;
    line-height: 1.6;
}

.plugins-count {
    color: var(--wc-muted);
    font-size: 14px;
    font-weight: 600;
}


/*
|--------------------------------------------------------------------------
| Categories filter (templates)
|--------------------------------------------------------------------------
*/

.plugins-page .template-filters {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fc;
    border: 1px solid var(--wc-border, #e5e7eb);
    border-radius: 16px;
}

.plugins-page .template-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 230px;
    flex: 1 1 230px;
}

.plugins-page .template-filter-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--wc-muted, #5b5b7b);
}

.plugins-page .template-select {
    position: relative;
}

.plugins-page .template-select::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--wc-muted, #5b5b7b);
    border-bottom: 2px solid var(--wc-muted, #5b5b7b);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
    transition: border-color .18s, transform .18s;
}

.plugins-page .template-select select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 12px 42px 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--wc-black, #1a1a2e);
    background: #fff;
    border: 1px solid var(--wc-border, #e5e7eb);
    border-radius: 12px;
    cursor: pointer;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}

.plugins-page .template-select select:hover {
    border-color: #c3c9d6;
}

.plugins-page .template-select select:focus {
    border-color: var(--wc-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
}

.plugins-page .template-select select:focus + .template-select-caret,
.plugins-page .template-select:hover::after {
    border-color: var(--wc-primary, #4f46e5);
}

.plugins-page .template-filter-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #b91c1c;
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 12px;
    text-decoration: none;
    transition: background .18s, border-color .18s;
    white-space: nowrap;
}

.plugins-page .template-filter-reset:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

.plugins-page .template-filter-submit {
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--wc-primary, #4f46e5);
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

.plugins-page .plugin-card-category {
    margin-top: 10px;
    font-size: 13px;
    color: var(--wc-muted, #5b5b7b);
}

.plugins-page .plugin-card-category-sep {
    margin: 0 4px;
    color: #aaa;
}


/*
|--------------------------------------------------------------------------
| Detail page (templates)
|--------------------------------------------------------------------------
*/

.plugin-page .plugin-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
}

.plugin-page .plugin-breadcrumb-link {
    color: var(--wc-muted, #5b5b7b);
    text-decoration: none;
    transition: color .18s;
}

.plugin-page .plugin-breadcrumb-link:hover {
    color: var(--wc-primary, #4f46e5);
}

.plugin-page .plugin-breadcrumb-sep {
    color: #aaa;
}

.plugin-page .plugin-breadcrumb-item {
    color: var(--wc-black, #1a1a2e);
    font-weight: 600;
}

.plugin-page .plugin-page-divider {
    height: 1px;
    margin: 18px 0 60px;
    background: var(--wc-border, #e5e7eb);
}

.plugin-page .plugin-price-row {
    margin-top: 18px;
}

.plugin-page .plugin-price {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.plugin-page .plugin-price-amount {
    font-size: 34px;
    font-weight: 800;
    color: var(--wc-black, #1a1a2e);
    letter-spacing: -0.02em;
}

.plugin-page .plugin-price-currency {
    font-size: 22px;
    font-weight: 700;
    color: var(--wc-muted, #5b5b7b);
}

.plugin-page .plugin-actions {
    margin-top: 8px;
}

.plugin-page .plugin-previews {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 8px;
}

.plugin-page .plugin-preview {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 280px;
    height: 180px;
    overflow: hidden;
    border: 1px solid var(--wc-border, #e5e7eb);
    border-radius: 12px;
    background: #fff;
}

.plugin-page .plugin-preview:hover {
    border-color: var(--wc-primary, #4f46e5);
}

.plugin-page .plugin-preview img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.plugin-page .plugin-demo-frame {
    display: block;
    width: 100%;
    height: 480px;
    border: 1px solid var(--wc-border, #e5e7eb);
    border-radius: 12px;
    background: #fff;
}

.plugin-page .plugin-demo-note {
    margin: 12px 0 0;
    color: var(--wc-muted, #5b5b7b);
    font-size: 13px;
}

@media (max-width: 640px) {
    .plugin-page .plugin-demo-frame {
        height: 380px;
    }
}

.plugin-page .plugin-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .85);
    padding: 24px;
    cursor: zoom-out;
}

.plugin-page .plugin-lightbox[hidden] {
    display: none;
}

.plugin-page .plugin-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.plugin-page .plugin-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.plugin-page .plugin-lightbox-close:hover {
    background: rgba(255, 255, 255, .3);
}


/*
|--------------------------------------------------------------------------
| Grid
|--------------------------------------------------------------------------
*/

.plugins-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px 28px;
}


/*
|--------------------------------------------------------------------------
| Card
|--------------------------------------------------------------------------
*/

.plugin-card {
    min-width: 0;
}

.plugin-card-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: var(--wc-light);
    border: 1px solid var(--wc-border);
    border-radius: 10px;
}

.plugin-card-image img {
    display: block;
    width: 100%;
    object-fit: contain;
    transition:
        transform 0.35s ease;
}

.plugin-card:hover .plugin-card-image img {
    transform: scale(1.04);
}

.plugin-card-image--empty {
    color: var(--wc-muted);
    font-size: 14px;
}


/*
|--------------------------------------------------------------------------
| Platform badge
|--------------------------------------------------------------------------
*/

.plugin-card-platform {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;

    display: inline-flex;
    align-items: center;

    min-height: 30px;
    padding: 5px 11px;

    color: var(--wc-white);
    background: var(--wc-black);

    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 6px;

    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}


/*
|--------------------------------------------------------------------------
| Title
|--------------------------------------------------------------------------
*/

.plugin-card-title {
    margin: 0;
    color: var(--wc-black);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.plugin-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 2px 0;
}

.plugin-card-head .plugin-card-title {
    flex: 1;
    min-width: 0;
}

.plugin-card-price {
    flex-shrink: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--wc-primary, #4f46e5);
    padding-top: 2px;
    white-space: nowrap;
}


/*
|--------------------------------------------------------------------------
| Hover overlay
|--------------------------------------------------------------------------
*/

.plugin-card-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;

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

    padding: 28px;

    color: var(--wc-white);
    background: rgba(15, 17, 20, 0.94);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.plugin-card:hover .plugin-card-overlay {
    opacity: 1;
    visibility: visible;
}

/* Touch-устройства без hover: кнопки карточки всегда видимы */
@media (hover: none) and (pointer: coarse) {
    .plugin-card-overlay {
        opacity: 1;
        visibility: visible;
        background: linear-gradient(to top, rgba(15, 17, 20, 0.96) 0%, rgba(15, 17, 20, 0.55) 55%, rgba(15, 17, 20, 0.1) 100%);
        align-items: flex-end;
        padding: 60px 22px 22px;
    }
    .plugin-card-overlay-content {
        transform: none;
        text-align: left;
        margin: 0 auto;
    }
}

.plugin-card-overlay-content {
    width: 100%;
    max-width: 360px;
    text-align: center;

    transform: translateY(10px);

    transition:
        transform 0.25s ease;
}

.plugin-card:hover .plugin-card-overlay-content {
    transform: translateY(0);
}

.plugin-card-overlay-title {
    margin: 0 0 12px;
    color: var(--wc-white);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
}

.plugin-card-overlay-description {
    margin: 0 auto 22px;
    color: #d4d8de;
    font-size: 15px;
    line-height: 1.55;
}


/*
|--------------------------------------------------------------------------
| Button
|--------------------------------------------------------------------------
*/

.plugin-card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 130px;
    padding: 10px 20px;

    color: var(--wc-white);
    background: var(--wc-blue);

    border: 1px solid var(--wc-blue);
    border-radius: 7px;

    font-size: 14px;
    font-weight: 700;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.plugin-card-button:hover {
    color: var(--wc-white);
    background: var(--wc-blue-dark);
    border-color: var(--wc-blue-dark);
    transform: translateY(-1px);
}


/*
|--------------------------------------------------------------------------
| Empty state
|--------------------------------------------------------------------------
*/

.plugins-empty {
    max-width: 600px;
    padding: 45px;
    background: var(--wc-light);
    border: 1px solid var(--wc-border);
    border-radius: 10px;
}

.plugins-empty-title {
    margin: 0 0 10px;
    color: var(--wc-black);
    font-size: 24px;
    font-weight: 700;
}

.plugins-empty-text {
    margin: 0;
    color: var(--wc-muted);
}


/*
|--------------------------------------------------------------------------
| Pagination
|--------------------------------------------------------------------------
*/

.plugins-pagination {
    display: flex;
    justify-content: center;
    margin-top: 60px;
}

.plugins-pagination .pagination {
    gap: 6px;
    margin: 0;
}

.plugins-pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 40px;
    height: 40px;

    color: var(--wc-text);
    background: var(--wc-white);

    border: 1px solid var(--wc-border);
    border-radius: 7px;

    font-size: 14px;
    font-weight: 600;

    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.plugins-pagination .page-link:hover {
    color: var(--wc-blue);
    background: var(--wc-blue-light);
    border-color: #bfdbfe;
}

.plugins-pagination .page-item.active .page-link {
    color: var(--wc-white);
    background: var(--wc-blue);
    border-color: var(--wc-blue);
}


/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 991.98px) {

    .plugins-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .plugins-page {
        padding: 65px 0 80px;
    }

}


@media (max-width: 767.98px) {

    .plugins-grid {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .plugin-card-image {
        height: 280px;
    }

    /* На мобильных и touch без hover кнопки карточки всегда видимы */
    .plugin-card-overlay {
        opacity: 1;
        visibility: visible;
        background: linear-gradient(to top, rgba(15, 17, 20, 0.96) 0%, rgba(15, 17, 20, 0.55) 55%, rgba(15, 17, 20, 0.1) 100%);
        align-items: flex-end;
        padding: 60px 22px 22px;
    }

    .plugin-card-overlay-content {
        transform: none;
        text-align: left;
        margin: 0 auto;
    }

}


@media (max-width: 575.98px) {

    .plugins-page {
        padding: 50px 0 65px;
    }

    .plugins-title {
        font-size: 34px;
    }

    .plugins-subtitle {
        font-size: 16px;
    }

    .plugin-card-image {
        height: 240px;
    }

    .plugin-card-overlay {
        padding: 22px;
    }

}


/*
|--------------------------------------------------------------------------
| Plugin page
|--------------------------------------------------------------------------
*/

.plugin-page {
    padding: 80px 0 100px;
    background: var(--wc-white);
}


/*
|--------------------------------------------------------------------------
| Hero
|--------------------------------------------------------------------------
*/

.plugin-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;

    padding-bottom: 70px;
    border-bottom: 1px solid var(--wc-border);
}

.plugin-hero-image {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    width: 100%;
    height: 320px;

    background: var(--wc-light);
    border: 1px solid var(--wc-border);
    border-radius: 12px;
}

.plugin-hero-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.plugin-hero-image-empty {
    color: var(--wc-muted);
    font-size: 14px;
}


/*
|--------------------------------------------------------------------------
| Hero content
|--------------------------------------------------------------------------
*/

.plugin-hero-content {
    max-width: 100%;
    text-align: end;
}

.plugin-platform {
    display: inline-flex;
    align-items: center;

    min-height: 30px;
    padding: 5px 11px;

    margin-bottom: 18px;

    color: var(--wc-light);
    background: var(--wc-dark);

    border: 1px solid #ffffff;
    border-radius: 6px;

    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.plugin-title {
    margin: 0 0 18px;

    color: var(--wc-black);

    font-size: 44px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.plugin-short-description {
    max-width: 680px;

    margin: 0 0 30px;

    color: var(--wc-muted);

    font-size: 18px;
    line-height: 1.65;
}


/*
|--------------------------------------------------------------------------
| Meta
|--------------------------------------------------------------------------
*/

.plugin-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 32px;
    text-align: end;
    justify-content: flex-end;
}

.plugin-meta-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.plugin-meta-label {
    color: var(--wc-muted);

    font-size: 12px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.plugin-meta-value {
    color: var(--wc-black);

    font-size: 15px;
    font-weight: 700;
}


/*
|--------------------------------------------------------------------------
| Download
|--------------------------------------------------------------------------
*/

.plugin-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.plugin-download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;
    padding: 11px 22px;

    color: var(--wc-white);
    background: var(--wc-blue);

    border: 1px solid var(--wc-blue);
    border-radius: 7px;

    font-size: 14px;
    font-weight: 700;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.plugin-download-button:hover {
    color: var(--wc-white);
    background: var(--wc-blue-dark);
    border-color: var(--wc-blue-dark);

    transform: translateY(-1px);

    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
}


/*
|--------------------------------------------------------------------------
| Content sections
|--------------------------------------------------------------------------
*/

.plugin-section {
    max-width: 100%;

    padding: 60px 0;

    border-bottom: 1px solid var(--wc-border);
}

.plugin-section-title {
    margin: 0 0 24px;

    color: var(--wc-black);

    font-size: 28px;
    font-weight: 800;
    line-height: 1.25;
}

.plugin-description,
.plugin-documentation {
    color: var(--wc-text);

    font-size: 16px;
    line-height: 1.8;
}

.plugin-documentation {
    white-space: normal;
}


/*
|--------------------------------------------------------------------------
| Back
|--------------------------------------------------------------------------
*/

.plugin-back {
    padding-top: 35px;
}

.plugin-back-link {
    color: var(--wc-muted);

    font-size: 14px;
    font-weight: 600;

    transition: color 0.2s ease;
}

.plugin-back-link:hover {
    color: var(--wc-blue);
}


/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 991.98px) {

    .plugin-page {
        padding: 65px 0 80px;
    }

    .plugin-hero {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .plugin-hero-image {
        height: 280px;
    }

    .plugin-title {
        font-size: 36px;
    }

}


@media (max-width: 767.98px) {

    .plugin-hero {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .plugin-hero-image {
        max-width: 360px;
        height: 280px;
    }

    .plugin-title {
        font-size: 34px;
    }

    .plugin-short-description {
        font-size: 16px;
    }

    .plugin-section {
        padding: 45px 0;
    }

}


@media (max-width: 575.98px) {

    .plugin-page {
        padding: 50px 0 65px;
    }

    .plugin-hero-image {
        height: 240px;
    }

    .plugin-title {
        font-size: 30px;
    }

    .plugin-meta {
        gap: 22px;
    }

    .plugin-download-button {
        width: 100%;
    }

}

/* SEO-блок на карточках шаблонов */
.plugin-seo-block p:first-child {
    margin-top: 0;
}

.plugin-seo-block p:last-child {
    margin-bottom: 0;
}

/* Блок призыва к заявке на карточке */
.plugin-cta-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;

    padding: 28px 30px;

    background: var(--wc-soft, #f4f6f8);
    border: 1px solid var(--wc-border, #eaedf1);
    border-radius: 14px;
}

.plugin-cta-title {
    margin: 0;

    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--wc-black);
}

.plugin-cta-text {
    max-width: 620px;
    margin: 0;

    color: var(--wc-muted);
    font-size: 16px;
    line-height: 1.6;
}

.plugin-cta-card .plugin-download-button {
    margin-top: 4px;
}