/*
 * Cookie consent banner, settings and switch (PTL-251).
 * Plain CSS on purpose: the landing has no Tailwind. Sizes follow the potalonu-cookie-banner mockups:
 * a 470px card bottom left on the site, bottom sheets on phones and in the Mini App.
 */

.p-cookie,
.p-settings {
  box-sizing: border-box;
  color: #2B2521;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

.p-cookie *,
.p-settings * {
  box-sizing: border-box;
}

/* Banner: does not block or dim the page */
.p-cookie {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 470px;
  max-width: calc(100% - 48px);
  padding: 22px 24px 20px;
  background: #fff;
  border: 1px solid rgba(43, 37, 33, 0.07);
  border-radius: 20px;
  box-shadow: 0 14px 36px -14px rgba(43, 37, 33, 0.4);
}

.p-cookie[hidden] {
  display: none !important;
}

.p-cookie__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.p-cookie__text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #6E645A;
}

.p-cookie__text a {
  color: #2B2521;
  font-weight: 600;
  text-decoration: underline;
}

.p-cookie__actions,
.p-settings__actions {
  display: flex;
  gap: 10px;
}

.p-cookie__actions .p-btn {
  flex: 1 1 0;
  padding: 0 12px;
}

.p-settings__actions .p-btn {
  flex: 1 1 0;
}

.p-cookie__more {
  display: flex;
  justify-content: center;
}

/* Buttons and links */
.p-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  margin: 0;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.p-btn--primary {
  background: #E0592A;
  color: #F7F3EC;
}

.p-btn--secondary {
  background: #fff;
  color: #2B2521;
  border: 1.5px solid rgba(43, 37, 33, 0.15);
}

.p-link {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  color: #2B2521;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.p-btn:focus-visible,
.p-link:focus-visible,
.p-switch:focus-visible,
.p-cookie a:focus-visible,
.p-settings a:focus-visible {
  outline: 2px solid #E0592A;
  outline-offset: 2px;
}

.p-sheet__handle {
  display: none;
  flex-shrink: 0;
  align-self: center;
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(43, 37, 33, 0.2);
}

/* Settings: a modal over a dimmed page */
dialog.p-settings {
  width: 560px;
  max-width: calc(100% - 48px);
  max-height: calc(100% - 48px);
  margin: auto;
  padding: 28px 32px 26px;
  overflow-y: auto;
  background: #fff;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 20px 48px -18px rgba(43, 37, 33, 0.45);
}

dialog.p-settings[open] {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

dialog.p-settings::backdrop {
  background: rgba(43, 37, 33, 0.5);
}

.p-settings__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p-settings__eyebrow {
  display: none;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #E0592A;
}

.p-settings__title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.p-settings__subtitle {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #6E645A;
}

.p-settings__list {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(43, 37, 33, 0.09);
  border-radius: 16px;
}

.p-settings__row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
}

.p-settings__row + .p-settings__row {
  border-top: 1px solid rgba(43, 37, 33, 0.07);
}

.p-settings__info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.p-settings__name {
  font-size: 15px;
  font-weight: 700;
}

.p-settings__desc {
  font-size: 13px;
  line-height: 1.45;
  color: #6E645A;
}

.p-settings__always {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  color: #8A7F72;
}

.p-settings__note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #8A7F72;
}

.p-settings__note a {
  color: #6E645A;
  font-weight: 600;
  text-decoration: underline;
}

.p-settings__cancel {
  display: none;
  align-self: center;
  font-size: 14px;
  color: #6E645A;
}

/* Switch: a real button role="switch" */
.p-switch {
  display: block;
  flex-shrink: 0;
  width: 46px;
  height: 28px;
  margin: 0;
  padding: 2px;
  background: #DDD4C6;
  border: 0;
  border-radius: 100px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.p-switch[aria-checked="true"] {
  background: #E0592A;
}

.p-switch__knob {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(43, 37, 33, 0.3);
  transition: transform 0.15s ease;
}

.p-switch[aria-checked="true"] .p-switch__knob {
  transform: translateX(18px);
}

.p-consent--mini-app .p-settings__cancel {
  display: block;
}

/* Phones: bottom sheets, buttons one under another */
@media (max-width: 639px) {
  .p-cookie {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -12px 36px -16px rgba(43, 37, 33, 0.45);
  }

  .p-cookie__title {
    font-size: 18px;
  }

  .p-cookie__actions,
  .p-settings__actions {
    flex-direction: column;
  }

  .p-cookie__actions .p-btn,
  .p-settings__actions .p-btn {
    flex: none;
    width: 100%;
    height: 46px;
  }

  .p-link {
    font-size: 14px;
  }

  .p-sheet__handle,
  .p-settings__eyebrow,
  .p-settings__cancel {
    display: block;
  }

  dialog.p-settings {
    width: 100%;
    max-width: 100%;
    max-height: calc(100% - 24px);
    margin: auto 0 0;
    padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
    background: #F7F3EC;
    border-radius: 24px 24px 0 0;
    box-shadow: none;
  }

  dialog.p-settings[open] {
    gap: 16px;
  }

  .p-settings__head {
    gap: 6px;
  }

  .p-settings__title {
    font-size: 21px;
  }

  .p-settings__row {
    gap: 14px;
    padding: 13px 16px;
  }

  .p-settings__desc {
    font-size: 12.5px;
  }

  .p-settings__always {
    font-size: 12px;
  }
}

/* Cookie Policy page (/cookie_policy) */
.cookie-policy code::before,
.cookie-policy code::after { content: none; }
.cookie-policy__table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cookie-policy__table table { min-width: 860px; }
