/**
 * Kas Puode – Slapukų valdymo sistemos stiliai (GDPR / BDAR)
 */

/* 1. Slapukų apatinis baneris */
.kp-cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 1140px;
  margin: 0 auto;
  z-index: 9990;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-left: 5px solid var(--blue);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(15, 26, 43, 0.22);
  padding: 16px 20px;
  transform: translateY(115%);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
  pointer-events: none;
}

.kp-cookie-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.kp-cookie-banner-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 !important;
}

.kp-cookie-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.kp-cookie-badge-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--amber) 18%, var(--surface));
  color: var(--amber-text);
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  flex: none;
}

.kp-cookie-badge-icon svg {
  width: 26px;
  height: 26px;
}

.kp-cookie-banner-text {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-2);
}

.kp-cookie-banner-text strong {
  display: block;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 2px;
}

.kp-cookie-banner-text p {
  margin: 0;
}

.kp-cookie-learn-more {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  margin-left: 4px;
  white-space: nowrap;
}

.kp-cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  flex-wrap: wrap;
}

.kp-cookie-banner-actions .btn {
  padding: 9px 16px !important;
  font-size: 13.5px !important;
  border-radius: 8px !important;
}

/* 2. Modalo fonas (Backdrop) */
.kp-cookie-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: rgba(12, 19, 34, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.kp-cookie-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* 3. Nustatymų modalas */
.kp-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 99995;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.kp-cookie-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.kp-cookie-modal-card {
  width: 100%;
  max-width: 680px;
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  transform: translateY(24px) scale(0.98);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.kp-cookie-modal.is-open .kp-cookie-modal-card {
  transform: translateY(0) scale(1);
}

.kp-cookie-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--page);
  flex: none;
}

.kp-cookie-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kp-cookie-modal-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--blue-tint);
  color: var(--blue);
  flex: none;
}

.kp-cookie-modal-icon svg {
  width: 22px;
  height: 22px;
}

.kp-cookie-modal-header h2 {
  font-size: 19px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.kp-cookie-modal-header small {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.kp-cookie-modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.kp-cookie-modal-close:hover {
  background: color-mix(in srgb, var(--red) 12%, transparent);
  color: var(--red);
  border-color: var(--red);
}

.kp-cookie-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.kp-cookie-modal-intro {
  margin: 0 0 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.kp-cookie-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kp-cookie-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--page);
  padding: 14px 16px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.kp-cookie-group:hover {
  border-color: var(--line-2);
}

.kp-cookie-group.is-locked {
  background: color-mix(in srgb, var(--surface) 60%, var(--page));
}

.kp-cookie-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.kp-cookie-group-info {
  flex: 1;
  min-width: 0;
}

.kp-cookie-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.kp-cookie-cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent, #f97316) 12%, transparent);
  color: var(--accent, #f97316);
  flex-shrink: 0;
}

.kp-cookie-cat-icon svg {
  display: block;
  width: 15px;
  height: 15px;
  stroke: currentColor;
}

.kp-cookie-group-title strong {
  font-size: 14.5px;
  color: var(--ink);
}

.kp-cookie-badge-req {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--blue-tint);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
}

.kp-cookie-group-info p {
  margin: 0 0 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-3);
}

.kp-cookie-tech-list {
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.kp-cookie-tech-list code {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  color: var(--ink-2);
}

/* 4. Individualūs perjungimo jungikliai (Switch) */
.kp-cookie-toggle-wrap {
  flex: none;
  padding-top: 2px;
}

.kp-cookie-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

.kp-cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  position: absolute;
}

.kp-cookie-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--line-2);
  transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
}

.kp-cookie-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.kp-cookie-switch input:checked + .kp-cookie-slider {
  background-color: var(--blue);
}

.kp-cookie-switch input:checked + .kp-cookie-slider:before {
  transform: translateX(20px);
}

.kp-cookie-switch input:disabled + .kp-cookie-slider {
  opacity: 0.65;
  cursor: not-allowed;
  background-color: var(--blue);
}

/* 5. Modalo poraštė */
.kp-cookie-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: var(--page);
  gap: 14px;
  flex-wrap: wrap;
  flex: none;
}

.kp-cookie-policy-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}

.kp-cookie-policy-link:hover {
  text-decoration: underline;
}

.kp-cookie-modal-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

/* 6. Poraštės mygtukas */
.ftr-cookie-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--blue);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}

.ftr-cookie-btn:hover {
  text-decoration: underline;
}

/* 7. Mobili adaptacija */
@media screen and (max-width: 880px) and (min-height: 501px) {
  .kp-cookie-banner {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    left: 10px;
    right: 10px;
    padding: 14px;
    z-index: 10001 !important;
  }
}

@media screen and (max-width: 768px) {
  .kp-cookie-banner-in {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .kp-cookie-banner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .kp-cookie-banner-actions #kpCookieAcceptAll {
    grid-column: 1 / -1;
  }

  .kp-cookie-banner-actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .kp-cookie-modal-header {
    padding: 14px 16px;
  }

  .kp-cookie-modal-body {
    padding: 16px;
  }

  .kp-cookie-modal-footer {
    padding: 14px 16px;
    flex-direction: column;
    align-items: stretch;
  }

  .kp-cookie-modal-buttons {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    margin-left: 0;
  }

  .kp-cookie-modal-buttons .btn {
    width: 100% !important;
    justify-content: center !important;
  }
}
