/* ===========================================================================
   Cookie Consent GDPR  -  storefront  -  https://ocmod.net
   ---------------------------------------------------------------------------
   Every shop specific value arrives as a custom property from the module
   settings, so this file is identical for every store and stays cacheable.
   =========================================================================== */

/* Defaults on :root, not on .occ-root: a value declared on the element itself
   would shadow the inline :root block the module settings print later. */
:root {
  --occ-bg: #fff;
  --occ-text: #2d3748;
  --occ-btn: #2f8f4e;
  --occ-btn-text: #fff;
  --occ-btn2: #eef1f6;
  --occ-btn2-text: #334155;
  --occ-link: #2f6fdb;
  --occ-overlay: rgba(15, 23, 42, .55);
  --occ-width: 420px;
  --occ-radius: 12px;
  --occ-font: 14px;
  --occ-z: 99999;
}

.occ-root[hidden],
.occ-badge[hidden] { display: none; }

.occ-root {
  position: fixed;
  inset: 0;
  z-index: var(--occ-z);
  pointer-events: none;
  font-size: var(--occ-font);
  line-height: 1.5;
  color: var(--occ-text);
}

.occ-root * { box-sizing: border-box; }

.occ-overlay {
  position: absolute;
  inset: 0;
  background: var(--occ-overlay);
  pointer-events: auto;
}

