/* =====================================================================
   consent.css — Cookie Consent UI
   ออกแบบให้เข้ากับธีมเดิม (ดำ/ขาว) ของ NALT และไม่ทับ z-index ของ nivoSlider
   ===================================================================== */

:root {
  --cc-bg: #ffffff;
  --cc-fg: #1a1a1a;
  --cc-muted: #666;
  --cc-primary: #0b5ccf;      /* ปรับเป็นสีแบรนด์ได้ */
  --cc-primary-fg: #ffffff;
  --cc-border: #e3e3e3;
  --cc-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  --cc-radius: 10px;
}

/* ---------- Banner ---------- */
#cc-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 99999;
  background: var(--cc-bg);
  color: var(--cc-fg);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  font-family: "Open Sans", Arial, sans-serif;
  transform: translateY(140%);
  transition: transform .35s ease;
}
#cc-banner.cc-open { transform: translateY(0); }

.cc-banner-inner {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 18px 22px;
  flex-wrap: wrap;
}
.cc-text { flex: 1 1 360px; min-width: 260px; }
.cc-text strong { font-size: 16px; display: block; margin-bottom: 4px; }
.cc-text p { font-size: 13.5px; line-height: 1.6; color: var(--cc-muted); margin: 0; }

/* ---------- Policy link ---------- */
.cc-policy-link {
  color: var(--cc-primary);
  text-decoration: underline;
  font-weight: 600;
  white-space: nowrap;
}
.cc-policy-link:hover { filter: brightness(.9); }
.cc-modal-policy { margin: 0 0 8px; font-size: 13.5px; }

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

/* ---------- Buttons (reject กับ accept ขนาดเท่ากัน = ไม่ dark pattern) ---------- */
.cc-btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--cc-border);
  background: #f4f4f4;
  color: var(--cc-fg);
  min-width: 110px;
  transition: filter .15s ease, background .15s ease;
}
.cc-btn:hover { filter: brightness(.96); }
.cc-btn-primary {
  background: var(--cc-primary);
  border-color: var(--cc-primary);
  color: var(--cc-primary-fg);
}
.cc-btn-ghost { background: #fff; }

/* ---------- Modal ---------- */
#cc-modal { position: fixed; inset: 0; z-index: 100000; display: none; }
#cc-modal.cc-open { display: block; }
.cc-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.cc-modal-box {
  position: relative;
  max-width: 560px;
  margin: 6vh auto;
  background: var(--cc-bg);
  color: var(--cc-fg);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  padding: 26px 28px;
  font-family: "Open Sans", Arial, sans-serif;
  max-height: 88vh;
  overflow-y: auto;
}
.cc-modal-box h3 { margin: 0 0 16px; font-size: 20px; }

.cc-row { border-top: 1px solid var(--cc-border); padding: 14px 0; }
.cc-row-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cc-row-title { font-weight: 600; font-size: 15px; }
.cc-row-desc { margin: 6px 0 0; font-size: 13px; color: var(--cc-muted); line-height: 1.55; }
.cc-always { font-size: 12.5px; color: #2e7d32; font-weight: 600; white-space: nowrap; }

.cc-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* ---------- Toggle switch ---------- */
.cc-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.cc-switch input { opacity: 0; width: 0; height: 0; }
.cc-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #ccc; border-radius: 26px; transition: background .2s;
}
.cc-slider::before {
  content: ""; position: absolute; height: 20px; width: 20px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: transform .2s;
}
.cc-switch input:checked + .cc-slider { background: var(--cc-primary); }
.cc-switch input:checked + .cc-slider::before { transform: translateX(20px); }
.cc-switch input:focus-visible + .cc-slider { outline: 2px solid var(--cc-primary); outline-offset: 2px; }

/* ---------- Floating settings button ---------- */
#cc-fab {
  position: fixed; left: 16px; bottom: 16px; z-index: 99998;
  width: 46px; height: 46px; border-radius: 50%;
  background: #000; color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  transition: transform .15s ease;
}
#cc-fab:hover { transform: scale(1.08); }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .cc-banner-inner { padding: 16px; }
  .cc-actions { width: 100%; }
  .cc-btn { flex: 1 1 auto; min-width: 0; }
  #cc-fab { width: 42px; height: 42px; }
}