/* =====================================================================
   Cookie consent — banner, settings modal and floating widget.

   ONE stylesheet for both sites. The Hugo pages link it from head.html and
   the WordPress shop loads the very same file through
   wordpress/mu-plugins/lss-cookie-consent.php, so the design cannot drift.
   It is published at a fixed URL (no fingerprint) because WordPress has to
   reference it by path.

   Built to look identical inside the WooCommerce theme:
   - it defines its own colours, font and button/container styles;
   - sizes are in px, not root-relative units, so a different root font
     size in the theme does not shrink the banner;
   - the first class of every component selector is doubled (.x.x) — same
     elements, higher specificity, so the theme's button, input and heading
     rules lose.
   ===================================================================== */

.cookie-banner,
.cookie-modal,
.cookie-widget {
  --color-bg: #0a0a0a;
  --color-bg-alt: #111111;
  --color-white: #ffffff;
  --color-red: #e63329;
  --color-border: #222222;
  --max-width: 1200px;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: #ffffff;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Mirrors the global reset at the top of main.css, which the WordPress theme
   does not have. */
.cookie-banner *,
.cookie-banner *::before,
.cookie-banner *::after,
.cookie-modal *,
.cookie-modal *::before,
.cookie-modal *::after,
.cookie-widget *,
.cookie-widget::before,
.cookie-widget::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Neutralise common theme rules before the component styles below apply. */
.cookie-banner p,
.cookie-modal p {
  margin: 0;
}

.cookie-modal h2 {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  line-height: 1.1;
  color: #ffffff;
  text-transform: none;
  letter-spacing: normal;
}

.cookie-modal button,
.cookie-widget.cookie-widget {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: 13.333px;
  line-height: normal;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
}

.cookie-banner .container {
  width: auto;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 480px) {
  .cookie-banner .container {
    padding: 0 20px;
  }
}

/* The widget sits directly in <body>, so inheriting would pick up the
   theme's font on the shop — name it explicitly. */
.cookie-widget.cookie-widget {
  font-family: 'Poppins', sans-serif;
}

.cookie-modal label {
  display: inline;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

/* Buttons — same as .btn / .btn--primary / .btn--outline in main.css. */
.cookie-banner .btn,
.cookie-modal .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  min-height: 0;
  margin: 0;
  padding: 0 32px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 12.8px;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 32px;
  box-shadow: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cookie-banner .btn--primary,
.cookie-modal .btn--primary {
  background: #e63329;
  color: #ffffff;
  border: none;
}

.cookie-banner .btn--primary:hover,
.cookie-modal .btn--primary:hover {
  background: #e63329;
  color: #ffffff;
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(230, 51, 41, 0.35);
}

.cookie-banner .btn--outline,
.cookie-modal .btn--outline {
  background: transparent;
  color: #ffffff;
  border: 2px solid #444;
}

.cookie-banner .btn--outline:hover,
.cookie-modal .btn--outline:hover {
  background: transparent;
  color: #ffffff;
  border-color: #ffffff;
  transform: translateY(-2px);
}

/* ---- component styles (moved from main.css) ---- */

/* ===== Cookie banner ===== */
.cookie-banner.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 20px 0;
  animation: cookie-banner-in 0.4s ease;
}

.cookie-banner.cookie-banner[hidden] {
  display: none;
}

.cookie-banner__inner.cookie-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-banner__text.cookie-banner__text {
  color: #ffffff;
  font-size: 13.6px;
  line-height: 1.6;
  flex: 1 1 320px;
}

.cookie-banner__text.cookie-banner__text a {
  color: var(--color-red);
  text-decoration: underline;
  font-weight: 600;
}

.cookie-banner__actions.cookie-banner__actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-banner__actions.cookie-banner__actions .btn {
  padding-left: 24px;
  padding-right: 24px;
  cursor: pointer;
}

.cookie-banner__actions.cookie-banner__actions .btn--primary {
  border: none;
}

@keyframes cookie-banner-in {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner.cookie-banner {
    animation: none;
  }
}

/* ===== Cookie settings modal ===== */
.cookie-modal.cookie-modal[hidden] {
  display: none;
}

.cookie-modal.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 310;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 24px 24px;
}

