/* ============================================
   Блок загрузки фото на страницах режимов редактора (23.11.2026)
   Разметка: template-parts/ozm-upload.php, скрипт: assets/js/ozm-upload.js
   Все правила с префиксом .ozm-up- — чужие классы не трогаем. Цвета — как у поля фото в редакторе (editor.css)
   ============================================ */
.ozm-up {
    --ozm-up-green: #078d66;
    --ozm-up-ink: #1f2a27;
    --ozm-up-muted: #5b6763;
    --ozm-up-line: #d1d5db;
    --ozm-up-soft: #f3faf7;
    --ozm-up-pink: #fce8ec;
    --ozm-up-tile: 160px;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}
.ozm-up *,
.ozm-up *::before,
.ozm-up *::after { box-sizing: border-box; }

.ozm-up-file {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ---------- Плитки «Фото 1», «Фото 2»… ---------- */
.ozm-up-tiles {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin: 0 0 20px;
}
.ozm-up-tile {
    position: relative;
    flex: 0 0 var(--ozm-up-tile);
    width: var(--ozm-up-tile);
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: #fff;
    border: 2px dashed var(--ozm-up-line);
    border-radius: 16px;
    color: var(--ozm-up-ink);
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
a.ozm-up-tile:hover,
.ozm-up-tile.is-empty:hover,
.ozm-up.is-over .ozm-up-tile.is-empty {
    border-color: var(--ozm-up-green);
    background: var(--ozm-up-soft);
}
.ozm-up-tile:focus-visible,
.ozm-up-zone:focus-visible {
    outline: 3px solid #0b5f46;
    outline-offset: 3px;
}
.ozm-up-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--ozm-up-pink);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.ozm-up-icon img { width: 32px; height: 32px; display: block; }
.ozm-up-tile-name {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
}
.ozm-up-tile-sub {
    display: block;
    margin-top: 2px;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--ozm-up-muted);
}
/* третья и четвёртая плитки — «добавить ещё», спокойнее основных */
.ozm-up-tile.is-extra .ozm-up-icon { width: 44px; height: 44px; background: #eef3f1; color: var(--ozm-up-green); font-size: 1.6rem; font-weight: 400; line-height: 1; }

/* выбранное фото */
.ozm-up-tile.is-filled {
    padding: 0;
    border: 1px solid #dfe8e5;
    background: #e9efed;
    cursor: default;
}
.ozm-up-tile.is-filled img.ozm-up-prev {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ozm-up-heic {
    font-size: 0.85rem;
    color: var(--ozm-up-muted);
    padding: 0 10px;
    line-height: 1.3;
}
.ozm-up-tag {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(31, 42, 39, 0.78);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
}
.ozm-up-x {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: var(--ozm-up-ink);
    font-size: 20px;
    line-height: 32px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.ozm-up-x::before { content: ""; position: absolute; inset: -6px; } /* палец попадает легче */
.ozm-up-x:hover { background: #fff; color: #a30834; }
.ozm-up-x:focus-visible { outline: 3px solid #0b5f46; outline-offset: 2px; }

/* ---------- Кнопка и подсказка ---------- */
.ozm-up .ozm-up-go[aria-disabled="true"] {
    background: #b7c6c1;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}
.ozm-up .ozm-up-go.is-busy { opacity: 0.85; cursor: progress; }
.ozm-up-hint,
.ozm-up-err {
    margin: 10px 0 0;
    font-size: 0.92rem;
    line-height: 1.45;
}
.ozm-up-hint { color: var(--ozm-up-muted); }
.ozm-up-hint:empty { display: none; }
.ozm-up-err { color: #a30834; font-weight: 600; }
/* нажали неактивную кнопку — подсказка коротко подсвечивается */
.ozm-up-hint.is-flash { animation: ozm-up-flash 0.9s ease; }
@keyframes ozm-up-flash { 0%, 100% { color: var(--ozm-up-muted); } 25%, 60% { color: #a30834; } }

/* ---------- Одна зона (режимы с одним фото) ---------- */
.ozm-up-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 560px;
    margin: 0 auto;
    padding: 28px 20px;
    background: #fff;
    border: 2px dashed var(--ozm-up-line);
    border-radius: 16px;
    color: var(--ozm-up-ink);
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.ozm-up-zone:hover,
.ozm-up.is-over .ozm-up-zone { border-color: var(--ozm-up-green); background: var(--ozm-up-soft); }
.ozm-up-zone .ozm-up-icon { margin-bottom: 6px; }
.ozm-up-zone-title { font-weight: 700; font-size: 1.15rem; }
.ozm-up-zone-sub { color: var(--ozm-up-muted); font-size: 0.95rem; }
.ozm-up-zone .ozm-up-zone-btn { margin-top: 10px; }

/* ---------- Телефон ---------- */
@media (max-width: 768px) {
    .ozm-up-tiles { gap: 12px; margin-bottom: 18px; }
    .ozm-up-tile {
        flex: 0 0 calc(50% - 6px);
        width: calc(50% - 6px);
        max-width: 156px;
    }
    /* «Фото 3, по желанию» на телефоне — низкая строка во всю ширину, чтобы кнопка оставалась на первом экране */
    .ozm-up-tile.is-extra {
        flex: 0 0 100%;
        width: 100%;
        max-width: 324px;
        aspect-ratio: auto;
        min-height: 52px;
        flex-direction: row;
        gap: 10px;
        padding: 6px 14px;
        border-radius: 14px;
    }
    .ozm-up-tile.is-extra .ozm-up-icon { width: 32px; height: 32px; font-size: 1.3rem; }
    .ozm-up-tile.is-extra .ozm-up-tile-name { display: flex; align-items: baseline; gap: 6px; }
    .ozm-up-tile.is-extra .ozm-up-tile-sub { margin-top: 0; }
    .ozm-up-icon { width: 56px; height: 56px; }
    .ozm-up-icon img { width: 28px; height: 28px; }
    .ozm-up-x { width: 36px; height: 36px; line-height: 36px; }
    .ozm-up-zone { padding: 24px 16px; }
    .ozm-up-zone-sub.is-desk { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ozm-up-tile,
    .ozm-up-zone { transition: none; }
    .ozm-up-hint.is-flash { animation: none; }
}

