/* =====================================================
   SMILE VAN VIP — Cookie Consent Banner
   Google Consent Mode v2 compliant
   ===================================================== */

/* ── Banner ── */
#consent-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 99991;
  width: min(680px, calc(100vw - 32px));

  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 4px 6px rgba(0,0,0,0.04),
    0 20px 60px rgba(11, 26, 53, 0.18),
    0 0 0 1px rgba(22,124,233,0.08);

  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    visibility 0.4s ease;
}

#consent-banner.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ── Header strip ── */
.consent-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px 0;
}

/* ── Close (X) button ── */
#consent-close {
  margin-left: auto;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: #f0f4ff;
  color: #888;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
#consent-close:hover {
  background: #fee2e2;
  color: #dc2626;
}

.consent-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #167ce9, #3b9aff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(22,124,233,0.3);
}

.consent-header-text h3 {
  font-family: 'Sarabun', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 2px;
}

.consent-header-text p {
  font-family: 'Sarabun', sans-serif;
  font-size: 12px;
  color: #888;
}

/* ── Body ── */
.consent-body {
  padding: 14px 24px 0;
}

.consent-desc {
  font-family: 'Sarabun', sans-serif;
  font-size: 13.5px;
  color: #555;
  line-height: 1.7;
  margin-bottom: 16px;
}

.consent-desc a {
  color: #167ce9;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Toggles  ── */
.consent-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.consent-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f7f9fc;
  border-radius: 10px;
  gap: 12px;
  border: 1px solid rgba(22,124,233,0.06);
}

.consent-toggle-info {
  flex: 1;
}

.consent-toggle-label {
  font-family: 'Sarabun', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  display: block;
  margin-bottom: 2px;
}

.consent-toggle-desc {
  font-family: 'Sarabun', sans-serif;
  font-size: 11.5px;
  color: #888;
  line-height: 1.5;
}

/* pill required */
.consent-required {
  font-family: 'Sarabun', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(22,124,233,0.1);
  color: #167ce9;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* toggle switch */
.consent-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

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

.consent-switch-track {
  position: absolute;
  inset: 0;
  background: #ddd;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.25s ease;
}

.consent-switch-track::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.consent-switch input:checked + .consent-switch-track {
  background: #167ce9;
}

.consent-switch input:checked + .consent-switch-track::before {
  transform: translateX(18px);
}

.consent-switch input:disabled + .consent-switch-track {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Buttons ── */
.consent-actions {
  display: flex;
  gap: 10px;
  padding: 0 24px 20px;
  flex-wrap: wrap;
}

.consent-btn {
  flex: 1;
  min-width: 120px;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.consent-btn:hover {
  transform: translateY(-1px);
}

.consent-btn-accept {
  background: #167ce9;
  color: #fff;
  box-shadow: 0 4px 14px rgba(22,124,233,0.3);
}

.consent-btn-accept:hover {
  box-shadow: 0 6px 20px rgba(22,124,233,0.45);
}

.consent-btn-custom {
  background: #f0f4ff;
  color: #167ce9;
  border: 1px solid rgba(22,124,233,0.2);
}

.consent-btn-custom:hover {
  background: #e4ecff;
}

.consent-btn-reject {
  background: #f7f7f7;
  color: #888;
  border: 1px solid #e5e5e5;
  flex: 0 0 auto;
  font-size: 13px;
}

.consent-btn-reject:hover {
  background: #eee;
}

/* ── Preferences panel ── */
#consent-prefs {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  border-top: 1px solid transparent;
  padding: 0 24px;
  transition:
    max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease,
    padding 0.3s ease,
    border-top-color 0.3s ease;
}

#consent-prefs.open {
  max-height: 350px;
  opacity: 1;
  border-top: 1px solid rgba(22,124,233,0.08);
  padding: 16px 24px;
}

/* ── Reopen badge ── */
#consent-reopen {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 89000;
  background: #fff;
  border: 1px solid rgba(22,124,233,0.15);
  border-radius: 40px;
  padding: 8px 16px 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Sarabun', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition:
    opacity 0.4s ease,
    visibility 0.4s ease,
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
}

#consent-reopen.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.4s ease 0.3s,
    visibility 0.4s ease 0.3s,
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s,
    box-shadow 0.2s ease;
}

#consent-reopen:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

#consent-reopen .reopen-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #167ce9, #3b9aff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  #consent-banner {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 20px 20px 0 0;
    transform: translateY(20px);
  }

  #consent-banner.show {
    transform: translateY(0);
  }

  .consent-actions {
    flex-direction: column;
  }

  .consent-btn-reject {
    flex: 1;
  }

  #consent-reopen {
    bottom: 16px;
    left: 12px;
  }
}
