/* Cookie system */
.cookie[hidden] {
  display: none;
}

/* Banner */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  z-index: 26000; /* header (25000) fölé */
}

/* Desktop: marad alul */
@media (min-width: 1025px) {
  .cookie-banner {
    bottom: calc(16px + env(safe-area-inset-bottom));
    top: auto;
  }
}

/* Mobile + Tablet: FELÜL legyen */
@media (max-width: 1024px) {
  .cookie-banner {
    top: calc(16px + 110px + env(safe-area-inset-top));

    bottom: auto;
  }

  /* ha a banner magasabb lenne, belül scrollozható */
  .cookie-banner-inner {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }
}

.cookie-banner-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 14px 14px;
  border-radius: 16px;
  background: rgba(11, 11, 13, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
}

.cookie-title {
  margin: 0 0 6px;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.cookie-desc {
  margin: 0;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.8);
}

.cookie-link {
  display: inline-flex;
  margin-top: 10px;
  color: rgba(214, 178, 98, 0.95);
  text-decoration: none;
}
.cookie-link:hover {
  text-decoration: underline;
}

.cookie-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons */
.cookie-btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease,
    border-color 160ms ease, color 160ms ease;
  user-select: none;
}

.cookie-btn:focus-visible {
  outline: 2px solid rgba(214, 178, 98, 0.7);
  outline-offset: 2px;
}

.cookie-btn-primary {
  background: rgba(214, 178, 98, 0.95);
  color: rgba(10, 10, 10, 0.95);
  border-color: rgba(214, 178, 98, 0.6);
}

.cookie-btn-primary:hover {
  transform: translateY(-1px);
}

.cookie-btn-outline {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  border-color: rgba(255, 255, 255, 0.16);
}

.cookie-btn-outline:hover {
  transform: translateY(-1px);
  border-color: rgba(214, 178, 98, 0.35);
}

.cookie-btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.12);
}
.cookie-btn-ghost:hover {
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Modal */
.cookie-modal[hidden] {
  display: none;
}

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.cookie-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.cookie-modal-card {
  position: relative;
  width: min(720px, 100%);
  border-radius: 18px;
  background: #0b0b0d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.86);
  overflow: hidden;
  max-height: calc(100vh - 36px - env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
}

.cookie-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-modal-title {
  margin: 0;
  font-size: 18px;
}

.cookie-modal-sub {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.45;
}

.cookie-x {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
}

.cookie-modal-body {
  padding: 14px 16px;
  display: grid;
  gap: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
}

.cookie-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-row-locked {
  border-color: rgba(255, 255, 255, 0.06);
}

.cookie-row-title {
  font-weight: 650;
  margin-bottom: 4px;
}

.cookie-row-desc {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.45;
}

.cookie-badge {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.06);
}

/* Toggle */
.cookie-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.cookie-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cookie-switch-ui {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background 160ms ease, border-color 160ms ease;
  position: relative;
}

.cookie-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  transition: transform 160ms ease;
}

.cookie-switch input:checked + .cookie-switch-ui {
  background: rgba(214, 178, 98, 0.28);
  border-color: rgba(214, 178, 98, 0.4);
}

.cookie-switch input:checked + .cookie-switch-ui::after {
  transform: translateX(22px);
  background: rgba(214, 178, 98, 0.95);
}

.cookie-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-modal-footer-right {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Accessibility helper */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Mobile */
@media (max-width: 640px) {
  .cookie-banner-inner {
    grid-template-columns: 1fr;
  }
  .cookie-actions {
    justify-content: flex-start;
  }
}

/* Opcionális: finom háttér sötétítés, ha a banner látszik */
.cookie.is-lock-overlay::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9998; /* a banner alatt */
}

/* Scroll lock ONLY when the cookie modal is open */
body.is-cookie-locked {
  overflow: hidden; /* háttér ne görgessen */
}

/* Optional overlay (ha használod) */
.cookie.is-lock-overlay::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9998;
}

/* Modal footer – mobile layout (C opció): 2 gomb egymás mellett + Mentés full width */
@media (max-width: 520px) {
  .cookie-modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: stretch;
  }

  /* Minden gomb töltse ki a celláját */
  .cookie-modal-footer .cookie-btn {
    width: 100%;
    justify-content: center;
  }

  /* Mentés: teljes szélesség a 2 oszlop alatt */
  .cookie-modal-footer .cookie-btn[data-cookie-save] {
    grid-column: 1 / -1;
  }
}
