/*
 * eo-kit.css — стили набора для фронта eoCMS (модуль пакета 07-front-kit).
 * Куда: themes/default/css/eo-kit.css. Подключать в header.tpl ПЕРЕД add_style.css (см. header.фрагмент-подключение.tpl),
 * чтобы переопределения переменных в add_style.css действовали (при равной специфичности :root побеждает то, что ниже).
 * По умолчанию палитра переменных — как на Pazaris; для сайта заменить в add_style.css:
 *   :root { --eo-accent: #c0392b; --eo-accent-hover: #a93226; }
 * --eo-accent и --eo-accent-hover общие с модулем 06 (eo-feedback.css): одно переопределение перекрашивает оба модуля.
 */
:root {
	--eo-accent: #4a7ef8;          /* основной цвет: кнопки, рамка главного фото, ползунок (общий с модулем 06) */
	--eo-accent-hover: #3566d6;    /* общий с модулем 06 */
	--eo-accent-disabled: #b9c9f5;
	--eo-accent-soft: #f5f8ff;     /* фон кнопки «Добавить фото» */
	--eo-accent-text: #1a4fb0;     /* текст на светлом акцентном фоне */
	--eo-text: #1b2333;
	--eo-muted: #6b7385;
	--eo-surface: #fff;            /* фон окна */
	--eo-soft: #f2f4f8;            /* светлые кнопки, крестик окна */
	--eo-soft-hover: #e2e7f0;
	--eo-line: #e3e6eb;
	--eo-danger: #e53935;
	--eo-star: #f5b301;
	--eo-drop: #ffb800;            /* подсветка места при перетаскивании */
	--eo-overlay: rgba(16, 24, 40, .5);
	--eo-radius: 24px;             /* скругление окна */
	--eo-radius-sm: 12px;          /* скругление превью фото */
	--eo-font-head: inherit;       /* шрифт заголовка окна, например "manrope-bold", sans-serif */
	--eo-z-modal: 100002;
}

/* ===== 1. Модальные окна ===== */
body.eo-modal-lock { overflow: hidden; }
.eo-modal { display: none; position: fixed; inset: 0; z-index: var(--eo-z-modal); background: var(--eo-overlay); align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
.eo-modal.is-open { display: flex; }
.eo-modal-box { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; background: var(--eo-surface); border-radius: var(--eo-radius); padding: 34px 32px 28px; box-sizing: border-box; color: var(--eo-text); overscroll-behavior: contain; }
.eo-modal-wide { max-width: 760px; }
.eo-modal-box h3 { margin: 0 0 14px; padding: 0 30px; text-align: center; font-family: var(--eo-font-head); font-size: 24px; font-weight: normal; line-height: 1.25; }
.eo-modal-x { position: absolute; top: 12px; right: 14px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--eo-soft); font-size: 22px; line-height: 36px; cursor: pointer; color: var(--eo-text); }
.eo-modal-x:empty::before { content: "\00d7"; }
.eo-modal-x:hover { background: var(--eo-soft-hover); }
.eo-modal-btn { display: inline-block; min-width: 200px; height: 42px; padding: 0 26px; border: 0; border-radius: 22px; background: var(--eo-accent); color: #fff; font: inherit; font-size: 15px; cursor: pointer; text-decoration: none; line-height: 42px; box-sizing: border-box; }
.eo-modal-btn:hover { background: var(--eo-accent-hover); }
.eo-modal-btn[disabled] { background: var(--eo-accent-disabled); cursor: default; }
.eo-modal-btn-light { background: var(--eo-soft); color: var(--eo-text); }
.eo-modal-btn-light:hover { background: var(--eo-soft-hover); }
.eo-modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
@media screen and (max-width: 700px) {
	.eo-modal-box { padding: 30px 18px 22px; border-radius: calc(var(--eo-radius) - 4px); }
	.eo-modal-btn { min-width: 0; }
}

/* ===== 2. Кадрирование фото ===== */
.eo-crop-box { max-width: 420px; text-align: center; }
.eo-crop-view { position: relative; width: 300px; max-width: 100%; aspect-ratio: 1 / 1; margin: 0 auto 16px; overflow: hidden; border-radius: var(--eo-radius-sm); touch-action: none; cursor: grab; background: var(--eo-soft); user-select: none; -webkit-user-select: none; }
.eo-crop-view:active { cursor: grabbing; }
.eo-crop-view:focus-visible { outline: 3px solid var(--eo-accent); outline-offset: 3px; }
.eo-crop-view canvas { width: 100%; height: 100%; display: block; }
/* рамка = ровно та область, что попадёт в файл; круг — вписан в квадрат (аватар показывается с border-radius: 50%) */
.eo-crop-mask { position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85); pointer-events: none; }
.eo-crop-round .eo-crop-mask { border-radius: 50%; box-shadow: 0 0 0 400px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(255, 255, 255, .85); }
.eo-crop-zoom { display: flex; align-items: center; gap: 10px; max-width: 300px; margin: 0 auto 18px; font-size: 20px; color: var(--eo-muted); }
.eo-crop-zoom input { flex: 1; accent-color: var(--eo-accent); }
.eo-crop-btns { display: flex; gap: 10px; justify-content: center; }
.eo-crop-btns .eo-modal-btn { min-width: 0; flex: 1; }
/* круглое фото там, где оно показывается */
.eo-avatar-round { border-radius: 50%; object-fit: cover; aspect-ratio: 1 / 1; }

