/* ============================================================
   cookies.css — Khatarabic GDPR Cookie Consent System
   Applied to: index.html
   ============================================================ */

/* ── Banner backdrop (dims page while banner is visible) ── */
#kh-cc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(49, 54, 71, 0.45);
  z-index: 9998;
  pointer-events: none; /* let banner remain clickable */
}

/* ── Cookie banner (bottom bar) ── */
#kh-cc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1e2b0e;
  border-top: 3px solid #8aac2e;
  color: #e8f0d0;
  padding: 20px 28px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  max-width: 100%;
}

.kh-cc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.kh-cc-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.kh-cc-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #d4e88a;
  letter-spacing: 0.01em;
}

.kh-cc-desc {
  margin: 0 0 16px;
  font-size: 0.875rem;
  line-height: 1.65;
  color: #c8d9a0;
  max-width: 900px;
}

.kh-cc-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}

.kh-cc-footer-note {
  margin: 0;
  font-size: 0.775rem;
  color: #7a9060;
  line-height: 1.5;
}

.kh-cc-footer-note a {
  color: #c6d87a;
  text-decoration: underline;
}

.kh-cc-footer-note a:hover {
  color: #d4e88a;
}

/* ── Shared button styles ── */
.kh-cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 22px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.18s, transform 0.1s, box-shadow 0.18s;
  white-space: nowrap;
  text-decoration: none;
}

.kh-cc-btn:focus-visible {
  outline: 2px solid #8aac2e;
  outline-offset: 2px;
}

/* Accept All — green CTA */
.kh-cc-btn-primary {
  background: #8aac2e;
  color: #fff;
  box-shadow: 0 2px 8px rgba(138, 172, 46, 0.25);
}

.kh-cc-btn-primary:hover {
  background: #6b8e22;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(138, 172, 46, 0.35);
}

/* Customize Settings — ghost */
.kh-cc-btn-outline {
  background: transparent;
  color: #d4e88a;
  border: 1.5px solid rgba(198, 216, 122, 0.4);
}

.kh-cc-btn-outline:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: #a3b087;
}

/* Smaller variant for modal footer */
.kh-cc-btn-sm {
  padding: 8px 16px;
  font-size: 0.825rem;
}

/* ── Modal overlay ── */
#kh-cc-modal {
  position: fixed;
  inset: 0;
  background: rgba(49, 54, 71, 0.6);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ── Modal dialog card ── */
.kh-cc-modal-box {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 16px 48px rgba(44, 58, 18, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kh-cc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #e8e8e6;
  background: #f5f8ef;
}

.kh-cc-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #2C3A12;
}

.kh-cc-modal-close {
  background: none;
  border: none;
  font-size: 1.05rem;
  cursor: pointer;
  color: #5a6270;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.kh-cc-modal-close:hover {
  background: #ececea;
  color: #313647;
}

.kh-cc-modal-close:focus-visible {
  outline: 2px solid #8aac2e;
  outline-offset: 2px;
}

/* ── Modal body (category list) ── */
.kh-cc-modal-body {
  padding: 4px 20px 8px;
  overflow-y: auto;
  max-height: 60vh;
}

/* ── Individual cookie category row ── */
.kh-cc-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid #f1f1ef;
  gap: 16px;
}

.kh-cc-category:last-child {
  border-bottom: none;
}

.kh-cc-cat-info {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.kh-cc-cat-info strong {
  font-size: 0.875rem;
  font-weight: 700;
  color: #2C3A12;
}

.kh-cc-cat-info span {
  font-size: 0.8rem;
  color: #5a6270;
  line-height: 1.5;
}

/* ── Toggle switch ── */
.kh-cc-switch {
  flex: 0 0 auto;
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  cursor: pointer;
}

.kh-cc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.kh-cc-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 26px;
  transition: background 0.18s;
}

.kh-cc-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s;
}

.kh-cc-switch input:checked + .kh-cc-slider {
  background: #8aac2e;
}

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

.kh-cc-switch input:focus-visible + .kh-cc-slider {
  box-shadow: 0 0 0 2px #8aac2e;
}

/* ── "Always On" pill (Essential row) ── */
.kh-cc-toggle-locked {
  flex: 0 0 auto;
}

.kh-cc-always-on {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  background: #f0f7e4;
  color: #3d6b0a;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #c0d890;
  white-space: nowrap;
  font-family: inherit;
}

/* ── Modal footer (action buttons) ── */
.kh-cc-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #e8e8e6;
  background: #f5f8ef;
  flex-wrap: wrap;
}

/* Override outline colour inside the modal (white bg context) */
.kh-cc-modal-footer .kh-cc-btn-outline {
  color: #313647;
  border-color: #cfd0cd;
  background: transparent;
}

.kh-cc-modal-footer .kh-cc-btn-outline:hover {
  background: #ececea;
  color: #1e2b0e;
  border-color: #b0b5ab;
}

/* ── Cookie-settings re-opener link (added to footer) ── */
/* Color, text-decoration, font-size, font-weight come from .footer-link in Style.V1.css.
   This rule only resets the button's native appearance. */
.kh-cc-reopen-link {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  line-height: inherit;
  vertical-align: baseline;
  display: inline;
  /* color and text-decoration intentionally NOT set here — .footer-link handles them */
}

.kh-cc-reopen-link:focus-visible {
  outline: 2px solid #ffd966;
  outline-offset: 2px;
}

/* ── Responsive adjustments ── */
@media (max-width: 600px) {
  #kh-cc-banner {
    padding: 16px;
  }

  .kh-cc-actions {
    flex-direction: column;
  }

  .kh-cc-btn {
    width: 100%;
    padding: 11px 12px;
  }

  .kh-cc-modal-box {
    border-radius: 12px;
  }

  .kh-cc-modal-footer {
    flex-direction: column-reverse;
    gap: 6px;
  }

  .kh-cc-btn-sm {
    width: 100%;
    justify-content: center;
  }

  .kh-cc-modal-body {
    max-height: 50vh;
  }
}
