/* ═══════════════════════════════════════════════
   FLY TECH Cookie Consent
   CI: #00A987 | Dark Navy Theme
   ═══════════════════════════════════════════════ */

:root {
  --cc-brand:        #00A987;
  --cc-brand-dark:   #007E66;
  --cc-brand-deeper: #005E4C;
  --cc-brand-soft:   #DFF7F1;
  --cc-brand-glow:   rgba(0, 169, 135, 0.35);
  --cc-bg:           rgba(10, 20, 18, 0.97);
  --cc-surface:      rgba(12, 20, 28, 0.98);
  --cc-text:         #f1f5f9;
  --cc-text-muted:   #94a3b8;
  --cc-border:       rgba(148, 163, 184, 0.15);
  --cc-shadow:       0 -8px 40px rgba(0,0,0,.50), 0 -1px 4px rgba(0,0,0,.3);
  --cc-shadow-modal: 0 28px 90px rgba(0,0,0,.70);
  --cc-radius:       18px;
  --cc-z:            100000;
  --cc-ease:         .28s cubic-bezier(.4,0,.2,1);
  --cc-font:         'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ─── Banner ─── */
#cc-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: var(--cc-z);
  font-family: var(--cc-font);

  /* CI Green — เขียวเหมือน CTA Band */
  background: linear-gradient(135deg, rgba(0,169,135,.92), rgba(0,94,76,.92));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border-top: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 -4px 24px rgba(0,0,0,.28);

  transform: translateY(100%);
  opacity: 0;
  transition: transform var(--cc-ease), opacity var(--cc-ease);
  will-change: transform;
}
#cc-banner.cc-visible  { transform: translateY(0); opacity: 1; }
#cc-banner.cc-hiding   { transform: translateY(100%); opacity: 0; }

/* ซ่อนไอคอนคุกกี้ */
.cc-banner-icon { display: none; }

.cc-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cc-banner-text { flex: 1; min-width: 200px; }

.cc-banner-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px;
}

.cc-banner-desc {
  font-size: 13px;
  color: rgba(255,255,255,.82);
  margin: 0;
  line-height: 1.55;
}

.cc-link {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 700;
  opacity: .9;
  transition: opacity .15s;
}
.cc-link:hover { opacity: 1; }

.cc-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ─── Shared button ─── */
.cc-btn {
  font-family: var(--cc-font);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 20px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--cc-ease), border-color var(--cc-ease), transform .12s, box-shadow .15s;
  white-space: nowrap;
  line-height: 1.4;
}
.cc-btn:active { transform: scale(0.97); }
.cc-btn:focus-visible { outline: 2px solid var(--cc-brand); outline-offset: 2px; }

/* CI Green — "ยอมรับทั้งหมด" พื้นขาว ตัวเขียวเข้ม (เหมือน btn-contact--primary) */
.cc-btn-primary {
  background: #ffffff;
  color: var(--cc-brand-deeper);
  border-color: rgba(255,255,255,.85);
  box-shadow: none;
}
.cc-btn-primary:hover { transform: translateY(-1px); background: #f0fdf9; }

/* Ghost — ปุ่ม "ปฏิเสธ" บนพื้นเขียว */
.cc-btn-secondary {
  background: rgba(0,0,0,.12);
  color: #ffffff;
  border-color: rgba(255,255,255,.45);
  backdrop-filter: blur(4px);
}
.cc-btn-secondary:hover { background: rgba(0,0,0,.22); border-color: rgba(255,255,255,.60); }

/* Outline — ปุ่ม "ตั้งค่า" บนพื้นเขียว */
.cc-btn-outline {
  background: rgba(0,0,0,.12);
  color: #ffffff;
  border-color: rgba(255,255,255,.45);
}
.cc-btn-outline:hover { background: rgba(0,0,0,.22); border-color: rgba(255,255,255,.60); }

/* Modal: คืน style เดิมสำหรับปุ่มใน modal (พื้นมืด) */
.cc-modal .cc-btn-primary {
  background: linear-gradient(135deg, var(--cc-brand), var(--cc-brand-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 18px 42px var(--cc-brand-glow);
}
.cc-modal .cc-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 22px 55px rgba(0,169,135,.45); }

.cc-modal .cc-btn-secondary {
  background: rgba(255,255,255,.05);
  color: var(--cc-text);
  border-color: rgba(148,163,184,.28);
}
.cc-modal .cc-btn-secondary:hover { background: rgba(255,255,255,.09); }

.cc-modal .cc-btn-outline {
  background: transparent;
  color: var(--cc-text-muted);
  border-color: rgba(148,163,184,.22);
}
.cc-modal .cc-btn-outline:hover { color: var(--cc-text); background: rgba(255,255,255,.04); }

/* ─── Modal Overlay ─── */
#cc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--cc-z) + 1);
  background: rgba(2, 8, 12, 0.80);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--cc-ease);
}
#cc-modal-overlay.cc-visible { opacity: 1; pointer-events: all; }

