/* #17 Модалка логотипа */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition);
    z-index: 2000;
}

.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.logo-modal {
    position: fixed;
    width: min(780px, 92vw);
    max-height: 84vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .45);
    display: none;
    flex-direction: column;
    z-index: 2001;
    overflow: hidden;
    --logo-fill: var(--bg-card);
}

.logo-modal.open {
    display: flex;
}

.logo-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    cursor: move;
    user-select: none;
    touch-action: none;
    font-weight: 600;
    font-size: 15px;
}

.logo-modal__hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}

.logo-modal__close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-modal__close:hover {
    background: var(--border);
}

.logo-modal__body {
    padding: 20px;
    overflow-y: auto;
}

.modal-variant {
    margin-bottom: 26px;
}

.modal-variant:last-child {
    margin-bottom: 0;
}

.modal-variant h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.modal-swatches {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 560px) {
    .modal-swatches {
        grid-template-columns: 1fr;
    }
}

.modal-swatch {
    border-radius: 8px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    border: 1px solid var(--border);
}

.modal-swatch--dark {
    background: #1a1816;
    color: #f0ebe5;
    --logo-fill: #1a1816;
}

.modal-swatch--light {
    background: #f6f3f0;
    color: #2a2520;
    --logo-fill: #f6f3f0;
}

/* #18 Модалка скриншота WB */
.wb-modal {
    width: min(430px, 92vw);
    z-index: 2002;
}

.wb-modal .logo-modal__body {
    padding: 12px;
}

.wb-modal .logo-modal__body img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

/* #21b Модалка технических данных */
.tech-modal {
    position: fixed;
    top: 0;
    left: 0;
    transform: scale(.97);
    width: min(620px, 94vw);
    max-height: 86vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
    display: flex;
    flex-direction: column;
    z-index: 2100;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}

.tech-modal.open {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.tech-modal__header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--border);
    cursor: move;
    user-select: none;
    touch-action: none;
}

.tech-modal.dragging {
    transition: none;
}

.tech-modal.dragging .tech-modal__header {
    cursor: grabbing;
}

.tech-modal__header button {
    cursor: pointer;
}

.tech-modal__icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: 10px;
}

.tech-modal__icon .svg-icon {
    width: 22px;
    height: 22px;
}

.tech-modal__title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
}

.tech-modal__subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

.tech-modal__close {
    margin-left: auto;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.tech-modal__close:hover {
    background: var(--border);
    color: var(--text-primary);
}

.tech-modal__body {
    padding: 18px 24px;
    overflow-y: auto;
}

.tech-rows {
    display: flex;
    flex-direction: column;
}

.tech-row {
    display: flex;
    gap: 12px;
    padding: 7px 0;
    font-size: 13px;
    border-bottom: 1px dashed var(--border);
    align-items: center;
}

.tech-row:last-child {
    border-bottom: none;
}

.tech-row__k {
    flex: 0 0 168px;
    color: var(--text-muted);
}

.tech-row__v {
    flex: 1;
    word-break: break-word;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.tech-row__v--ua {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 11.5px;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .tech-row {
        flex-direction: column;
        gap: 2px;
    }
    .tech-row__k {
        flex: none;
    }
}

.tech-perm-btn {
    margin-left: 10px;
    padding: 2px 10px;
    font-size: 11px;
    font-family: inherit;
    font-weight: 500;
    line-height: 1.5;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    vertical-align: middle;
    white-space: nowrap;
}

.tech-perm-btn:hover {
    background: var(--accent);
    color: #fff;
}

.tech-perm-btn:disabled {
    opacity: .5;
    cursor: wait;
}

.tech-perm-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* #21c Модалка языков */
.lang-modal {
    position: fixed;
    top: 0;
    left: 0;
    transform: scale(.97);
    width: min(540px, 94vw);
    max-height: 86vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
    display: flex;
    flex-direction: column;
    z-index: 2100;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}

.lang-modal.open {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.lang-modal.dragging {
    transition: none;
}

.lang-modal__body {
    padding: 14px 20px;
    overflow-y: auto;
}

.lang-group-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    margin: 16px 0 8px;
    padding-left: 8px;
}

.lang-group-title:first-child {
    margin-top: 0;
}

.lang-row {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all var(--transition);
    gap: 14px;
}

.lang-row:hover {
    background: var(--bg-secondary);
    border-color: var(--border);
}

.lang-row:active {
    transform: scale(.98);
}

.lang-flag {
    font-size: 22px;
    width: 30px;
    flex-shrink: 0;
    text-align: center;
    line-height: 1;
}

.lang-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.lang-info__ru {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.lang-info__native {
    font-size: 12px;
    color: var(--text-muted);
}

.lang-row.is-active {
    background: var(--accent-bg);
    border-color: var(--accent);
}

.lang-row.is-active .lang-info__ru {
    color: var(--accent);
}

.lang-check {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-left: 8px;
}

.lang-row.is-active .lang-check {
    display: flex;
}

/* Непереведённые языки */
.lang-row[data-has-translation="false"] {
    opacity: .55;
}

.lang-row[data-has-translation="false"]:hover {
    opacity: .8;
}

.lang-badge {
    margin-left: auto;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-radius: 20px;
    background: var(--border);
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.5;
}

.lang-row.is-active .lang-badge {
    background: var(--accent-bg);
    color: var(--accent);
}