.cookie-modal__backdrop.cookie-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.cookie-modal__panel.cookie-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 24px;
}

.cookie-modal__header.cookie-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cookie-modal__header.cookie-modal__header h2 {
  font-size: 18.4px;
  color: var(--color-white);
}

.cookie-modal__close.cookie-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  border-radius: 50%;
  color: #999999;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.cookie-modal__close.cookie-modal__close:hover {
  color: var(--color-white);
  background-color: rgba(255, 255, 255, 0.08);
}

.cookie-modal__close.cookie-modal__close svg {
  width: 16px;
  height: 16px;
}

.cookie-modal__categories.cookie-modal__categories {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cookie-category.cookie-category {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.cookie-category.cookie-category:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.cookie-category__head.cookie-category__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6.4px;
}

.cookie-category__title.cookie-category__title {
  color: var(--color-white);
  font-weight: 700;
  font-size: 15.2px;
}

.cookie-category__desc.cookie-category__desc {
  color: #999999;
  font-size: 13.12px;
  line-height: 1.5;
}

.cookie-toggle-switch.cookie-toggle-switch {
  position: relative;
  flex-shrink: 0;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.cookie-toggle-switch.cookie-toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.cookie-toggle-switch__track.cookie-toggle-switch__track {
  position: absolute;
  inset: 0;
  background: #333333;
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

.cookie-toggle-switch__track.cookie-toggle-switch__track::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--color-white);
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.cookie-toggle-switch.cookie-toggle-switch input:checked + .cookie-toggle-switch__track {
  background: var(--color-red);
}

.cookie-toggle-switch.cookie-toggle-switch input:checked + .cookie-toggle-switch__track::before {
  transform: translateX(18px);
}

.cookie-toggle-switch.cookie-toggle-switch input:disabled + .cookie-toggle-switch__track {
  background: var(--color-red);
  opacity: 0.5;
  cursor: not-allowed;
}

.cookie-toggle-switch.cookie-toggle-switch input:disabled {
  cursor: not-allowed;
}

.cookie-modal__actions.cookie-modal__actions {
  margin-top: 24px;
}

.cookie-modal__save.cookie-modal__save {
  width: 100%;
  border: none;
  cursor: pointer;
}

/* ===== Cookie preferences widget ===== */
.cookie-widget.cookie-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 190;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20.8px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.cookie-widget.cookie-widget:hover {
  transform: translateY(-2px);
  border-color: var(--color-red);
}

.cookie-widget.cookie-widget[hidden] {
  display: none;
}

@media (max-width: 768px) {
  .cookie-modal.cookie-modal {
    padding: 4vh 16px 16px;
  }

  .cookie-modal__panel.cookie-modal__panel {
    max-height: 88vh;
    padding: 17.6px;
  }

  .cookie-widget.cookie-widget {
    right: 16px;
    bottom: 16px;
    width: 40px;
    height: 40px;
    font-size: 17.6px;
  }
}

@media (max-width: 768px) {
  .cookie-banner.cookie-banner {
    padding: 16px 0;
  }

  .cookie-banner__inner.cookie-banner__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  /* In the row layout `flex: 1 1 320px` is a width. Once the inner block becomes a
     column, 320px would become the paragraph's HEIGHT and leave a large empty gap
     above the buttons, so the basis is reset here. */
  .cookie-banner__text.cookie-banner__text {
    flex: 0 0 auto;
  }

  /* Reject and Settings share one row, Accept All stays full width underneath. */
  .cookie-banner__actions.cookie-banner__actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .cookie-banner__actions.cookie-banner__actions .btn {
    flex: 1 1 calc(50% - 4px);
    height: 44px;
    padding: 0 12px;
    text-align: center;
  }

  .cookie-banner__actions.cookie-banner__actions .btn--primary {
    flex-basis: 100%;
  }
}