/* ─── Modal ─── */
.cc-modal {
  background:
    radial-gradient(900px 520px at 55% 10%, rgba(0,169,135,.10), transparent 58%),
    var(--cc-surface);
  border-radius: var(--cc-radius);
  border: 1px solid var(--cc-border);
  box-shadow: var(--cc-shadow-modal);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  font-family: var(--cc-font);
  color: var(--cc-text);
  transform: translateY(16px) scale(0.98);
  transition: transform var(--cc-ease);
  overflow: hidden;
}
#cc-modal-overlay.cc-visible .cc-modal { transform: translateY(0) scale(1); }

/* Header */
.cc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--cc-border);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(0,169,135,.06), transparent);
}

.cc-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--cc-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cc-modal-title::before { content: '🍪'; font-size: 17px; }

.cc-modal-close {
  width: 32px; height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(255,255,255,.04);
  color: var(--cc-text-muted);
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--cc-ease), color var(--cc-ease);
}
.cc-modal-close:hover { background: rgba(255,255,255,.08); color: var(--cc-text); }

/* Body */
.cc-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,169,135,.3) transparent;
}
.cc-modal-body::-webkit-scrollbar { width: 4px; }
.cc-modal-body::-webkit-scrollbar-track { background: transparent; }
.cc-modal-body::-webkit-scrollbar-thumb { background: rgba(0,169,135,.3); border-radius: 999px; }

.cc-modal-intro {
  font-size: 13px;
  color: var(--cc-text-muted);
  line-height: 1.65;
  margin: 0 0 18px;
}

/* ─── Categories ─── */
.cc-categories { display: flex; flex-direction: column; gap: 10px; }

.cc-category {
  border: 1px solid var(--cc-border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color var(--cc-ease);
}
.cc-category:has(input:checked) { border-color: rgba(0,169,135,.35); }

.cc-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(255,255,255,.02);
}

.cc-category-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }

.cc-category-label { font-size: 14px; font-weight: 700; color: var(--cc-text); }

.cc-category-desc { font-size: 12px; color: var(--cc-text-muted); line-height: 1.5; }

/* ─── Toggle Switch ─── */
.cc-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  cursor: pointer;
}
.cc-switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.cc-slider {
  position: relative;
  display: inline-block;
  width: 44px; height: 24px;
  background: rgba(148,163,184,.2);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 12px;
  transition: background var(--cc-ease), box-shadow var(--cc-ease);
  flex-shrink: 0;
}
.cc-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--cc-ease), box-shadow var(--cc-ease);
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

.cc-switch input:checked + .cc-slider {
  background: linear-gradient(135deg, var(--cc-brand), var(--cc-brand-dark));
  border-color: transparent;
  box-shadow: 0 0 12px rgba(0,169,135,.3);
}
.cc-switch input:checked + .cc-slider::before { transform: translateX(20px); }
.cc-switch input:focus-visible + .cc-slider { outline: 2px solid var(--cc-brand); outline-offset: 2px; }

.cc-switch-disabled { opacity: 0.75; cursor: not-allowed; }
.cc-switch-disabled .cc-slider {
  background: linear-gradient(135deg, var(--cc-brand), var(--cc-brand-dark)) !important;
  cursor: not-allowed;
}

.cc-required-badge {
  font-size: 10px;
  font-weight: 800;
  color: var(--cc-brand);
  background: rgba(0,169,135,.12);
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: .3px;
  border: 1px solid rgba(0,169,135,.25);
}

/* ─── Modal Footer ─── */
.cc-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--cc-border);
  flex-shrink: 0;
  flex-wrap: wrap;
  background: linear-gradient(0deg, rgba(0,169,135,.04), transparent);
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .cc-banner-inner { padding: 14px 18px; gap: 14px; }
  .cc-banner-actions { width: 100%; justify-content: flex-end; }

  .cc-modal {
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-width: 100%;
    transform: translateY(24px);
  }
  #cc-modal-overlay { align-items: flex-end; padding: 0; }
  .cc-modal-footer { flex-direction: column-reverse; }
  .cc-modal-footer .cc-btn { width: 100%; text-align: center; padding: 14px; }
}