/**
 * Cookie preferences toggles (page cookies uniquement)
 */

.cookie-toggle-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--color-border);

  &:last-of-type {
    border-bottom: none;
  }

  & .cookie-toggle-info {
    & h3 {
      font-family: var(--font-heading);
      font-weight: 700;
      color: var(--color-primary);
      margin-bottom: var(--space-1);
    }

    & p {
      font-size: var(--text-sm);
      color: var(--color-text-light);
      line-height: 1.6;
    }
  }
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;

  & input {
    opacity: 0;
    width: 0;
    height: 0;

    &:checked + .toggle-slider {
      background-color: var(--color-secondary);

      &::before {
        transform: translateX(24px);
      }
    }

    &:focus + .toggle-slider {
      box-shadow: 0 0 0 3px rgba(72, 85, 99, 0.25);
    }

    &:disabled + .toggle-slider {
      background-color: var(--color-secondary);
      opacity: 0.6;
      cursor: not-allowed;
    }
  }

  & .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--color-border);
    transition: var(--transition);

    &::before {
      position: absolute;
      content: '';
      height: 20px;
      width: 20px;
      left: 4px;
      bottom: 4px;
      background-color: white;
      transition: var(--transition);
      border-radius: 50%;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    }
  }
}

#cookie-pref-confirmation {
  display: none;
  background-color: #ecfdf5;
  border: 1px solid #6ee7b7;
  padding: var(--space-4) var(--space-5);
  margin-top: var(--space-5);
  color: #065f46;
  font-size: var(--text-sm);
  font-weight: 600;
}

#cookie-preferences-form {
  & .cookie-toggle-info h3 {
    margin-top: 0;
  }
}
