/* GDPR Cookie Consent Manager - Professional UI with site styles */

/* Banner (bottom bar, dark background) */
#cmp-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2147483646;
  display: none;
  background: #1a1f2e;
  color: #ffffff;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  font-family: var(--font-1, 'DM Sans', sans-serif);
}

#cmp-banner.show {
  display: block;
}

.cmp-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
}

.cmp-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cmp-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.cmp-logo-text {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.cmp-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

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

/* Buttons - использование глобальных стилей */
.cmp-btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-family: var(--font-1, 'DM Sans', sans-serif);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  white-space: nowrap;
}

.cmp-btn.primary {
  background: var(--accent-color, #2868ed);
  color: #ffffff;
}

.cmp-btn.primary:hover {
  background: var(--accent-hover, #2a71d3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(40, 104, 237, 0.3);
}

.cmp-btn.secondary {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.cmp-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.cmp-btn.ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  padding: 10px 16px;
}

.cmp-btn.ghost:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Modal */
#cmp-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: none;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-family: var(--font-1, 'DM Sans', sans-serif);
}

#cmp-modal.show {
  display: flex;
}

#cmp-modal .panel {
  background: #ffffff;
  color: var(--text-color, #2b2b2b);
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

#cmp-modal .header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 1rem;
}

#cmp-modal .header-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

#cmp-modal .header-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#cmp-modal .header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-color, #2b2b2b);
}

#cmp-modal .close-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-2, #5e5e5e);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

#cmp-modal .close-btn:hover {
  background: #f3f4f6;
  color: var(--text-color, #2b2b2b);
}

#cmp-modal .body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

#cmp-modal .intro {
  margin-bottom: 1.5rem;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-2, #5e5e5e);
}

.cmp-category {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
}

.cmp-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.cmp-category strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-color, #2b2b2b);
}

.cmp-category p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-2, #5e5e5e);
}

/* Toggle Switch */
.cmp-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.cmp-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cmp-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 24px;
  transition: background 0.3s;
}

.cmp-toggle-slider:before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cmp-toggle input:checked + .cmp-toggle-slider {
  background: var(--accent-color, #2868ed);
}

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

.cmp-toggle input:disabled + .cmp-toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

#cmp-modal .footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Manage Cookies link in footer */
.cmp-manage-link {
  color: var(--color-2, #5e5e5e);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.cmp-manage-link:hover {
  color: var(--accent-color, #2868ed);
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .cmp-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
  }

  .cmp-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .cmp-btn {
    flex: 1;
    min-width: 100px;
  }

  #cmp-modal .panel {
    margin: 1rem;
  }
}
