/* ============================================================
   Cookie Consent Banner + Settings Panel
   Shared across PHP legacy pages
   All classes prefixed with cp- to avoid conflicts
   ============================================================ */

/* --- CONSENT BANNER --- */
.cp-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26, 32, 44, 0.97);
  z-index: 9999;
  padding: 1rem;
  animation: cpFadeIn 0.3s ease;
}

.cp-consent-banner.cp-fade-out {
  animation: cpFadeOut 0.25s ease forwards;
}

.cp-consent-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.cp-consent-msg {
  color: #fff;
  font-size: 0.85rem;
  line-height: 1.4;
  flex: 1;
}

.cp-consent-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cp-btn-essential {
  background: transparent;
  border: 1px solid #B0B8B8;
  color: #B0B8B8;
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

.cp-btn-essential:hover {
  border-color: #fff;
  color: #fff;
}

.cp-btn-manage {
  background: none;
  border: none;
  color: #87CEEB;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  padding: 0.5rem 0;
}

.cp-btn-manage:hover {
  text-decoration: underline;
}

.cp-btn-accept {
  background: #007A7A;
  border: none;
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
}

.cp-btn-accept:hover {
  background: #009999;
}

/* --- SETTINGS PANEL --- */
.cp-settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 10000;
  animation: cpFadeIn 0.2s ease;
}

.cp-settings-overlay.cp-fade-out {
  animation: cpFadeOut 0.25s ease forwards;
}

.cp-settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100%;
  background: #fff;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  animation: cpSlideIn 0.3s ease-out;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.cp-settings-panel.cp-slide-out {
  animation: cpSlideOut 0.25s ease forwards;
}

.cp-settings-header {
  padding: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  position: relative;
}

.cp-settings-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: #1a202c;
  margin: 0 0 0.35rem;
}

.cp-settings-subtitle {
  font-size: 0.82rem;
  color: #718096;
  margin: 0;
  line-height: 1.4;
}

.cp-settings-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #718096;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.cp-settings-close:hover {
  color: #1a202c;
}

.cp-settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.cp-cookie-card {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.cp-cookie-card-text {
  flex: 1;
}

.cp-cookie-card-label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: #1a202c;
  margin: 0 0 0.3rem;
}

.cp-cookie-card-desc {
  font-size: 0.78rem;
  color: #718096;
  line-height: 1.4;
  margin: 0;
}

/* --- iOS-STYLE TOGGLE --- */
.cp-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 0.15rem;
  display: inline-block;
}

.cp-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cp-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #CBD5E0;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}

.cp-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.cp-toggle input:checked + .cp-toggle-slider {
  background: #007A7A;
}

.cp-toggle input:checked + .cp-toggle-slider::before {
  transform: translateX(20px);
}

.cp-toggle.cp-toggle-locked .cp-toggle-slider {
  background: #007A7A;
  opacity: 0.5;
  cursor: default;
}

.cp-toggle.cp-toggle-locked .cp-toggle-slider::before {
  transform: translateX(20px);
}

/* --- SETTINGS FOOTER --- */
.cp-settings-footer {
  padding: 1.25rem;
  border-top: 1px solid #e2e8f0;
}

.cp-btn-save {
  width: 100%;
  background: #007A7A;
  border: none;
  color: #fff;
  padding: 0.65rem;
  border-radius: 4px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

.cp-btn-save:hover {
  background: #009999;
}

.cp-settings-footnote {
  font-size: 0.7rem;
  color: #a0aec0;
  text-align: center;
  margin-top: 0.5rem;
}

/* --- ANIMATIONS --- */
@keyframes cpFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cpFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes cpSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes cpSlideOut {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

/* --- MOBILE --- */
@media (max-width: 600px) {
  .cp-consent-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .cp-consent-actions {
    flex-wrap: wrap;
    justify-content: center;
  }

  .cp-settings-panel {
    width: 100%;
  }
}