/* ---------- banner shell -------------------------------------------------- */
.occ-banner,
.occ-prefs {
  position: absolute;
  pointer-events: auto;
  background: var(--occ-bg);
  color: var(--occ-text);
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: var(--occ-radius);
  padding: 20px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.occ-banner[hidden],
.occ-prefs[hidden] { display: none; }

.occ-banner { width: var(--occ-width); max-width: calc(100vw - 32px); }

/* ---------- placement ----------------------------------------------------- */
.occ-pos-bottom-left  .occ-banner { left: 16px;  bottom: 16px; }
.occ-pos-bottom-right .occ-banner { right: 16px; bottom: 16px; }
.occ-pos-top-left     .occ-banner { left: 16px;  top: 16px; }
.occ-pos-top-right    .occ-banner { right: 16px; top: 16px; }

.occ-pos-center .occ-banner {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.occ-pos-bottom .occ-banner { left: 50%; bottom: 16px; transform: translateX(-50%); }
.occ-pos-top    .occ-banner { left: 50%; top: 16px;    transform: translateX(-50%); }

/* A bar spans the viewport and lays its text and buttons side by side. */
.occ-layout-bar .occ-banner {
  width: 100%;
  max-width: 100%;
  left: 0;
  right: 0;
  transform: none;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
}
.occ-layout-bar .occ-banner-body { flex: 1 1 420px; }
.occ-layout-bar .occ-actions { flex: 0 0 auto; margin-top: 0; }

.occ-layout-modal .occ-banner {
  left: 50%;
  top: 50%;
  bottom: auto;
  right: auto;
  transform: translate(-50%, -50%);
}

/* ---------- typography ---------------------------------------------------- */
.occ-title {
  margin: 0 0 8px;
  font-size: 1.15em;
  font-weight: 700;
  line-height: 1.3;
  color: inherit;
}

.occ-text { margin: 0; }
.occ-text p { margin: 0 0 8px; }

.occ-link {
  color: var(--occ-link);
  text-decoration: underline;
  white-space: nowrap;
}
.occ-link:hover, .occ-link:focus { color: var(--occ-link); text-decoration: none; }

/* ---------- buttons ------------------------------------------------------- */
.occ-actions,
.occ-prefs-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.occ-btn {
  flex: 1 1 auto;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: calc(var(--occ-radius) / 2);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s ease;
}
.occ-btn:hover { filter: brightness(.94); }
.occ-btn:focus-visible { outline: 3px solid var(--occ-link); outline-offset: 2px; }

/* Accept and reject share one class: they must look equally inviting. */
.occ-btn-primary { background: var(--occ-btn); color: var(--occ-btn-text); }
.occ-btn-ghost {
  background: var(--occ-btn2);
  color: var(--occ-btn2-text);
  border-color: rgba(15, 23, 42, .10);
}

.occ-x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  opacity: .5;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.occ-x:hover { opacity: 1; }

/* ---------- preferences dialog -------------------------------------------- */
.occ-prefs {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 640px;
  max-width: calc(100vw - 32px);
  padding: 0;
}
.occ-prefs-head {
  position: relative;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(15, 23, 42, .10);
}
.occ-prefs-head .occ-title { margin: 0; padding-right: 34px; }
.occ-prefs-head .occ-x { top: 14px; }
.occ-prefs-body { padding: 18px 20px; }
.occ-prefs-foot {
  margin: 0;
  padding: 16px 20px;
  border-top: 1px solid rgba(15, 23, 42, .10);
}

.occ-cat {
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: calc(var(--occ-radius) / 1.6);
  margin-top: 12px;
}
.occ-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}
.occ-cat-toggle {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.occ-caret {
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .15s ease;
}
.occ-cat-toggle[aria-expanded="true"] .occ-caret { transform: rotate(90deg); }

.occ-cat-body { padding: 0 14px 14px; }
.occ-cat-body[hidden] { display: none; }
.occ-cat-desc { opacity: .85; font-size: .95em; }

.occ-always { font-size: .85em; opacity: .7; white-space: nowrap; }

.occ-switch { position: relative; display: inline-block; width: 46px; height: 26px; margin: 0; flex: 0 0 auto; }
.occ-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.occ-slider {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  background: #cbd5e1;
  transition: background .15s ease;
}
.occ-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s ease;
}
.occ-switch input:checked + .occ-slider { background: var(--occ-btn); }
.occ-switch input:checked + .occ-slider::before { transform: translateX(20px); }
.occ-switch input:focus-visible + .occ-slider { outline: 3px solid var(--occ-link); outline-offset: 2px; }

.occ-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- cookie declaration -------------------------------------------- */
.occ-table-wrap { overflow-x: auto; margin-top: 10px; }
.occ-table { width: 100%; border-collapse: collapse; font-size: .85em; }
.occ-table th, .occ-table td {
  padding: 6px 8px;
  border: 1px solid rgba(15, 23, 42, .10);
  text-align: left;
  vertical-align: top;
}
.occ-table th { font-weight: 600; opacity: .8; }

/* ---------- reopen badge -------------------------------------------------- */
.occ-badge {
  position: fixed;
  bottom: 16px;
  z-index: calc(var(--occ-z) - 1);
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 50%;
  background: var(--occ-bg);
  color: var(--occ-text);
  cursor: pointer;
  opacity: .75;
  transition: opacity .15s ease;
}
.occ-badge:hover { opacity: 1; }
.occ-badge-left { left: 16px; }
.occ-badge-right { right: 16px; }

/* ---------- motion -------------------------------------------------------- */
.occ-anim-fade .occ-banner,
.occ-anim-fade .occ-prefs { animation: occ-fade .25s ease both; }
.occ-anim-slide .occ-banner,
.occ-anim-slide .occ-prefs { animation: occ-slide .25s ease both; }

@keyframes occ-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes occ-slide { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  .occ-anim-fade .occ-banner,
  .occ-anim-fade .occ-prefs,
  .occ-anim-slide .occ-banner,
  .occ-anim-slide .occ-prefs { animation: none; }

  .occ-root .occ-btn,
  .occ-root .occ-slider,
  .occ-root .occ-slider::before,
  .occ-root .occ-caret { transition: none; }
}

/* ---------- small screens ------------------------------------------------- */
@media (max-width: 600px) {
  /* Prefixed with .occ-root to outrank the .occ-pos-* placement rules. */
  .occ-root .occ-banner,
  .occ-root.occ-layout-bar .occ-banner {
    left: 8px;
    right: 8px;
    bottom: 8px;
    top: auto;
    width: auto;
    max-width: none;
    transform: none;
    border-radius: var(--occ-radius);
    border-width: 1px;
    padding: 16px;
  }

  .occ-pos-top .occ-banner,
  .occ-pos-top-left .occ-banner,
  .occ-pos-top-right .occ-banner { top: 8px; bottom: auto; }

  .occ-prefs { left: 8px; right: 8px; transform: translateY(-50%); width: auto; }
  .occ-btn { flex: 1 1 100%; }
  /* Accept and reject stay side by side and equal; the rest go full width. */
  .occ-btn-primary { flex-basis: calc(50% - 4px); }
  .occ-badge { width: 40px; height: 40px; }
}
