/*
 * The Centre's pages: catalogue, package page, «Мои лицензии». Plain and
 * built on the theme's tokens (colours, radius, spacing fall back to sane
 * values), so any theme restyles it without touching this file.
 */
.vendor-market {
    max-width: var(--cms-container, 1200px);
    margin: 0 auto;
    padding: clamp(24px, 4vw, 48px) 16px;
}

.vendor-muted {
    color: var(--cms-muted, #6b7280);
    font-size: 0.925em;
}

.vendor-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 16px 0 24px;
}

.vendor-tabs a[aria-current="page"] {
    font-weight: 600;
    text-decoration: none;
}

.vendor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.vendor-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--cms-border, #e5e7eb);
    border-radius: var(--cms-radius, 12px);
    overflow: hidden;
}

.vendor-card__link:hover,
.vendor-card__link:focus-visible {
    border-color: currentColor;
}

.vendor-card__img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: var(--cms-surface, #f3f4f6);
}

.vendor-card__img--empty {
    display: grid;
    place-items: center;
}

.vendor-card__img--empty .cms-icon {
    width: 40px;
    height: 40px;
    opacity: 0.5;
}

.vendor-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px 16px;
}

.vendor-card__title {
    font-size: 1.1em;
}

.vendor-card__price {
    margin-top: auto;
    font-weight: 700;
    font-size: 1.15em;
}

.vendor-crumbs {
    margin: 0 0 12px;
}

.vendor-package__head {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    justify-content: space-between;
    align-items: flex-start;
}

.vendor-package__buy {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: min(100%, 280px);
}

.vendor-package__form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vendor-shots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 12px;
    margin: 24px 0;
}

.vendor-shots img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--cms-radius, 12px);
    border: 1px solid var(--cms-border, #e5e7eb);
}

.vendor-package__releases ul {
    padding-left: 1.2em;
}

/* Account: «Мои лицензии», «Мои загрузки» */
.vendor-licence {
    margin-bottom: 16px;
}

.vendor-licence--revoked {
    opacity: 0.75;
}

.vendor-licence__head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: baseline;
    justify-content: space-between;
}

.vendor-licence__facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
    gap: 8px 16px;
    margin: 12px 0;
}

.vendor-licence__facts dt {
    font-size: 0.85em;
    color: var(--cms-muted, #6b7280);
}

.vendor-licence__facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.vendor-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.85em;
    background: #dcfce7;
    color: #166534;
}

.vendor-badge--revoked {
    background: #fee2e2;
    color: #991b1b;
}

.vendor-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vendor-inline .shop-field__input {
    flex: 1 1 220px;
    min-width: 0;
}

.vendor-key {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0;
}

.vendor-key__text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    word-break: break-all;
    resize: vertical;
}

.vendor-key__copy {
    align-self: flex-start;
}

.vendor-licence__move {
    margin: 8px 0;
}

.vendor-licence__move summary {
    cursor: pointer;
}

.vendor-downloads {
    margin: 0;
    padding: 0;
    list-style: none;
}

.vendor-downloads__row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid var(--cms-border, #e5e7eb);
}

.vendor-downloads__row:first-child {
    border-top: 0;
}

.vendor-downloads__name {
    display: flex;
    flex-direction: column;
}

/* One box per package: the title link stretches over the whole card, the
   module and demo links sit above it. */
.vendor-card__link {
    position: relative;
}

.vendor-card__link:focus-within {
    border-color: currentColor;
}

.vendor-card__stretch {
    color: inherit;
    text-decoration: none;
}

.vendor-card__stretch::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.vendor-card__stretch:focus-visible {
    outline: none;
}

.vendor-card__requires {
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 6px 10px;
    border-radius: 8px;
    background: #fff7e6;
    color: #7a4b00;
    font-size: 0.875em;
}

.vendor-card__requires a {
    color: inherit;
    font-weight: 600;
}

