/* Персоналізація v2 (Fable, 21.10.2026). Токени сайту: --ink #190a03, стани сині #1c49c2, плашки #f5f5f5/#ebebeb, amber лише дія.
   Макет: docs/personalization-2026-10-21/mock/mock-v1.html. Компоненти: .amg-pz (панель), .amg-pz-st (рядок стану),
   .amg-pz-need (брак даних), .amg-pz-sheet (шторка/поповер), .amg-pz-flag (бейдж картки), .amg-pz-fit (рядок PDP), .amg-pz-toast. */

.amg-pz,.amg-pz *{box-sizing:border-box}
.amg-pz{display:flex;align-items:center;gap:8px;margin:8px 0 0;padding:8px 10px 8px 8px;border:1.5px solid #ebebeb;border-radius:14px;background:#fff;color:#190a03;font-family:inherit;min-width:0}
.amg-pz.is-on{border-color:#d9e6f4;background:#f0f6fc}
.amg-pz__ava{width:30px;height:30px;border-radius:50%;background:#fff;border:1.5px solid #ebebeb;overflow:hidden;flex:0 0 30px}
.amg-pz__ava img{width:100%;height:100%;object-fit:cover;display:block}
.amg-pz__t{flex:1;min-width:0}
.amg-pz__name{display:block;font-size:14px;font-weight:800;line-height:1.2}
.amg-pz__sum{display:block;font-size:12px;color:#6b6660;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.amg-pz.is-on .amg-pz__sum{color:#143795}
.amg-pz__edit{height:30px;padding:0 11px;border:1.5px solid #190a03;border-radius:15px;background:#fff;font-weight:700;font-size:13px;line-height:1;font-family:inherit;color:#190a03;display:inline-flex;align-items:center;gap:5px;cursor:pointer;flex:0 0 auto;font-family:inherit}
.amg-pz__edit svg{width:13px;height:13px}
@media (hover:hover) and (pointer:fine){.amg-pz__edit:hover{background:#f5f5f5}}
.amg-pz__edit:focus-visible,.amg-pz-sw:focus-visible{outline:2px solid #1c49c2;outline-offset:2px}

/* switch: діє одразу, без «Готово» */
.amg-pz-sw{position:relative;width:44px;height:26px;border-radius:13px;background:#cccccc;flex:0 0 44px;cursor:pointer;border:0;padding:0;transition:background .15s}
.amg-pz-sw::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);transition:left .15s}
.amg-pz-sw[aria-checked="true"]{background:#1c49c2}
.amg-pz-sw[aria-checked="true"]::after{left:21px}
.amg-pz-sw.is-busy{opacity:.6;pointer-events:none}
@media (prefers-reduced-motion:reduce){.amg-pz-sw,.amg-pz-sw::after{transition:none}}

/* рядок стану */
.amg-pz-st{margin:6px 0 0;font-size:12.5px;color:#333;display:flex;flex-wrap:wrap;gap:4px 10px;align-items:center}
.amg-pz-st a,.amg-pz-st button{color:#143795;font-weight:700;text-decoration:none;background:none;border:0;padding:0;font:inherit;font-weight:700;cursor:pointer}
.amg-pz-st__dot{width:6px;height:6px;border-radius:50%;background:#1c49c2;display:inline-block;margin-right:5px;vertical-align:1px}

/* брак даних, не попап */
.amg-pz-need{margin:8px 0 0;background:#f5f5f5;border:1px solid #ebebeb;border-radius:12px;padding:8px 10px;font-size:12.5px;display:flex;gap:8px;align-items:center;color:#190a03}
.amg-pz-need__i{width:16px;height:16px;border-radius:50%;background:#e8762d;flex:0 0 16px;display:inline-grid;place-items:center;color:#fff;font-style:normal;font-weight:800;font-size:11px}
.amg-pz-need__go{color:#143795;font-weight:700;background:none;border:0;padding:0;font:inherit;font-weight:700;margin-left:auto;white-space:nowrap;cursor:pointer}
.amg-pz-need__x{background:none;border:0;color:#6b6660;font-size:18px;line-height:1;padding:0 2px;cursor:pointer}

/* бейдж картки (нижній лівий кут фото; верхній лівий зайнятий сейлом) */
.amg-pz-flag{position:absolute;left:6px;bottom:6px;right:6px;z-index:2;background:rgba(255,255,255,.96);border:1px solid #ebebeb;border-radius:8px;padding:4px 7px;font-size:11px;font-weight:700;line-height:1.2;display:flex;gap:5px;align-items:center;color:#190a03;pointer-events:none}
.amg-pz-flag::before{content:"";width:7px;height:7px;border-radius:50%;background:#e8762d;flex:0 0 7px}
.amg-pz-flag.is-ok{color:#2e7d32}
.amg-pz-flag.is-ok::before{background:#2e7d32}
body.amg-pz-off .amg-pz-flag{display:none}

/* рядок на сторінці товару */
.amg-pz-fit{margin:10px 0;border:1px solid #ebebeb;background:#f5f5f5;border-radius:12px;padding:9px 11px;font-size:13px;display:flex;gap:8px;align-items:flex-start;color:#190a03}
.amg-pz-fit::before{content:"";width:16px;height:16px;border-radius:50%;background:#e8762d;flex:0 0 16px;margin-top:1px}
.amg-pz-fit.is-ok::before{background:#2e7d32}
.amg-pz-fit b{display:block}
.amg-pz-fit a,.amg-pz-fit button{color:#143795;font-weight:700;text-decoration:none;margin-right:10px;background:none;border:0;padding:0;font:inherit;font-weight:700;cursor:pointer}

/* шторка (телефон) / поповер (ПК) */
.amg-pz-dim{position:fixed;inset:0;background:rgba(25,10,3,.35);z-index:10000}
.amg-pz-sheet{position:fixed;left:0;right:0;bottom:0;z-index:10001;background:#fff;color:#190a03;border-radius:22px 22px 0 0;box-shadow:0 -12px 40px rgba(25,10,3,.18);padding:10px 16px calc(18px + env(safe-area-inset-bottom,0px));max-height:92vh;overflow:auto;font-family:inherit}
.amg-pz-sheet__grab{width:36px;height:4px;border-radius:2px;background:#cccccc;margin:0 auto 12px}
.amg-pz-sheet__head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.amg-pz-sheet__head b{font-size:18px;font-weight:800;flex:1;line-height:1.2}
.amg-pz-sheet__head small{display:block;font-size:12px;color:#6b6660;font-weight:600}
.amg-pz-sheet__x{background:none;border:0;font-size:22px;line-height:1;color:#6b6660;padding:4px;cursor:pointer}
@media (min-width:1024px){
  .amg-pz-dim{background:transparent}
  .amg-pz-sheet{position:absolute;left:auto;right:auto;bottom:auto;width:420px;max-height:80vh;border-radius:16px;border:1.5px solid #ebebeb;box-shadow:0 14px 40px rgba(25,10,3,.14);padding:12px 14px 14px}
  .amg-pz-sheet__grab{display:none}
}
.amg-pz-pets{display:flex;gap:8px;margin:4px 0 12px;flex-wrap:wrap}
.amg-pz-pet{display:inline-flex;align-items:center;gap:7px;height:38px;padding:0 12px 0 4px;border:1.5px solid #ebebeb;border-radius:19px;font-weight:800;font-size:13.5px;background:#fff;color:#190a03;cursor:pointer;font-family:inherit}
.amg-pz-pet .amg-pz__ava{width:28px;height:28px;flex-basis:28px}
.amg-pz-pet.is-on{background:#f0f6fc;border-color:#1c49c2;color:#143795}
.amg-pz-pet--add{color:#6b6660;font-weight:700;padding-left:12px}
.amg-pz-sec{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#6b6660;font-weight:700;margin:12px 0 6px}
.amg-pz-facts{display:flex;flex-direction:column;border:1.5px solid #ebebeb;border-radius:14px;overflow:hidden}
.amg-pz-fact{display:flex;align-items:center;gap:10px;padding:10px 12px;border-top:1px solid #ebebeb;font-size:14px;min-width:0}
.amg-pz-fact:first-child{border-top:0}
.amg-pz-fact__k{color:#6b6660;font-weight:600;flex:0 0 108px}
.amg-pz-fact__v{font-weight:800;flex:1;min-width:0}
.amg-pz-fact__v small{display:block;font-weight:600;color:#6b6660;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.amg-pz-fact__v.is-empty{color:#6b6660;font-weight:600}
.amg-pz-fact__go{color:#143795;font-weight:800;font-size:13px;white-space:nowrap;background:none;border:0;padding:0;font-family:inherit;cursor:pointer}
.amg-pz-fact__n{font-variant-numeric:tabular-nums;color:#6b6660;font-weight:700;font-size:13px;min-width:44px;text-align:right}
.amg-pz-fact--rule .amg-pz-fact__v{font-weight:600}
.amg-pz-seg{display:flex;border:1.5px solid #ebebeb;border-radius:12px;overflow:hidden;width:100%}
.amg-pz-seg button{flex:1;text-align:center;padding:9px 6px;font-weight:700;font-size:13px;color:#6b6660;background:#fff;border:0;border-left:1px solid #ebebeb;font-family:inherit;cursor:pointer}
.amg-pz-seg button:first-child{border-left:0}
.amg-pz-seg button.is-on{background:#f0f6fc;color:#143795;font-weight:800}
.amg-pz-chips{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 2px}
.amg-pz-chip{height:34px;padding:0 12px;border:1.5px solid #ebebeb;border-radius:17px;font-size:13px;font-weight:700;display:inline-flex;align-items:center;white-space:nowrap;color:#190a03;background:#fff;font-family:inherit;cursor:pointer}
.amg-pz-chip.is-on{background:#f0f6fc;border-color:#1c49c2;color:#143795}
.amg-pz-chip--grp{border-style:dashed}
.amg-pz-chip--grp.is-on{border-style:solid}
.amg-pz-inline{display:flex;gap:8px;align-items:center;width:100%}
.amg-pz-inline input{height:36px;border:1.5px solid #ebebeb;border-radius:10px;padding:0 10px;font-weight:600;font-size:14px;line-height:1;font-family:inherit;color:#190a03;min-width:0;flex:1;font-family:inherit}
.amg-pz-inline input:focus{outline:2px solid #1c49c2;outline-offset:1px;border-color:#1c49c2}
.amg-pz-inline button{height:36px;padding:0 12px;border-radius:18px;background:#ffba00;color:#190a03;border:0;font-weight:800;font-size:13px;line-height:1;font-family:inherit;font-family:inherit;cursor:pointer}
.amg-pz-note{font-size:12.5px;color:#6b6660;margin:10px 0 0}
.amg-pz-foot{margin-top:12px;display:flex;justify-content:space-between;align-items:center;font-size:13px;gap:10px;flex-wrap:wrap}
.amg-pz-link{color:#143795;font-weight:800;text-decoration:none;font-size:13.5px;background:none;border:0;padding:0;font-family:inherit;cursor:pointer}
.amg-pz-muted{color:#6b6660}
.amg-pz-list{list-style:none;margin:0;padding:0}
.amg-pz-list li{display:flex;align-items:center;gap:8px;padding:8px 0;border-top:1px solid #ebebeb;font-size:13.5px}
.amg-pz-list li:first-child{border-top:0}
.amg-pz-list li span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.amg-pz-list li small{color:#6b6660;font-weight:600}
.amg-pz-list li button{color:#cf1124;font-weight:700;background:none;border:0;padding:0;font:inherit;font-weight:700;cursor:pointer}
.amg-pz-cta{display:block;width:100%;height:46px;border-radius:23px;background:#ffba00;color:#190a03;border:0;font-weight:800;font-size:15px;line-height:1;font-family:inherit;font-family:inherit;cursor:pointer;margin-top:12px}
.amg-pz-radio{display:flex;align-items:center;gap:10px;padding:10px 12px;border-top:1px solid #ebebeb;font-size:14px;cursor:pointer}
.amg-pz-radio:first-child{border-top:0}
.amg-pz-radio input{width:18px;height:18px;accent-color:#1c49c2;margin:0}
.amg-pz-radio b{display:block}
.amg-pz-radio small{display:block;color:#6b6660;font-weight:600;font-size:12px}

/* тост */
.amg-pz-toast{position:fixed;left:16px;right:16px;bottom:calc(18px + env(safe-area-inset-bottom,0px));z-index:10002;background:#190a03;color:#fff;border-radius:12px;padding:10px 14px;font-size:13px;font-weight:700;display:flex;justify-content:space-between;align-items:center;gap:10px}
.amg-pz-toast button{color:#ffba00;background:none;border:0;padding:0;font:inherit;font-weight:800;cursor:pointer}
@media (min-width:1024px){.amg-pz-toast{left:auto;right:24px;width:380px}}

/* PDP: кнопка «Не підходить Мурчику» під «Купити» (друкує amg-persona.php як #amg-pz-dislike) */
#amg-pz-dislike{display:block;width:100%;min-height:44px;margin-top:8px;border:1.5px solid #190a03;border-radius:22px;background:#fff;color:#190a03;font-weight:800;font-size:14px;line-height:1;font-family:inherit;font-family:inherit;cursor:pointer}
#amg-pz-dislike[hidden]{display:none}
@media (hover:hover) and (pointer:fine){#amg-pz-dislike:hover{background:#f5f5f5}}

/* ── Перекриття стилів теми (≤768 px тема дає button min-height 44px і padding 9px 16px) ── */
.amg-pz-st button,.amg-pz-fit button,.amg-pz-fit a,.amg-pz-need__go,.amg-pz-need__x,.amg-pz-fact__go,.amg-pz-link,.amg-pz-sheet__x,.amg-pz-list li button,.amg-pz-toast button{min-height:0!important;height:auto!important;padding:0!important;margin:0!important;line-height:inherit!important;background:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;text-transform:none!important;letter-spacing:0!important;font-size:inherit!important;display:inline!important;width:auto!important}
.amg-pz-need__go{margin-left:auto!important}
.amg-pz-fit a,.amg-pz-fit button{margin-right:10px!important}
.amg-pz-sheet__x{font-size:22px!important;padding:4px!important}
.amg-pz__edit,.amg-pz-sw,.amg-pz-pet,.amg-pz-chip,.amg-pz-seg button,.amg-pz-inline button,.amg-pz-cta{min-height:0!important;text-transform:none!important;letter-spacing:0!important;box-shadow:none!important}
.amg-pz__edit{height:30px!important;padding:0 11px!important;border-radius:15px!important}
.amg-pz-sw{width:44px!important;height:26px!important;padding:0!important;border-radius:13px!important}
.amg-pz-pet{height:38px!important;padding:0 12px 0 4px!important;border-radius:19px!important}
.amg-pz-pet--add{padding-left:12px!important}
.amg-pz-chip{height:34px!important;padding:0 12px!important;border-radius:17px!important}
.amg-pz-seg button{padding:9px 6px!important;border-radius:0!important}
.amg-pz-inline button{height:36px!important;padding:0 12px!important;border-radius:18px!important}
.amg-pz-cta{height:46px!important;padding:0!important;border-radius:23px!important;width:100%!important}
#amg-pz-dislike{height:40px!important;min-height:0!important;padding:0!important;border:1.5px solid #190a03!important;border-radius:20px!important;background:#fff!important;color:#190a03!important;font-weight:800!important;font-size:14px!important;line-height:1!important;font-family:inherit!important;font-family:inherit!important;text-transform:none!important;letter-spacing:0!important;box-shadow:none!important;width:100%!important;margin:8px 0 0!important}
#amg-pz-dislike[hidden]{display:none!important}

/* бейдж над крапками слайдера фото (cg.js): коли є бейдж, крапки ховаємо; у shadow DOM amgv-cards ці 2 правила теж треба підставити */
.amg-pz-has-flag .amg-cg__dots{display:none!important}
.amg-pz-flag{bottom:6px}

/* шторка відкрита: плаваючі елементи сайту (кружок з фото улюбленця, липкі кнопки) не мають лізти поверх; точний селектор кружка додає бекенд через amg_pz_sheet_hide_selectors */
body.amg-pz-sheet-open .amg-pcn,body.amg-pz-sheet-open .amigo-toast-container{display:none!important}
/* стерилізація: три стани в один рядок */
.amg-pz-seg button{font-size:12.5px!important;padding:9px 3px!important;white-space:nowrap;letter-spacing:-.01em}
/* «оченята» (amg-egg3, z-index 999980) не лізуть на шторку */
body.amg-pz-sheet-open .amg-egg3{display:none!important}
