/* ==========================================
   MODERN COOKIE CONSENT SYSTEM
   ========================================== */

/* 1. Floating Card Banner */
.cookie-floating-card {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: min(420px, calc(100vw - 48px));
  background: #ffffff;
  padding: 24px;
  z-index: 9999;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  display: grid;
  gap: 16px;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-floating-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cookie-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cookie-icon-shield {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: #fef2f2;
  color: #f03350;
  border-radius: 10px;
}

.cookie-card-header strong {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
}

.cookie-floating-card p {
  margin: 0;
  font-size: 0.94rem;
  color: #64748b;
  line-height: 1.5;
}

.cookie-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.cookie-btn-group {
  display: flex;
  gap: 8px;
}

/* 2. Preferences Modal */
.cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cookie-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

.cookie-preferences-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -45%);
  width: min(560px, calc(100vw - 32px));
  max-height: 90vh;
  background: #ffffff;
  z-index: 10001;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-preferences-modal.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.cookie-modal-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cookie-modal-header {
  padding: 24px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cookie-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.cookie-modal-close {
  background: none;
  font-size: 1.8rem;
  line-height: 1;
  color: #94a3b8;
}

.cookie-modal-body {
  padding: 24px;
  overflow-y: auto;
}

.cookie-modal-body p {
  color: #64748b;
  margin-bottom: 24px;
}

.cookie-pref-list {
  display: grid;
  gap: 20px;
}

.cookie-pref-item {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f8fafc;
}

.cookie-pref-info strong {
  display: block;
  font-size: 1rem;
  color: #0f172a;
  margin-bottom: 4px;
}

.cookie-pref-info p {
  margin: 0;
  font-size: 0.88rem;
  color: #64748b;
}

.cookie-modal-footer {
  padding: 24px;
  border-top: 1px solid #f1f5f9;
}

/* 3. Toggles & Buttons */
.cookie-pref-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.cookie-pref-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #e2e8f0;
  transition: .3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #f03350;
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.is-locked .toggle-slider {
  background-color: #cbd5e1;
  cursor: not-allowed;
}

.cookie-btn-primary {
  background: #f03350;
  color: #fff;
  padding: 12px 24px;
  font-weight: 700;
  border-radius: 8px;
  transition: background 0.2s;
}

.cookie-btn-primary:hover { background: #da2644; }

.cookie-btn-outline {
  background: #fff;
  color: #64748b;
  border: 1px solid #e2e8f0;
  padding: 12px 20px;
  font-weight: 700;
  border-radius: 8px;
}

.cookie-btn-link {
  background: none;
  color: #64748b;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: underline;
}

.full-width { width: 100%; }

@media (max-width: 640px) {
  .cookie-floating-card {
    left: 16px;
    bottom: 16px;
    width: calc(100vw - 32px);
  }
  .cookie-card-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