.vendor-card__demo {
    position: relative;
    z-index: 2;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    margin-top: 4px;
    padding: 0 14px;
    border: 1px solid var(--cms-border, #d1d5db);
    border-radius: 999px;
    background: var(--cms-bg, #fff);
    color: inherit;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
}

.vendor-card__demo:hover,
.vendor-card__demo:focus-visible {
    border-color: currentColor;
}

.vendor-card__demo .cms-icon,
.vendor-package__demo .cms-icon {
    width: 16px;
    height: 16px;
}

.vendor-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.vendor-package__demo {
    margin: 12px 0 0;
}

/* Screenshots: open in the lightbox (data-lightbox), zoom mark on hover. */
.vendor-shots__link {
    position: relative;
    display: block;
    cursor: zoom-in;
}

.vendor-shots__zoom {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: rgb(0 0 0 / 0.55);
    color: #fff;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.vendor-shots__zoom .cms-icon {
    width: 18px;
    height: 18px;
}

.vendor-shots__link:hover .vendor-shots__zoom,
.vendor-shots__link:focus-visible .vendor-shots__zoom {
    opacity: 1;
}

@media (hover: none) {
    .vendor-shots__zoom {
        opacity: 1;
    }
}

.vendor-package__text ul {
    padding-left: 1.2em;
}

.vendor-package__text li + li {
    margin-top: 4px;
}

/* «Скачать 100300 CMS» */
.vendor-download__lead {
    max-width: 44rem;
    font-size: 1.1em;
}

.vendor-download__card {
    display: grid;
    gap: 16px;
    margin: 24px 0 32px;
    padding: clamp(20px, 4vw, 32px);
    border: 1px solid var(--cms-border, #e5e7eb);
    border-radius: var(--cms-radius, 12px);
}

.vendor-download__version {
    margin: 0;
}

.vendor-download__button {
    justify-self: start;
    min-height: 56px;
    padding-inline: 28px;
    font-size: 1.1em;
}

.vendor-download__facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
    gap: 12px 24px;
    margin: 0;
}

.vendor-download__facts dt {
    font-size: 0.85em;
    color: var(--cms-muted, #6b7280);
}

.vendor-download__facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.vendor-download__sha {
    grid-column: 1 / -1;
}

.vendor-download__sha code {
    font-size: 0.85em;
    word-break: break-all;
}

.vendor-download__cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 24px 48px;
}

.vendor-download__list,
.vendor-download__steps {
    padding-left: 1.3em;
}

.vendor-download__list li + li,
.vendor-download__steps li + li {
    margin-top: 8px;
}

@media (max-width: 480px) {
    .vendor-download__button {
        justify-self: stretch;
        justify-content: center;
    }
}

/* «Смотреть демо» (/market/<code>/demo): a slim bar over the demo in a frame.
   A page of its own (no theme), so it carries its own look. */
.vendor-demo {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    background: #e9e9ef;
    color: #fff;
    font: 500 14px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.vendor-demo *,
.vendor-demo *::before,
.vendor-demo *::after {
    box-sizing: border-box;
}

.vendor-demo .cms-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
}

.vendor-demo__radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.vendor-demo__bar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
    background: #15151c;
    box-shadow: 0 2px 12px rgb(0 0 0 / 0.2);
}

.vendor-demo__name {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-right: auto;
}

.vendor-demo__name strong {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vendor-demo__name span {
    color: rgb(255 255 255 / 0.65);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vendor-demo__devices {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: rgb(255 255 255 / 0.1);
}

.vendor-demo__devices label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    color: rgb(255 255 255 / 0.8);
    cursor: pointer;
    user-select: none;
}

.vendor-demo__devices label:hover {
    color: #fff;
}

#device-desktop:checked ~ .vendor-demo__bar label[for="device-desktop"],
#device-tablet:checked ~ .vendor-demo__bar label[for="device-tablet"],
#device-phone:checked ~ .vendor-demo__bar label[for="device-phone"] {
    background: #fff;
    color: #15151c;
}

#device-desktop:focus-visible ~ .vendor-demo__bar label[for="device-desktop"],
#device-tablet:focus-visible ~ .vendor-demo__bar label[for="device-tablet"],
#device-phone:focus-visible ~ .vendor-demo__bar label[for="device-phone"] {
    outline: 2px solid #8b7dff;
    outline-offset: 2px;
}

.vendor-demo__buy {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vendor-demo__price {
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
}

.vendor-demo__cta,
.vendor-demo__close {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    color: inherit;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.vendor-demo__cta {
    background: #fff;
    color: #15151c;
}

.vendor-demo__cta:hover {
    background: #e9e9f1;
}

.vendor-demo__close {
    border: 1px solid rgb(255 255 255 / 0.3);
}

.vendor-demo__close:hover {
    background: rgb(255 255 255 / 0.12);
}

.vendor-demo__cta:focus-visible,
.vendor-demo__close:focus-visible {
    outline: 2px solid #8b7dff;
    outline-offset: 2px;
}

.vendor-demo__stage {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    min-height: 0;
    overflow: auto;
}

.vendor-demo__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
    transition: width 0.25s ease, margin 0.25s ease;
}

#device-tablet:checked ~ .vendor-demo__stage .vendor-demo__frame,
#device-phone:checked ~ .vendor-demo__stage .vendor-demo__frame {
    margin: 16px 0;
    height: calc(100% - 32px);
    border-radius: 16px;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08), 0 20px 50px -20px rgb(0 0 0 / 0.35);
}

#device-tablet:checked ~ .vendor-demo__stage .vendor-demo__frame {
    width: 768px;
    max-width: calc(100% - 32px);
}

#device-phone:checked ~ .vendor-demo__stage .vendor-demo__frame {
    width: 390px;
    max-width: calc(100% - 32px);
}

@media (max-width: 1100px) {
    .vendor-demo__devices label span {
        display: none;
    }
}

/* A phone or small tablet: the frame is the screen; a compact bar. */
@media (max-width: 767px) {
    .vendor-demo__devices {
        display: none;
    }

    .vendor-demo__bar {
        gap: 8px;
        min-height: 48px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .vendor-demo__name strong {
        font-size: 14px;
    }

    .vendor-demo__name span {
        font-size: 12px;
    }

    .vendor-demo__price {
        display: none;
    }

    .vendor-demo__cta,
    .vendor-demo__close {
        min-height: 34px;
        padding: 0 12px;
    }

    .vendor-demo__close-text {
        display: none;
    }

    .vendor-demo__close {
        width: 34px;
        padding: 0;
        justify-content: center;
    }

    .vendor-demo .vendor-demo__stage .vendor-demo__frame {
        width: 100%;
        max-width: none;
        height: 100%;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vendor-demo__frame {
        transition: none;
    }
}

/* «Для работы шаблона нужен модуль …» next to the price */
.vendor-package__requires {
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff7e6;
    color: #6b4200;
    font-size: 0.925em;
}

.vendor-package__requires p {
    margin: 0 0 6px;
}

.vendor-package__requires ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.vendor-package__requires li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
}

.vendor-package__requires a {
    color: inherit;
    font-weight: 600;
}

.vendor-package__requires-buy {
    margin-left: auto;
}

/* Themes give h2 a top margin; the card has its own spacing. */
.vendor-download .vendor-download__version {
    margin: 0;
}

.vendor-download .vendor-download__button {
    min-height: 60px;
    padding-inline: 32px;
    font-size: 1.15rem;
}

.vendor-download .vendor-download__button .cms-icon {
    width: 22px;
    height: 22px;
}
