/* Cookie & Tracking v0.2 — site-file-driven visual choices, no tracking. */
.bpm-cookie-root {
  --bpm-bg:#ffffff; --bpm-fg:#172338; --bpm-primary:#1554a7;
  --bpm-button-text:#ffffff; --bpm-border:#c4cad6; --bpm-font-size:15px;
  --bpm-padding:20px; --bpm-radius:12px; --bpm-opacity:1; --bpm-max-width:448px;
}
.bpm-cookie-root .bpm-cookie-dialog {
  box-sizing:border-box; position:fixed; bottom:var(--bpm-edge,16px); right:var(--bpm-edge,16px); z-index:2147482000;
  width:min(var(--bpm-max-width), calc(100vw - 2 * var(--bpm-edge,16px))); max-height:90vh; overflow:auto;
  background:var(--bpm-bg); color:var(--bpm-fg); opacity:var(--bpm-opacity);
  border:1px solid var(--bpm-border); border-radius:var(--bpm-radius);
  padding:var(--bpm-padding); font:400 var(--bpm-font-size)/1.45 var(--bpm-font-family,system-ui,sans-serif);
  box-shadow:0 10px 30px rgba(0,0,0,.2);
}
.bpm-cookie-bottom-left .bpm-cookie-dialog {right:auto;left:var(--bpm-edge,16px)}
.bpm-cookie-bottom-center .bpm-cookie-dialog {right:auto;left:50%;transform:translateX(-50%)}
.bpm-cookie-center .bpm-cookie-dialog {bottom:auto;right:auto;top:50%;left:50%;transform:translate(-50%,-50%)}
.bpm-cookie-root .bpm-cookie-title {font-size:1.2em;margin:0 0 .45em;line-height:1.3}
.bpm-cookie-root .bpm-cookie-description {margin:.5em 0}
.bpm-cookie-root .bpm-cookie-policy {color:var(--bpm-primary);text-decoration:underline}
.bpm-cookie-root .bpm-cookie-actions {display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
.bpm-cookie-root .bpm-cookie-actions button,.bpm-cookie-root .bpm-cookie-reopen {
  font:inherit; cursor:pointer; border-radius:6px; padding:8px 12px;
  border:1px solid var(--bpm-border);background:var(--bpm-bg);color:var(--bpm-fg)
}
.bpm-cookie-root .bpm-cookie-accept,.bpm-cookie-root .bpm-cookie-save {
  background:var(--bpm-primary)!important;color:var(--bpm-button-text)!important;
  border-color:var(--bpm-primary)!important
}
.bpm-cookie-root button:focus-visible,.bpm-cookie-root a:focus-visible,.bpm-cookie-root input:focus-visible {
  outline:3px solid #f0a000;outline-offset:3px
}
.bpm-cookie-root button:disabled {opacity:.55;cursor:not-allowed}
.bpm-cookie-root .bpm-cookie-option {display:flex;align-items:center;gap:10px;margin:9px 0}
.bpm-cookie-root .bpm-cookie-option input {width:18px;height:18px}
.bpm-cookie-root .bpm-cookie-error {color:#ac2020}
.bpm-cookie-root .bpm-cookie-image {max-width:100%;max-height:90px;object-fit:contain}
.bpm-cookie-root .bpm-cookie-reopen {
  position:fixed;bottom:12px;left:12px;z-index:2147482000;
  background:var(--bpm-bg);color:var(--bpm-fg);font-size:12px
}
@media (max-width:600px) {
  .bpm-cookie-root .bpm-cookie-dialog, .bpm-cookie-bottom-left .bpm-cookie-dialog,
  .bpm-cookie-bottom-center .bpm-cookie-dialog,.bpm-cookie-center .bpm-cookie-dialog {
    top:auto;left:var(--bpm-mobile-edge,8px);right:var(--bpm-mobile-edge,8px);bottom:var(--bpm-mobile-edge,8px);transform:none;
    width:calc(100vw - 2 * var(--bpm-mobile-edge,8px));max-height:88vh
  }
}

/* Read-only native Bitrix agreement. The browser dialog handles Escape and focus. */
.bpm-cookie-root .bpm-cookie-agreement-link {
  display:block;margin-top:8px;border:0;padding:0;background:transparent;
  color:var(--bpm-primary);font:inherit;text-align:left;text-decoration:underline;cursor:pointer;
}
.bpm-cookie-agreement-dialog {
  box-sizing:border-box;width:min(600px,calc(100vw - 2 * var(--bpm-edge,16px)));max-height:85vh;
  border:1px solid #c4cad6;border-radius:12px;padding:24px;
  background:#fff;color:#172338;font:400 15px/1.55 system-ui,sans-serif;
  box-shadow:0 16px 40px rgba(0,0,0,.25);
}
.bpm-cookie-agreement-dialog::backdrop {background:rgba(0,0,0,.5)}
.bpm-cookie-agreement-heading {margin:0 0 12px;font-size:1.2em}
.bpm-cookie-agreement-text {white-space:pre-wrap;overflow-wrap:anywhere;max-height:55vh;overflow:auto}
.bpm-cookie-agreement-close {display:block;margin:16px 0 0 auto;padding:8px 18px;
  font:inherit;cursor:pointer;border:1px solid #c4cad6;border-radius:6px;background:#fff;color:#172338}
.bpm-cookie-agreement-dialog button:focus-visible,.bpm-cookie-root .bpm-cookie-agreement-link:focus-visible {
  outline:3px solid #f0a000;outline-offset:3px
}

/* Independent optional visual overrides; omitted values preserve the base palette. */
.bpm-cookie-root .bpm-cookie-dialog {box-shadow:0 10px 30px var(--bpm-shadowColor,rgba(0,0,0,.2))}
.bpm-cookie-root .bpm-cookie-policy,.bpm-cookie-root .bpm-cookie-agreement-link {color:var(--bpm-linkColor,var(--bpm-primary))}
 .bpm-cookie-root .bpm-cookie-accept {background:var(--bpm-acceptBackground,var(--bpm-primary))!important;color:var(--bpm-acceptText,var(--bpm-button-text))!important;border-color:var(--bpm-acceptBorder,var(--bpm-primary))!important}
 .bpm-cookie-root .bpm-cookie-settings {background:var(--bpm-settingsBackground,var(--bpm-bg))!important;color:var(--bpm-settingsText,var(--bpm-fg))!important;border-color:var(--bpm-settingsBorder,var(--bpm-border))!important}
 .bpm-cookie-root .bpm-cookie-reject {background:var(--bpm-rejectBackground,var(--bpm-bg))!important;color:var(--bpm-rejectText,var(--bpm-fg))!important;border-color:var(--bpm-rejectBorder,var(--bpm-border))!important}

.bpm-cookie-root .bpm-cookie-shield {position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:2147481999;touch-action:none}

.bpm-cookie-root[data-bpm-position="static"] .bpm-cookie-dialog {position:relative;inset:auto;transform:none;margin:16px auto;max-height:none}
.bpm-cookie-root[data-bpm-preset="blue"] {--bpm-bg:#1554a7!important;--bpm-fg:#ffffff!important;--bpm-primary:#ffffff!important;--bpm-button-text:#1554a7!important}
.bpm-cookie-root[data-bpm-preset="dark"] {--bpm-bg:#172338!important;--bpm-fg:#ffffff!important;--bpm-primary:#94b8ff!important;--bpm-button-text:#172338!important}
.bpm-cookie-root[data-bpm-preset="yellow"] {--bpm-bg:#fff4c2!important;--bpm-fg:#333333!important;--bpm-primary:#775800!important}
.bpm-cookie-root[data-bpm-preset="green"] {--bpm-bg:#edf8ef!important;--bpm-fg:#23472b!important;--bpm-primary:#247b36!important}
.bpm-cookie-root[data-bpm-preset="red"] {--bpm-bg:#fff0f0!important;--bpm-fg:#542323!important;--bpm-primary:#ac2020!important}
.bpm-cookie-root[data-bpm-preset*="mini"] .bpm-cookie-dialog {width:min(360px,calc(100vw - 2 * var(--bpm-edge,16px)))}
.bpm-cookie-root[data-bpm-preset="neutral-center"] .bpm-cookie-dialog,.bpm-cookie-root[data-bpm-preset="neutral-mini-center"] .bpm-cookie-dialog {right:auto;left:50%;transform:translateX(-50%)}
.bpm-cookie-root[data-bpm-preset="vertical-mini-left"] .bpm-cookie-dialog {right:auto;left:var(--bpm-edge,16px)}
.bpm-cookie-root[data-bpm-preset^="vertical"] .bpm-cookie-actions {flex-direction:column}
@media(max-width:600px){.bpm-cookie-root[data-bpm-preset] .bpm-cookie-dialog {width:calc(100vw - 2 * var(--bpm-mobile-edge,8px));left:var(--bpm-mobile-edge,8px);right:var(--bpm-mobile-edge,8px);transform:none}.bpm-cookie-root[data-bpm-position="static"] .bpm-cookie-dialog {left:auto;right:auto}}

/* Full width overrides compact presets without changing the chosen position. */
.bpm-cookie-root[data-bpm-width="full"][data-bpm-preset] .bpm-cookie-dialog {
  width:min(calc(100vw - 2 * var(--bpm-edge,16px)), calc(100% - 2 * var(--bpm-edge,16px)));max-width:none;
}
@media(max-width:600px){
  .bpm-cookie-root[data-bpm-width="full"][data-bpm-preset] .bpm-cookie-dialog {width:calc(100vw - 2 * var(--bpm-mobile-edge,8px))}
}

/* Static placement must override fixed-position presets at every breakpoint. */
.bpm-cookie-root[data-bpm-position="static"][data-bpm-preset] .bpm-cookie-dialog {position:relative;inset:auto;transform:none;margin:16px auto}

/* Keep an explicitly centered fixed dialog centered at every breakpoint. */
.bpm-cookie-root.bpm-cookie-center[data-bpm-position="fixed"] .bpm-cookie-dialog {
  top:50%;left:50%;right:auto;bottom:auto;transform:translate(-50%,-50%);
  max-height:calc(100vh - 2 * var(--bpm-edge,16px));
  max-height:calc(100dvh - 2 * var(--bpm-edge,16px));
}
@media(max-width:600px){
  .bpm-cookie-root.bpm-cookie-center[data-bpm-position="fixed"][data-bpm-width="limited"] .bpm-cookie-dialog {
    width:min(var(--bpm-max-width),calc(100vw - 2 * var(--bpm-mobile-edge,8px)));
  }
  .bpm-cookie-root.bpm-cookie-center[data-bpm-position="fixed"] .bpm-cookie-dialog {
    max-height:calc(100vh - 2 * var(--bpm-mobile-edge,8px));
    max-height:calc(100dvh - 2 * var(--bpm-mobile-edge,8px));
  }
}