/* ===== 3. Загрузчик фото ===== */
.eo-photos { position: relative; }
.eo-photos-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 10px; }
.eo-photos-grid:empty { display: none; }
.eo-photo { position: relative; width: 120px; height: 120px; border-radius: var(--eo-radius-sm); overflow: hidden; background: var(--eo-soft); cursor: grab; box-shadow: 0 0 0 1px var(--eo-line); }
.eo-photo img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.eo-photo.eo-photo-main { box-shadow: 0 0 0 3px var(--eo-accent); }
.eo-photo.eo-over { box-shadow: 0 0 0 3px var(--eo-drop); }
.eo-photo.eo-dragging { opacity: .5; }
.eo-photo-badge:empty { display: none; }
.eo-photo-badge { position: absolute; left: 6px; top: 6px; padding: 2px 8px; border-radius: 10px; background: var(--eo-accent); color: #fff; font-size: 12px; line-height: 1.4; }
.eo-photo-tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 4px; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.eo-photo-tools button { flex: 0 0 26px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--eo-text); font-size: 14px; line-height: 26px; padding: 0; cursor: pointer; }
.eo-photo-tools button[disabled] { opacity: .35; cursor: default; }
.eo-photo-tools button[data-a="d"] { color: var(--eo-danger); font-size: 18px; }
.eo-photo-tools button[data-a="m"] { color: var(--eo-star); }
.eo-photo-tools button:focus-visible { outline: 2px solid var(--eo-accent); outline-offset: 1px; }
.eo-photos-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none; overflow: hidden; }
.eo-photos-add { height: 44px; padding: 0 22px; border: 1px dashed var(--eo-accent); border-radius: var(--eo-radius-sm); background: var(--eo-accent-soft); color: var(--eo-accent-text); font: inherit; font-size: 15px; cursor: pointer; }
.eo-photos-drop { outline: 2px dashed var(--eo-accent); outline-offset: 6px; border-radius: var(--eo-radius-sm); }
.eo-photos-msg { display: none; margin: 8px 0 0; font-size: 13px; color: var(--eo-danger); }
.eo-photos-msg.on { display: block; }
.eo-photos-hint { margin: 8px 0 0; font-size: 13px; color: var(--eo-muted); max-width: 560px; }
@media screen and (max-width: 600px) {
	.eo-photo { width: calc(33.33% - 7px); height: auto; aspect-ratio: 1 / 1; }
}

/* ===== 4. Числа: единица измерения внутри поля ===== */
.eo-num-wrap { position: relative; display: inline-block; }
.eo-num-wrap input { padding-right: 44px !important; box-sizing: border-box; }
.eo-num-unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--eo-muted); font-size: 14px; pointer-events: none; }

/* ===== 5. «Поделиться» ===== */
.eo-share-wrap { position: relative; display: inline-block; }
.eo-share-btn { cursor: pointer; }
.eo-share { position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; display: none; flex-wrap: wrap; gap: 8px; width: 280px; max-width: calc(100vw - 32px); padding: 12px; box-sizing: border-box; background: var(--eo-surface); border-radius: 16px; box-shadow: 0 10px 30px rgba(16, 24, 40, .18), 0 0 0 1px var(--eo-line); }
.eo-share.is-open { display: flex; }
.eo-share[hidden] { display: none !important; }
.eo-share-right .eo-share { left: auto; right: 0; }
.eo-sh { display: inline-block; padding: 7px 14px; border-radius: 16px; background: var(--eo-soft); color: var(--eo-text) !important; font-size: 13px; line-height: 1.3; text-decoration: none !important; }
.eo-sh:hover { background: var(--eo-soft-hover); }
.eo-sh-copy { background: var(--eo-accent-soft); color: var(--eo-accent-text) !important; }
.eo-sh-copy.is-done { background: var(--eo-accent); color: #fff !important; }
