/* ==========================================================================
   Cookie Banner Component
   ========================================================================== */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--color-surface);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform var(--transition-base);
}

.cookie-banner.active {
  transform: translateY(0);
}

.cookie-banner-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md);
}

.cookie-banner-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .cookie-banner-content {
    flex-direction: row;
    align-items: center;
  }
}

.cookie-banner-text {
  flex: 1;
}

.cookie-banner-text p {
  font-size: var(--fs-sm);
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.cookie-banner-text p:last-child {
  margin-bottom: 0;
}

.cookie-banner-text a {
  color: var(--color-secondary);
  text-decoration: underline;
}

.cookie-banner-icon {
  display: none;
}

@media (min-width: 768px) {
  .cookie-banner-icon {
    display: block;
    font-size: 2rem;
    margin-right: var(--space-sm);
  }
}

.cookie-banner-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.cookie-btn {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.cookie-btn--accept {
  background-color: var(--color-secondary);
  color: white;
  border: none;
}

.cookie-btn--accept:hover {
  background-color: #d13350;
}

.cookie-btn--reject {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.cookie-btn--reject:hover {
  border-color: var(--color-text);
}

.cookie-btn--settings {
  background-color: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}

.cookie-btn--settings:hover {
  background-color: var(--color-accent);
  color: white;
}

/* Cookie Settings Modal
   ========================================================================== */
.cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.cookie-modal.active {
  opacity: 1;
  visibility: visible;
}

.cookie-modal-content {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.cookie-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.cookie-modal-title {
  font-size: var(--fs-lg);
  font-weight: 700;
}

.cookie-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.cookie-modal-close:hover {
  color: var(--color-text);
}

.cookie-modal-close svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.cookie-modal-body {
  padding: var(--space-md);
}

.cookie-category {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.cookie-category:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

.cookie-category-name {
  font-size: var(--fs-base);
  font-weight: 600;
}

.cookie-category-description {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

/* Toggle Switch */
.cookie-toggle {
  position: relative;
  width: 48px;
  height: 24px;
}

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

.cookie-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-border);
  border-radius: 24px;
  transition: background-color var(--transition-fast);
}

.cookie-toggle-slider::before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background-color: var(--color-secondary);
}

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

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

.cookie-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
}
